From bbe13f27c8ca6384fb3515165c84be911c79236b Mon Sep 17 00:00:00 2001 From: Albert Engstfeld Date: Wed, 21 Jan 2026 22:07:33 +0100 Subject: [PATCH 1/3] Add chemicalIdentifiers to components --- examples/file_schemas/svgdigitizer.yaml | 13 +++++++++++++ pixi.toml | 2 +- schemas/general/chemical_identifiers.json | 20 ++++++++++++++++++++ schemas/general/component.json | 8 ++++++++ 4 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 schemas/general/chemical_identifiers.json diff --git a/examples/file_schemas/svgdigitizer.yaml b/examples/file_schemas/svgdigitizer.yaml index 5a4dc1e..c8e5fff 100644 --- a/examples/file_schemas/svgdigitizer.yaml +++ b/examples/file_schemas/svgdigitizer.yaml @@ -117,6 +117,19 @@ system: unit: volume percent purity: grade: analytical grade # qualitative description of the purity commonly used in the community + - name: BMPyr-TFSI + chemicalIdentifiers: + - cas: 223437-11-4 + proportion: + unit: volume percent + value: 100 + source: + supplier: MERCK/emd + purity: + grade: ultrapure + purity: + refinement: vacuum dried at 120 °C + type: solvent - name: H2SO4 type: acid source: diff --git a/pixi.toml b/pixi.toml index bb7122f..384257b 100644 --- a/pixi.toml +++ b/pixi.toml @@ -1,4 +1,4 @@ -[project] +[workspace] channels = ["conda-forge"] name = "metadata-schema" platforms = ["linux-64", "osx-64", "win-64"] diff --git a/schemas/general/chemical_identifiers.json b/schemas/general/chemical_identifiers.json new file mode 100644 index 0000000..83a8d4a --- /dev/null +++ b/schemas/general/chemical_identifiers.json @@ -0,0 +1,20 @@ +{ + "$schema": "http://json-schema.org/draft-07/schema#", + "$id": "https://raw.githubusercontent.com/echemdb/metadata-schema/main/schemas/general/component.json", + "allOf": [{ "$ref": "#/definitions/ChemicalIdentifiers" }], + "definitions": { + "ChemicalIdentifiers": { + "type": "object", + "additionalProperties": true, + "properties": { + "type": { + "anyOf": [ + {"const": "cas", "description": "The CAS identifier of the chemical."}, + {"const": "inchi", "description": "The InChi of the chemical"}, + {"const": "inchikey", "description": "The InChiKey of the chemical"} + ] + } + } + } + } +} diff --git a/schemas/general/component.json b/schemas/general/component.json index 16eea32..46428b1 100644 --- a/schemas/general/component.json +++ b/schemas/general/component.json @@ -11,6 +11,14 @@ "type": "string", "description": "A unique identifier." }, + "chemicalIdentifiers": { + "type": "array", + "items": { + "items": { + "$ref": "../general/chemical_identifiers.json#/definitions/ChemicalIdentifiers" + } + } + }, "concentration": { "$ref": "../general/quantity.json#/definitions/Quantity" }, From 6f065d51767dab9b5ef9278ab9f5945d55648ba3 Mon Sep 17 00:00:00 2001 From: Albert Engstfeld Date: Wed, 21 Jan 2026 22:09:36 +0100 Subject: [PATCH 2/3] Add nes --- doc/news/chemical-identfiers.rst | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 doc/news/chemical-identfiers.rst diff --git a/doc/news/chemical-identfiers.rst b/doc/news/chemical-identfiers.rst new file mode 100644 index 0000000..a3b8b61 --- /dev/null +++ b/doc/news/chemical-identfiers.rst @@ -0,0 +1,3 @@ +**Added:** + +* Added property `chemicalIdentfiers` to components for inclusion of, i.e., cas, InChi, or InChiKey identifiers. From 25bb1ad850a0aff6e3ca6d4484a12a0725cc3ffc Mon Sep 17 00:00:00 2001 From: Albert Engstfeld Date: Wed, 21 Jan 2026 22:42:46 +0100 Subject: [PATCH 3/3] change chemicalIdentifiers to object --- examples/file_schemas/svgdigitizer.yaml | 4 +++- schemas/general/chemical_identifiers.json | 17 +++++++++++------ schemas/general/component.json | 7 +------ 3 files changed, 15 insertions(+), 13 deletions(-) diff --git a/examples/file_schemas/svgdigitizer.yaml b/examples/file_schemas/svgdigitizer.yaml index c8e5fff..b0ff88a 100644 --- a/examples/file_schemas/svgdigitizer.yaml +++ b/examples/file_schemas/svgdigitizer.yaml @@ -119,7 +119,9 @@ system: grade: analytical grade # qualitative description of the purity commonly used in the community - name: BMPyr-TFSI chemicalIdentifiers: - - cas: 223437-11-4 + cas: 223437-11-4 + inchi: InChI=1S/C9H20N.C2F6NO4S2/c1-3-4-7-10(2)8-5-6-9-10;3-1(4,5)14(10,11)9-15(12,13)2(6,7)8/h3-9H2,1-2H3;/q+1;-1 + inchikey: InChIKey=HSLXOARVFIWOQF-UHFFFAOYSA-N proportion: unit: volume percent value: 100 diff --git a/schemas/general/chemical_identifiers.json b/schemas/general/chemical_identifiers.json index 83a8d4a..a29f3a1 100644 --- a/schemas/general/chemical_identifiers.json +++ b/schemas/general/chemical_identifiers.json @@ -7,12 +7,17 @@ "type": "object", "additionalProperties": true, "properties": { - "type": { - "anyOf": [ - {"const": "cas", "description": "The CAS identifier of the chemical."}, - {"const": "inchi", "description": "The InChi of the chemical"}, - {"const": "inchikey", "description": "The InChiKey of the chemical"} - ] + "cas": { + "type": "string", + "description": "The CAS identifier of the chemical." + }, + "inchi": { + "type": "string", + "description": "The InChi of the chemical" + }, + "inchikey": { + "type": "string", + "description": "The InChiKey of the chemical" } } } diff --git a/schemas/general/component.json b/schemas/general/component.json index 46428b1..7e16565 100644 --- a/schemas/general/component.json +++ b/schemas/general/component.json @@ -12,12 +12,7 @@ "description": "A unique identifier." }, "chemicalIdentifiers": { - "type": "array", - "items": { - "items": { - "$ref": "../general/chemical_identifiers.json#/definitions/ChemicalIdentifiers" - } - } + "$ref": "../general/chemical_identifiers.json#/definitions/ChemicalIdentifiers" }, "concentration": { "$ref": "../general/quantity.json#/definitions/Quantity"