Skip to content

Bidirectional OO-LD <-> NOMAD MetaInfo converter #117

Description

@SimonStier

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.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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

converterSchema conversion to/from another schema or modelling language

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions