Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions examples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ To generate the output of each DCAT-AP profile into a TTL graph run:
````commandline
uv run linkml-convert -t ttl ../tests/data/valid/NMRAnalysisDataset-001.yaml -s src/dcat_4c_ap/schema/dcat_4c_ap.yaml -P "_base=https://search.nfdi4chem.de/dataset/" -C NMRAnalysisDataset
````
* Convert a single point UV-vis spectroscopy-specific DCAT-AP extension conform example
````commandline
uv run linkml-convert -t ttl ../tests/data/valid/Single-UVvis-450nm-AnalysisDataset-001.yaml -s src/dcat_4c_ap/schema/dcat_4c_ap.yaml -P "_base=https://search.nfdi4chem.de/dataset/" -C AnalysisDataset
````
* Convert domain agnostic DCAT-AP extension conform example of a MaterialSample
````commandline
uv run linkml-convert -t ttl ../tests/data/valid/MaterialSample-001.yaml -s src/dcat_4c_ap/schema/dcat_4c_ap.yaml -P "_base=https://search.nfdi4chem.de/dataset/" -C MaterialSample
Expand All @@ -37,6 +41,10 @@ To generate the output of each DCAT-AP profile into a JSON file:
````commandline
uv run linkml-convert -t json ../tests/data/valid/NMRAnalysisDataset-001.yaml -s src/dcat_4c_ap/schema/dcat_4c_ap.yaml -P "_base=https://search.nfdi4chem.de/dataset/" -C NMRAnalysisDataset
````
* Convert a single point UV-vis spectroscopy-specific DCAT-AP extension conform example
````commandline
uv run linkml-convert -t json ../tests/data/valid/Single-UVvis-450nm-AnalysisDataset-001.yaml -s src/dcat_4c_ap/schema/dcat_4c_ap.yaml -P "_base=https://search.nfdi4chem.de/dataset/" -C AnalysisDataset
````
* Convert domain agnostic DCAT-AP extension conform example of a MaterialSample
````commandline
uv run linkml-convert -t json ../tests/data/valid/MaterialSample-001.yaml -s src/dcat_4c_ap/schema/dcat_4c_ap.yaml -P "_base=https://search.nfdi4chem.de/dataset/" -C MaterialSample
Expand Down
Empty file added examples/jupyter/README.md
Empty file.
109 changes: 109 additions & 0 deletions examples/jupyter/chem_dcat_ap_explorer.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "11d9ab98",
"metadata": {},
"source": [
"# Chem-DCAT-AP Explorer notebook\n",
"\n",
"This notebook is an interactive tool for exploring the [Chem-DCAT-AP](https://github.com/nfdi4chem/chem-dcat-ap) framework.\n",
"It illustrates how to use the Chem-DCAT-AP python data structures to create and manipulate metadata about chemistry related datasets.\n",
"\n",
"This is useful, if one wants to create metadata for a dataset programmatically (e.g. by retrieving information from a database).\n",
"\n",
"## Installation\n",
"To run this notebook, please ensure you have the necessary dependencies installed. You can install them using uv:\n",
"\n",
"```bash\n",
"# in the root directory of the project, please run:\n",
"uv sync \n",
"```\n",
"\n",
"## Running the notebook\n",
"\n",
"Once you have the dependencies installed, you can run this notebook simply by opening this notebook in vscode and\n",
"point to the virtual environment created by uv, or you can run it directly in your terminal (dcat-4c-ap = .venv) or by\n",
"using Jupyter:\n",
"\n",
"```bash\n",
"uv run jupyter notebook examples/jupyter/chem_dcat_ap_explorer.ipynb\n",
"```\n",
"\n",
"---"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "b72ca59d",
"metadata": {},
"outputs": [],
"source": [
"from chem_dcat_ap.datamodel.chem_dcat_ap_pydantic import Catalogue, Dataset, Distribution, DataService"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f300ca1f",
"metadata": {},
"outputs": [],
"source": [
"chem_dataset = Dataset(\n",
" title=\"Example Dataset\",\n",
" description=\"This is an example dataset for demonstration purposes.\",\n",
" issued=\"2024-01-01\",\n",
" modified=\"2024-01-02\",\n",
" identifier=\"https://example.com/dataset/1\",\n",
")\n",
"chem_catalogue = Catalogue(\n",
" title=\"Example Catalogue\",\n",
" description=\"This is an example catalogue for demonstration purposes.\",\n",
" issued=\"2024-01-01\",\n",
" modified=\"2024-01-02\",\n",
" identifier=\"https://example.com/catalogue/1\",\n",
" dataset=[chem_dataset],\n",
")\n",
"print(chem_catalogue.model_dump_json(indent=2))"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8b4fc28b",
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"id": "0b4ec208",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "dcat-4c-ap",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.13.3"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
5 changes: 5 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,11 @@ dev = [
"mknotebooks>= 0.8.0",
"pytest>=8.3.5",
"coverage>=7.8.0",
"ipykernel>=6.31.0",
"pre-commit>=4.3.0",
]
test = [
"pytest>=8.4.2",
]

# See https://hatch.pypa.io/latest/config/build/#file-selection for how to
Expand Down
2 changes: 1 addition & 1 deletion src/chem_dcat_ap/schema/chem_dcat_ap.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: https://w3id.org/nfdi-de/dcat-ap-plus/chemistry/
version: "0.1.0rc2.post33.dev0+fb29e03e" # Managed by dynamic-versioning. Don't change this line!
version: "0.1.0rc2.post34.dev0+cb44dfdb" # Managed by dynamic-versioning. Don't change this line!
name: chem-dcat-ap
title: ChemDCAT-AP
description: |-
Expand Down
220 changes: 220 additions & 0 deletions tests/data/valid/Kinetics-UVvis-450nm-AnalysisDataset-001.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,220 @@
---
id: handle:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3
other_identifier:
- notation: https://pid4cat.org/10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3
title:
- "Kinetic UV-vis analysis at 450 nm of CRS-50440"
description:
- "Dataset for time-resolved UV-visible spectroscopy (UV-vis) kinetics measurement at 450 nm wavelength"
theme:
- preferred_label:
- "Science and technology"
is_about_entity:
- id: handle:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N.2
title: "CRS-50440"
description: "The analysed chemical substance sample CRS-50440."
rdf_type:
id: CHEBI:59999
title: "chemical substance"
has_part:
- id: handle:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N.2#EvaluatedCompound
description: "compound assigned to handle:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N.2"
other_identifier:
- notation: https://pubchem.ncbi.nlm.nih.gov/compound/26248854
rdf_type:
id: CHEBI:23367
title: molecular entity
has_qualitative_attribute:
- rdf_type:
id: CHEMINF:000059
title: "InChiKey"
value: KVOIVNBYNQXCNY-BOCHJOTCSA-N
title: "assigned InChiKey"
- rdf_type:
id: CHEMINF:000113
title: "InChi"
value: "InChI=1S/C11H12N2S/c1-12-7-10-8-14-11(13-10)9-5-3-2-4-6-9/h2-6,8,12H,7H2,1H3"
title: "assigned InChi"
- rdf_type:
id: CHEMINF:000018
title: "SMILES descriptor"
value: "CNCc1csc(n1)c1ccccc1"
title: "assigned SMILES"
- rdf_type:
id: CHEMINF:000042
title: "molecular formula"
value: "C11H12N2S"
title: "assigned molecular formula"
- rdf_type:
id: CHEMINF:000107
title: "IUPAC name"
value: "N-methyl-1-(2-phenyl-1,3-thiazol-4-yl)methanamine"
description: Chemotion IUPAC name
- rdf_type:
id: CHEMINF:000107
title: "IUPAC name"
value: "Methyl[(2-phenyl-1,3-thiazol-4-yl)methyl]amine"
description: PubChem IUPAC name
has_quantitative_attribute:
- has_quantity_type: http://qudt.org/vocab/quantitykind/MolarMass
unit: https://qudt.org/vocab/unit/GM-PER-MOL
value: 204.072119
description: "Molar mass as specified in the Chemotion repository."
- has_quantity_type: http://qudt.org/vocab/quantitykind/MolarMass
unit: https://qudt.org/vocab/unit/GM-PER-MOL
value: 204.29
description: "Molar mass as specified in PubChem"
was_generated_by:
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvisKineticAnalysis
title:
- "UV-vis kinetic analysis at 450 nm"
description:
- "Analysis of the time-resolved UV-visible trace at 450 nm wavelength."
rdf_type:
id: CHMO:0000596
title: "UV-visible spectroscopy"
evaluated_entity:
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_KineticTrace_450nm
title: "UV-vis kinetic trace at 450 nm"
description: "Time-resolved UV-vis measurements recorded during the kinetics experiment."
rdf_type:
id: CHMO:0000596
title: "UV-visible spectroscopy"
has_qualitative_attribute:
- rdf_type:
id: CHMO:0000597
title: "measurement wavelength"
value: "450"
title: "Wavelength of measurement"
has_quantitative_attribute:
- rdf_type:
id: CHMO:0000599
title: "sample temperature information"
title: "sample temperature setting"
has_quantity_type: http://qudt.org/vocab/quantitykind/Temperature
unit: https://qudt.org/vocab/unit/K
value: 293.15
- rdf_type:
id: CHMO:0000600
title: "instrument resolution"
value: 1.0
has_quantity_type: http://qudt.org/vocab/quantitykind/Wavelength
unit: https://qudt.org/vocab/unit/NM
title: "Instrument resolution at 450 nm"
has_part:
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_KineticTrace_450nm_t0s
title: "0 s measurement"
part_of:
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_KineticTrace_450nm
title: "UV-vis kinetic trace at 450 nm"
has_quantitative_attribute:
- rdf_type:
id: CHMO:0000602
title: "measurement time"
title: "Measurement time"
has_quantity_type: http://qudt.org/vocab/quantitykind/Time
unit: https://qudt.org/vocab/unit/SEC
value: 0
- rdf_type:
id: CHMO:0000598
title: "absorbance value"
value: 0.85
has_quantity_type: http://qudt.org/vocab/quantitykind/DimensionlessRatio
unit: https://qudt.org/vocab/unit/ABS
title: "Absorbance at 450 nm"
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_KineticTrace_450nm_t60s
title: "60 s measurement"
part_of:
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_KineticTrace_450nm
title: "UV-vis kinetic trace at 450 nm"
has_quantitative_attribute:
- rdf_type:
id: CHMO:0000602
title: "measurement time"
title: "Measurement time"
has_quantity_type: http://qudt.org/vocab/quantitykind/Time
unit: https://qudt.org/vocab/unit/SEC
value: 60
- rdf_type:
id: CHMO:0000598
title: "absorbance value"
value: 0.78
has_quantity_type: http://qudt.org/vocab/quantitykind/DimensionlessRatio
unit: https://qudt.org/vocab/unit/ABS
title: "Absorbance at 450 nm"
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_KineticTrace_450nm_t120s
title: "120 s measurement"
part_of:
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_KineticTrace_450nm
title: "UV-vis kinetic trace at 450 nm"
has_quantitative_attribute:
- rdf_type:
id: CHMO:0000602
title: "measurement time"
title: "Measurement time"
has_quantity_type: http://qudt.org/vocab/quantitykind/Time
unit: https://qudt.org/vocab/unit/SEC
value: 120
- rdf_type:
id: CHMO:0000598
title: "absorbance value"
value: 0.70
has_quantity_type: http://qudt.org/vocab/quantitykind/DimensionlessRatio
unit: https://qudt.org/vocab/unit/ABS
title: "Absorbance at 450 nm"
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_KineticTrace_450nm_t180s
title: "180 s measurement"
part_of:
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_KineticTrace_450nm
title: "UV-vis kinetic trace at 450 nm"
has_quantitative_attribute:
- rdf_type:
id: CHMO:0000602
title: "measurement time"
title: "Measurement time"
has_quantity_type: http://qudt.org/vocab/quantitykind/Time
unit: https://qudt.org/vocab/unit/SEC
value: 180
- rdf_type:
id: CHMO:0000598
title: "absorbance value"
value: 0.63
has_quantity_type: http://qudt.org/vocab/quantitykind/DimensionlessRatio
unit: https://qudt.org/vocab/unit/ABS
title: "Absorbance at 450 nm"
was_generated_by:
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_KineticMeasurement_450nm
title:
- "UV-vis kinetic measurement at 450 nm"
description:
- "Time-resolved UV-vis acquisition from 0 to 180 seconds."
rdf_type:
id: CHMO:0000596
title: "UV-visible spectroscopy"
evaluated_entity:
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N.2
title: "CRS-50440"
carried_out_by:
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_Spectrometer
rdf_type:
id: OBI:0000566
title: "UV-vis instrument"
title: "UV-Vis Spectrophotometer Model XYZ"
description: 'The UV-Vis spectrophotometer used for the kinetics measurement at 450 nm.'
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_SampleCell
description: "Sample cell used for the kinetics measurement"
has_part:
- id: https://pubchem.ncbi.nlm.nih.gov/compound/12345
rdf_type:
id: CHEBI:12345
title: "cuvette"
title: "1 cm cuvette"
- id: doi:10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_Wavelength
title: "measurement wavelength"
part_of:
- title: "450 nm"
description: "The wavelength of measurement"
id: https://doi.org/10.14272/UGRXAOUDHZOHPF-UHFFFAOYSA-N/CHMO0000595.3#UVvis_Wavelength_450nm
rdf_type:
id: CHMO:0000601
title: "wavelength"
Loading
Loading