Apps for python schemas
We need to ensure that app definitions targeting quantities in Python schemas can be created.
Tasks
-
Widgets can be configured for scalar quantities within a schema -
Result columns can target scalar quantities -
Result columns can be sorted by scalar quantity -
The available filters can be limited with the filters
-field.
Decisions
We need to make a decision about the syntax for targeting custom quantities:
- That path in the data is no longer enough to target a quantity. E.g.
data.sample.id
may be defined by several different schemas. We need to somehow add an identifier for the schema in the quantity name. - Schemas are identified using the
qualified_name
of the root section:- Python schemas: path of the class name, e.g.
nomadschemaexample.schema.MySchema
- YAML schemas:
entry_id:gTqaJYQ7IH20dl5PeX7ZPzkHudI8.MySchema
- Python schemas: path of the class name, e.g.
- Current proposal: use
path
+separator
+schema
to target a quantity in the schema. E.g.data.sample.id#nomadschemaexample.schema.MySchema
. - The GUI will support simplified rendering of schema identifiers to keep things simple, but in the app config and in our backend the quantities need to be identified by this full name.
- We need to make a decision on the separator. This is complicated by the fact that many separator are reserved for other purposes:
-
.
denotes section hierarchy in paths, and is also used in schema identifiers. -
:
is used in the YAML schema name and also for query modifiers, e.g.material.elements:all: ['Si', 'C']
-
/
is used in inner_section_definitions and in YAML schema paths -
&
is reserved for url query parameters -
@
is reserved for indicating a hash digest for a definition. Used to e.g. distinguish between different versions of a schema. - Any operators commonly used in boolean logic (+, -, &, |) should not be used if we want to later add support for them in the search bar.
-
Known limitations compared to "native" quantities
- Search boxes cannot show suggestions for values (due to the hierarchy being flattened within ES, our suggestion mechanism cannot filter out the values to show).
- Only scalar quantities are available (might be possible to get around, not sure)
- Nested queries are not possible (due to the hierarchy being flattened in ES)