metadata4Ing
metadata4Ing#
Metadata4Ing is an ontology developed within the NFDI Consortium NFDI4Ing “with the aim of providing a thorough framework for the semantic description of research data, with a particular focus on engineering sciences and neighbouring disciplines.”
The h5RDMtoolbox allows translating JSON-LD data into the HDF5 structure and wise versa (see here). This way, engineering process metadata can be added easily to the HDF5 file.
Consider the following example file taken from the m4i ontology “first steps guide”, which describes an experimental investigation. You can find the full content of the JSON-LD file here, the following shows an excerpt:
import h5rdmtoolbox as h5tbx
_ = h5tbx.set_config(auto_create_h5tbx_version=False)
With a single call (h5tbx.jsonld.to_hdf) it is possible to read in the JSON-LD data and parse it into the HDF5 structure:
with h5tbx.File() as h5:
h5.create_group('metadata')
h5tbx.jsonld.to_hdf(h5.metadata, source='min_m4i_ex.jsonld')
h5.dump(collapsed=False)
http://qudt.org/vocab/quantitykind/ElectricPotential
http://qudt.org/vocab/unit/KiloV
https://www.wikidata.org/wiki/Q189259
https://www.wikidata.org/wiki/Q256699
-
-
-
- label
http://www.w3.org/2000/01/rdf-schema#label: FineTec FORE 180.01C TT
- label
-
- has input
http://purl.obolibrary.org/obo/RO_0002233: xrct_data_0001 - label
http://www.w3.org/2000/01/rdf-schema#label: Image Processing and Reconstruction - starts with
http://purl.obolibrary.org/obo/RO_0002224: normalization_0001
- has input
-
- label
http://www.w3.org/2000/01/rdf-schema#label: Post Processing
- label
-
- has participant
http://www.w3.org/ns/prov#wasAssociatedWith: alex - label
http://www.w3.org/2000/01/rdf-schema#label: Sample preparation and parameter definition - start time
https://schema.org/startTime: 22
- has participant
-
- description
http://purl.org/dc/terms/description: Standard cone beam scanning of the centered sample - label
http://www.w3.org/2000/01/rdf-schema#label: Standard cone beam scanning
-
- has kind of quantity
http://w3id.org/nfdi4ing/metadata4ing#hasKindOfQuantity: http://qudt.org/vocab/quantitykind/ElectricPotential - has numerical value
http://w3id.org/nfdi4ing/metadata4ing#hasNumericalValue: 140 - has unit
http://w3id.org/nfdi4ing/metadata4ing#hasUnit: http://qudt.org/vocab/unit/KiloV - label
http://www.w3.org/2000/01/rdf-schema#label: X-Ray Tube Voltage
- has kind of quantity
- description
-
- has employed tool
http://w3id.org/nfdi4ing/metadata4ing#hasEmployedTool: xray_source_finetec_180.01ctt_0001 - investigates
http://w3id.org/nfdi4ing/metadata4ing#investigates: https://www.wikidata.org/wiki/Q189259 - investigatesProperty
http://w3id.org/nfdi4ing/metadata4ing#investigatesProperty: https://www.wikidata.org/wiki/Q256699 - label
http://www.w3.org/2000/01/rdf-schema#label: XRCT-Scan - realizes method
http://w3id.org/nfdi4ing/metadata4ing#realizesMethod: cone_beam_scanning
-
-
- download URL
http://www.w3.org/ns/dcat#downloadURL: //path/to/xcrt_0001.tiff - media type
http://www.w3.org/ns/dcat#mediaType: image/tiff
- download URL
-
- download URL
http://www.w3.org/ns/dcat#downloadURL: //path/to/xcrt_0002.tiff - media type
http://www.w3.org/ns/dcat#mediaType: image/tiff
- download URL
-
- download URL
http://www.w3.org/ns/dcat#downloadURL: //path/to/xcrt_0003.tiff - media type
http://www.w3.org/ns/dcat#mediaType: image/tiff
- download URL
-
- has employed tool
-
- first name
http://xmlns.com/foaf/0.1/firstName: Alexandra - has ORCID ID
http://w3id.org/nfdi4ing/metadata4ing#orcidId: 0000-0000-0123-4567 - last name
http://xmlns.com/foaf/0.1/lastName: Test
- first name
-
-
print(h5tbx.dump_jsonld(h5.hdf_filename,
structural=False,
resolve_keys=True,
indent=2,
context={"@import": "https://w3id.org/nfdi4ing/metadata4ing/m4i_context.jsonld"}))
{
"@context": {
"@vocab": "http://w3id.org/nfdi4ing/metadata4ing#",
"dcat": "http://www.w3.org/ns/dcat#",
"hdf5": "http://purl.allotrope.org/ontologies/hdf5/1.8#",
"prov": "http://www.w3.org/ns/prov#"
},
"@graph": [
{
"@id": "_:N9ff6d491ab1d45dbaa1eca7be345d808",
"@type": "prov:Person",
"http://xmlns.com/foaf/0.1/firstName": "Alexandra",
"http://xmlns.com/foaf/0.1/lastName": "Test",
"orcidId": "0000-0000-0123-4567"
},
{
"@id": "_:Nd410487bfdda4519ba2dcd4a7413cec6",
"@type": "ProcessingStep",
"http://www.w3.org/2000/01/rdf-schema#label": "Sample preparation and parameter definition",
"https://schema.org/startTime": "22",
"prov:wasAssociatedWith": "alex"
},
{
"@id": "_:N0302bd4e5bb24243860c15660e233fbd",
"@type": "ProcessingStep",
"http://purl.obolibrary.org/obo/RO_0002224": "normalization_0001",
"http://purl.obolibrary.org/obo/RO_0002233": "xrct_data_0001",
"http://www.w3.org/2000/01/rdf-schema#label": "Image Processing and Reconstruction"
},
{
"@id": "_:Nb491ce3c2606465fb09d7017d7cacc8b",
"@type": "ProcessingStep",
"http://www.w3.org/2000/01/rdf-schema#label": "Post Processing"
},
{
"@id": "_:Nd2c8639fe32d4c3db63bd4bf313e4339",
"@type": "Tool",
"http://www.w3.org/2000/01/rdf-schema#label": "FineTec FORE 180.01C TT"
},
{
"@id": "_:N75cb7c9a552f4dceacc8e8c4075141d8",
"@type": "Method",
"http://purl.org/dc/terms/description": "Standard cone beam scanning of the centered sample",
"http://www.w3.org/2000/01/rdf-schema#label": "Standard cone beam scanning"
},
{
"@id": "_:N644cdd73f67341ad8784c50a892a2479",
"@type": "ProcessingStep",
"hasEmployedTool": "xray_source_finetec_180.01ctt_0001",
"http://www.w3.org/2000/01/rdf-schema#label": "XRCT-Scan",
"investigates": {
"@type": "http://www.w3.org/2001/XMLSchema#anyURI",
"@value": "https://www.wikidata.org/wiki/Q189259"
},
"investigatesProperty": {
"@type": "http://www.w3.org/2001/XMLSchema#anyURI",
"@value": "https://www.wikidata.org/wiki/Q256699"
},
"realizesMethod": "cone_beam_scanning"
},
{
"@id": "_:N8d2ba6082f9f4633bb5969a10451c5fa",
"@type": "dcat:Dataset"
},
{
"@id": "_:Nc6d0eda86cca4553ac8b4c617a7caf99",
"@type": "NumericalVariable",
"hasKindOfQuantity": {
"@type": "http://www.w3.org/2001/XMLSchema#anyURI",
"@value": "http://qudt.org/vocab/quantitykind/ElectricPotential"
},
"hasNumericalValue": "140",
"hasUnit": {
"@type": "http://www.w3.org/2001/XMLSchema#anyURI",
"@value": "http://qudt.org/vocab/unit/KiloV"
},
"http://www.w3.org/2000/01/rdf-schema#label": "X-Ray Tube Voltage"
},
{
"@id": "_:N9bb9c92eed2448aca7afe9547be97c53",
"dcat:downloadURL": "//path/to/xcrt_0003.tiff",
"dcat:mediaType": "image/tiff"
},
{
"@id": "_:N22d912003272402989107d4aa3a05866",
"dcat:downloadURL": "//path/to/xcrt_0002.tiff",
"dcat:mediaType": "image/tiff"
},
{
"@id": "_:N361298f143494beda34daa7bb4dbba95",
"dcat:downloadURL": "//path/to/xcrt_0001.tiff",
"dcat:mediaType": "image/tiff"
}
]
}