Allow custom metainfo definitions as part of the data
Find lots of relevant information here: https://docs.google.com/presentation/d/1Q2OYB88rubQ-7abvWMlp2TsGLZv7zLSJdR0EZckcbOE/edit?usp=sharing
-
server-side implementation of cross entry references and definition references -
Python client context -
Javascript implementation -
Adopted browser GUI
!the following is an older description:
Currently, all metainfo definitions have to be part of NOMAD python sources. They are used to generate the javascript version as well. But, we could also allow some metainfo definitions to be localized in an archive.
Actually, all metainfo definitions should be referenced by the archive anyways. This means that definitions need to be referencable via more global URLs. We should have a generic mechanism that covers both build-in and on-the-fly definitions. This would be a natural extension for url references across archives, if you consider metainfos being archives themselves.
- requires URLs for metainfo definitions that can be used to proxy definitions
- of course these URLs need to be resolvable via some API
- urls are used to keep a registry of metainfo definitions. This can be made up of "predefined" definitions that are part of the installation, and definitions loaded on the fly.
Metainfo in archive
An EntryArchive
could contain a metainfo package as one of its sub-sections. This package could extend the regular
EntryArchive
with more definitions.
m_def: 'https://nomad-lab.eu/prod/v1/api/v1/metainfo#nomad.datamodel/section_definitions/EntryArchive'
metainfo:
section_definitions:
- name: EntryArchive
base_sections:
- 'https://nomad-lab.eu/prod/v1/api/v1/metainfo#nomad.datamodel/section_definitions/EntryArchive'
extends_base_section: true
sub_sections:
- name: custom_data
section_def: '#/metainfo/section_definitions/CustomData'
- name: CustomData
quantities:
- name: my_field
- type: str
custom_data:
my_field: 'Some data'
- Has huge potential for name collisions in
EntryArchive
- The package in each archive would need to be registered, e.g. with
http://mynomad.de/api/v1/entries/{}/archive#metainfo
- kinda bad if lots of entries would contain the same definitions
Metainfo in upload
If archives always have to reference the definitions of its root section, an archive could reference a section definition
in the same upload. This section could inherit from the regular EntryArchive
Archive:
m_def: '../upload/mainfile/mymetainfo.yml#/section_definitions/EntryArchive'
custom_data:
my_field: 'Some data'
Metainfo:
m_def: 'https://nomad-lab.eu/prod/v1/api/v1/metainfo#nomad.metainfo/section_definitions/Package'
url: ../uploads/files/mymetainfo.yml
section_definitions:
- name: EntryArchive
base_sections:
- 'https://nomad-lab.eu/prod/v1/api/v1/metainfo#nomad.datamodel/section_definitions/EntryArchive'
sub_sections:
- name: custom_data
section_def: '#/metainfo/section_definitions/CustomData'
- name: CustomData
quantities:
- name: my_field
- type: str
- does not have the disadvantages of metainfo in archive
- cannot be serialised into the archive automatically and the user must take care of providing the file and the right url
reference. Maybe we could add fully relative urls:
../mymetainfo.yml#/section_definitions/EntryArchive
.