Skip to content

inital version for experiment YAML template and JSON schema - #460

Merged
comcon1 merged 7 commits into
NMRLipids:mainfrom
korbinib:exp_schema
Feb 24, 2026
Merged

inital version for experiment YAML template and JSON schema#460
comcon1 merged 7 commits into
NMRLipids:mainfrom
korbinib:exp_schema

Conversation

@korbinib

@korbinib korbinib commented Feb 10, 2026

Copy link
Copy Markdown
Collaborator

This will partially address #459 .

Adding the schema for experiments.


📚 Documentation preview 📚: https://databank--460.org.readthedocs.build/

@korbinib
korbinib requested review from comcon1 and mdondrup February 10, 2026 10:11
@korbinib korbinib self-assigned this Feb 10, 2026
@korbinib korbinib added enhancement New feature or request schema how we read mapping files, experiments, simulations, stored data labels Feb 10, 2026
Removed unnecessary required fields from the experiment schema.
@korbinib

Copy link
Copy Markdown
Collaborator Author

@MagnusSletten could you review this PR?

@korbinib
korbinib marked this pull request as ready for review February 17, 2026 09:07
@MagnusSletten

Copy link
Copy Markdown
Collaborator

@MagnusSletten could you review this PR?

Yeah, that should be fine! I'll look at it later today 👍

@MagnusSletten MagnusSletten left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work! Couple of very minor comments, many of them are completely optional to change.

Comment thread src/fairmd/lipids/schema_validation/schema/experiment_schema.json Outdated
Comment thread src/fairmd/lipids/schema_validation/schema/experiment_schema.json Outdated
Comment thread src/fairmd/lipids/schema_validation/schema/experiment_template.yaml Outdated
Comment thread src/fairmd/lipids/schema_validation/schema/experiment_template.yaml Outdated
Comment thread src/fairmd/lipids/schema_validation/schema/experiment_schema.json Outdated
Comment on lines +98 to +99
"PH",
"PH_METHOD"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PH_METHOD is required only if PH is not UNKNOWN

Comment thread src/fairmd/lipids/schema_validation/schema/experiment_schema.json Outdated
"properties": {
"T_RF_HEATING": {"type": "string"},
"INSTRUMENT": {"type": "string"},
"METHOD": {"type": "string"},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this field we have a specific list. This is what AI wrote for me:

"METHOD": {
  "type": "string",
  "description": "Field identifying the NMR method used (formatted as METHOD:SUBMETHOD, e.g., '2H:QE').",
  "examples": [
    "2H:SP",
    "2H:QE",
    "CDLF:REDOR",
    "CDLF:DIPSHIFT",
    "CDLF:recDIPSHIFT",
    "PDLF:DROSS",
    "PDLF:R18_1^7",
    "PDLF:see_comments"
  ],
  "pattern": "^(2H:(SP|QE|see_comments)|CDLF:(REDOR|DIPSHIFT|recDIPSHIFT|see_comments)|PDLF:(DROSS|R[0-9]+(_[0-9]+)?\\^[0-9]+|see_comments))$"
}

"properties": {
"SOURCE": {"type": "string"},
"LAMBDA": {"type": "string"},
"QRANGE": {"type": "number"},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

qrange is a range, not a number

"description": "X-ray Specific Metadata",
"properties": {
"SOURCE": {"type": "string"},
"LAMBDA": {"type": "string"},

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a number, because it's a wavelength

Comment thread src/fairmd/lipids/schema_validation/schema/experiment_schema.json Outdated
Comment thread src/fairmd/lipids/schema_validation/schema/experiment_template.yaml Outdated
Comment thread src/fairmd/lipids/schema_validation/schema/experiment_template.yaml Outdated
Comment thread src/fairmd/lipids/schema_validation/schema/experiment_template.yaml Outdated
Comment thread src/fairmd/lipids/schema_validation/schema/experiment_template.yaml Outdated
Updated comments and corrected typos in the experiment template schema.
Changed LAMBDA type from string to number for accuracy.
Updated the experiment schema and modified required fields based on conditions.
@korbinib
korbinib requested a review from comcon1 February 23, 2026 14:30
@korbinib

Copy link
Copy Markdown
Collaborator Author

@comcon1 tried to address all comment in 3a82102

@comcon1 comcon1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I found a small comment. Have you tried to run the validation over the real DB?

Comment thread src/fairmd/lipids/schema_validation/schema/experiment_schema.json Outdated
Co-authored-by: Korbinian Bösl <korbinian.bosl@uib.no>
@korbinib

Copy link
Copy Markdown
Collaborator Author

I would merge but it will complain about all the information according to the old schema.

e.g.:

experiments/OrderParameters/10.1039/B508190D/3/README.yaml::$: Additional properties are not allowed ('COUNTER_IONS', 'DOI', 'ION_CONCENTRATIONS', 'MOLAR_FRACTIONS', 'TOTAL_LIPID_CONCENTRATION' were unexpected)
  experiments/OrderParameters/10.1039/B508190D/3/README.yaml::$: 'ARTICLE_DOI' is a required property
  experiments/OrderParameters/10.1039/B508190D/3/README.yaml::$: 'MEMBRANE_COMPOSITION' is a required property
  experiments/OrderParameters/10.1039/B508190D/3/README.yaml::$: 'TOTAL_HYDRATION' is a required property
  experiments/OrderParameters/10.1039/B508190D/3/README.yaml::$: 'PH' is a required property
  experiments/OrderParameters/10.1039/B508190D/3/README.yaml::$: {'DOI': '10.1039/B508190D', 'TEMPERATURE': 314, 'MOLAR_FRACTIONS': {'DMPC': 1}, 'ION_CONCENTRATIONS': {'POT': 0, 'SOD': 0, 'CLA': 0, 'CAL': 0}, 'TOTAL_LIPID_CONCENTRATION': 'full hydration', 'COUNTER_IONS': None} is not valid under any of the given schemas
  experiments/OrderParameters/10.1021/jacs.1c05549/2/README.yaml::$: Additional properties are not allowed ('COUNTER_IONS', 'DOI', 'ION_CONCENTRATIONS', 'MOLAR_FRACTIONS', 'TOTAL_LIPID_CONCENTRATION' were unexpected)
  experiments/OrderParameters/10.1021/jacs.1c05549/2/README.yaml::$: 'ARTICLE_DOI' is a required property
  experiments/OrderParameters/10.1021/jacs.1c05549/2/README.yaml::$: 'MEMBRANE_COMPOSITION' is a required property
  experiments/OrderParameters/10.1021/jacs.1c05549/2/README.yaml::$: 'TOTAL_HYDRATION' is a required property
  experiments/OrderParameters/10.1021/jacs.1c05549/2/README.yaml::$: 'PH' is a required property
  experiments/OrderParameters/10.1021/jacs.1c05549/2/README.yaml::$: {'DOI': '10.1021/jacs.1c05549', 'TEMPERATURE': 310.0, 'MOLAR_FRACTIONS': {'POPE': 1}, 'ION_CONCENTRATIONS': {'POT': 0, 'SOD': 0, 'CLA': 0, 'CAL': 0}, 'TOTAL_LIPID_CONCENTRATION': 'full hydration', 'COUNTER_IONS': None} is not valid under any of the given schemas
  Underlying errors caused this.

Comment thread src/fairmd/lipids/schema_validation/schema/experiment_schema.json Outdated
@korbinib
korbinib requested a review from comcon1 February 24, 2026 11:09
@comcon1
comcon1 merged commit 65874d4 into NMRLipids:main Feb 24, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request schema how we read mapping files, experiments, simulations, stored data

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants