feat(scicat-metadata): multiple schemas support#180
Draft
MatthMig wants to merge 3 commits intoSciCatProject:mainfrom
Draft
feat(scicat-metadata): multiple schemas support#180MatthMig wants to merge 3 commits intoSciCatProject:mainfrom
MatthMig wants to merge 3 commits intoSciCatProject:mainfrom
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Re-implementation of PR: #178 following SciCat community suggestions
Motivation
Following issue: #173
It is a first step for the objective to ingest files of a complex structure in a facility.
This has full backwards compatibility.
Description
Adds the possibility to import a schema in another schema, opening the possibility to factorize our configs.
Here is the file structure:
In case of conflict, the importer has the priority over the imported.
Usage example
Module Schema (modules/ill.imsc.json):
{ "id": "ill-module-001", "name": "ILL Common Metadata Module", "variables": { "pid": {"source": "NXS", "path": "/entry0/user/proposal", "value_type": "string"}, "owner": {"source": "NXS", "path": "/entry0/user/name", "value_type": "string"} }, "schema": { "pid": {"field_type": "high_level", "machine_name": "pid", "value": "<pid>", "type": "string"} } }Importing Schema (d17.imsc.json):
{ "id": "d17-schema", "name": "D17 Instrument Example Schema", "import": ["ill-module-001"], "instrument": "D17", "order": 1, "selector": "filename:starts_with:/data/d17", "variables": { "detector": {"source": "NXS", "path": "/entry0/instrument/det", "value_type": "string"} }, "schema": { "instrument_properties": {"field_type": "scientific_metadata", "value": {"det": "<detector>"}} } }The resulting schema will have variables and schema from both the module and the importer.