You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
nomad/metainfo/util.py in https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR provides metainfo_to_json_schema() and quantity_to_json_schema(), exposed as Section.m_to_json_schema()
and Quantity.m_to_json_schema(). It already produces JSON Schema Draft 2020-12 with $schema,
a resolvable $id, properties inline for Quantities, and $defs plus $ref for SubSections and
BaseSections.
So the syntactic half largely exists. The work is mainly to add the semantic half and to reconcile
the NOMAD-specific keywords, rather than to re-derive the shape.
Mapping
Section to object schema, SubSection and BaseSection to $ref, Quantity to property. Already covered by the existing exporter
Section references between Quantities to x-oold-range
Category, i.e. the generalization hierarchy, to the type hierarchy in the @context
Expressible with standard keywords: section nesting, quantity names, scalar types, array nesting
with minItems and maxItems, identity via $id. Needing an x- vendor annotation or a @context addition: the semantic IRIs, which the current export does not emit at all; unit,
which is emitted as a bare non-standard keyword string and should map to the OO-LD quantity value
representation (OO-LD/oold-schema#107); aliases, which are synonyms (OO-LD/oold-schema#12); categories and links.
Open questions
Whether to consume the existing exporter output and enrich it, or to convert from the MetaInfo objects directly
shape is walked into nested arrays with minItems/maxItems, so named dimensions and the cross-quantity axis linkage are lost, the same problem as in Bidirectional OO-LD <-> DLite data model converter #115. Worth solving once for both
Which direction is authoritative, and whether OO-LD to MetaInfo is needed at all or only MetaInfo to OO-LD
How the NOMAD $id scheme relates to the OO-LD identity keywords
Convert between OO-LD schemas and NOMAD MetaInfo definitions.
Spec-side siblings: OO-LD/oold-schema#107 (QuantityValue as a base building block) and OO-LD/oold-schema#12 (extended JSON-LD context notation for synonyms).
cc @hampusnasstrom
Starting point: NOMAD already emits JSON Schema
nomad/metainfo/util.pyin https://gitlab.mpcdf.mpg.de/nomad-lab/nomad-FAIR providesmetainfo_to_json_schema()andquantity_to_json_schema(), exposed asSection.m_to_json_schema()and
Quantity.m_to_json_schema(). It already produces JSON Schema Draft 2020-12 with$schema,a resolvable
$id, properties inline for Quantities, and$defsplus$reffor SubSections andBaseSections.
So the syntactic half largely exists. The work is mainly to add the semantic half and to reconcile
the NOMAD-specific keywords, rather than to re-derive the shape.
Mapping
$ref, Quantity to property. Already covered by the existing exporterx-oold-range@contextExpressible with standard keywords: section nesting, quantity names, scalar types, array nesting
with
minItemsandmaxItems, identity via$id. Needing anx-vendor annotation or a@contextaddition: the semantic IRIs, which the current export does not emit at all;unit,which is emitted as a bare non-standard keyword string and should map to the OO-LD quantity value
representation (OO-LD/oold-schema#107);
aliases, which are synonyms (OO-LD/oold-schema#12);categoriesandlinks.Open questions
shapeis walked into nested arrays withminItems/maxItems, so named dimensions and the cross-quantity axis linkage are lost, the same problem as in Bidirectional OO-LD <-> DLite data model converter #115. Worth solving once for both$idscheme relates to the OO-LD identity keywords