-
Notifications
You must be signed in to change notification settings - Fork 65
extends attribute to clarify if a field in a specified NXdata is a AXISNAME or DATA
#1533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f1f7480 to
3849cbe
Compare
0c9f76d to
52d06be
Compare
|
In the example you cite, wouldn't it be much simpler to explicitly add the I confess I'm not sure exactly how to specify a list of axes in this instance, but I hope someone with more experience of NXDL syntax can fix my example. This would have the added advantage of specifying which dimensions the axes apply to. |
For this particular example, this would work, yes. The problem is that there is no mechanism that enforces anybody to write the However, an application definition can define many possible axes and you may not want to enforce a priori what the
So you cannot define the Just for explanation: the problem arises for us in the context of the research data management system we are building (NOMAD). The idea there is that the schema comes first. That is, you read in the NXDL definitions and already assign each of the NeXus groups/fields/attributes to a unique concept, which also includes all the inheritance chain and all sub-elements. There is absolutely no way to say if the I believe this is however not only relevant for us. Any ontological tool would need to understand what each concept is and the relationships between different concepts just from the data modeling, not from instance data. So this will come up with any tool trying to understand the NXDL definitions. |
There is presumably no mechanism for enforcing the use of the new
In principle, this could also be handled by the
I am not objecting in principle to this PR, but I want to make sure it's really necessary. From my own point of view, it will add non-trivial complexity to parsing application definitions in the NXValidate package, in ways that I will have to think about. Finally, I presume this is only meant for application definitions, since that is the only place where placeholder names are made explicit. |
|
The extension and clarification of We could have declared a Field Instead, a special convention has (actually a series of conventions have) been introduced. These conventions connected to The problem is that it only works for interpreting data files where the attributes are provided, but it does not work when we make new definitions where we want to declare new Fields, but it will not be possible to declare which Field it is specialising. It is important to allow its clear declaration. We are proposing a new attribute for this purpose, but @rayosborn you are right, since we now introduced open enumerations, an alternative could be the use open enumerations for Hence, I can imagine an alternative proposal where we introduce a convention of using |
|
Just to be clear, I am not set on having this new An open enumeration could potentially also work, but this is different to how open enumerations are used so far. So far, if you were to define a list like
Technically, one could also use |
bc63274 to
37f32dc
Compare
| <field name="temperature" type="NX_NUMBER"/> | ||
| <field name="voltage" type="NX_NUMBER"/> | ||
| <field name="current" type="NX_NUMBER"> | ||
| <field name="temperature" type="NX_NUMBER" extends="/NXdata/AXISNAME"/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative would be to specify @temperature_indices and @voltage_indices to signify their corresponding fields are AXISNAME instances
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@signal="current" may be too restrictive for an app def!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative would be to specify @temperature_indices and @voltage_indices to signify their corresponding fields are AXISNAME instances
That works for AXISNAME, but how about DATA? Would be nice to have a consistent way of assigning fields to one or the other.
@signal="current"may be too restrictive for an app def!
Exactly my point 👍
|
I was asked to give a use case as to why this new attribute (or, as I said above, any other solution to distinguish the inheritance of fields in Just to be clear, here is again the problem that we have: given that the two all-uppercase terms Now, why is that important. Both in the In our example, in the RDM system NOMAD, we actually build the whole NeXus tree upon initialization of the system to have a consistent data schema in the system (we call this schema the NOMAD metainfo). Here's a screenshot: With the current way the NeXus definitions are written, it is impossible to understand at this point (again, without having any data yet) whether Therefore, we want to be able to know this on the data modelling level, i.e., just from reading the XML files. Note that this is really the only case where such ambiguity exists in NeXus because nowhere else we have two fields with The way I see it, there are multiple possible solutions to this problem:
One thing that doesn't work IMO: on the application definition level, enumerate the |
|
In any case, whatever the solution is, there will need to be quite some changes to exsting files that make use of named fields in
In addition, there are several new application definitions ( |
NXdata is a AXISNAME or DATAextends attribute to clarify if a field in a specified NXdata is a AXISNAME or DATA
Since Regarding the rendering, I agree that having it on the same line looks much cleaner. I like your suggestion and have implemented it here directly (see below). However, we already have the linking to the parent concept using the |
52c895d to
7d96c86
Compare
|
If I'm understanding correctly, you are wanting to define the dependent (AXISNAME) and independent (DATA) variables from the application definition alone. You are trying to achieve this by adding a helper flag. This is not part of the core mission of NeXus (writing and reading data), although I'm still somewhat sympathetic to your issue. I'll need to think about this some more... |
|
From Telco 08/25/25: this is actually a normalization problem. The issue is that In the meantime, we have a work around for this specific case in NXdata, where In conclusion, there's more discussion here, and it's a workaroundable problem at present, so we punt this to the next release. Thanks for the discussion. |






NXdatacontains two renameable fields,AXISNAMEandDATA, that are both of typeNX_NUMBER. This naturally presents a problem in that any instance of any of the two must be properly allocated to either of the two concepts.On the data level, this is not a problem since this can be handled by properly assigning the
@signaland@axesattributes and thus it is immediately clear which data field belongs to which concept (see here).The problem is however not solved on the conceptual, data modelling level, i.e., when writing base classes and application definitions. Consider the following situation (borrowed directly from contributed_definitions/NXiv_temp):
Here, we as humans know which field in
/NXiv_temp/NXentry/NXdatais associated with which field inNXdata. However, there is no way for any interpretation tool to automatically understand this. Note that currently the way that each conceptual field is assigned toAXISNAMEorDATAis by doing namefitting, i.e., by comparing whether the name of the field more closely resembles "axisname" or "data". For this particular example, this would lead to an assignment (on the conceptual level) of/NXiv_temp/NXentry/NXdata/currenttoAXISNAME, i.e.temperaturewould be specializingNXdata/AXISNAME. See the pop-up link on the bottom of this screenshot, here we actually visualize which conceptcurrentis inheriting from.During file writing with actual data, we will assign
currenttoDATAby adding it to thesignal. However, any proper data management system will complain here because what we define on the conceptual level will not be the same as what the data provider will injest.So what I think is needed is a way to already define on the data modelling level which field is an axis and which one is a data field.
As a fix, we add an extra attribute
extendstofieldTypewhere one can explicitly say which field in the inheritance shall be extended. The language is specifically chosen to indicate that this is only possible for the use case outlined above and not for any arbitrary case (to prevent people from just extending any arbitrary field defined somewhere else).EDIT: added a rendering in the docs

This should probably be changed to using the proper link instead.