Skip to content
Snippets Groups Projects
Commit 8a0f1647 authored by Matthias Stefan Bodenbenner's avatar Matthias Stefan Bodenbenner
Browse files

fixed unit handling for the metadata provisioning

parent bf20ebc8
No related branches found
No related tags found
No related merge requests found
Pipeline #377275 passed
[![Build](https://git-ce.rwth-aachen.de/wzl-mq-ms/forschung-lehre/lava/unified-device-interface/python/badges/master/pipeline.svg)](https://git-ce.rwth-aachen.de/wzl-mq-ms/forschung-lehre/lava/unified-device-interface/python/commits/master)
# Python Unified Device Interface
Current stable version: 10.0.6
Current stable version: 10.0.7
## Installation
1. Install the WZL-UDI package via pip
......@@ -69,6 +69,9 @@ Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)
## Recent changes
**10.0.7** - 2024-03-22
- fixed unit handling for the metadata provisioning
**10.0.6** - 2024-03-22
- fixed validation of rfc3339 datetime strings
......
......@@ -4,7 +4,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setup(name='wzl-udi',
version='10.0.6',
version='10.0.7',
url='https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python',
project_urls={
"Bug Tracker": "https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python/-/issues",
......
......@@ -238,10 +238,11 @@ class Measurement(Variable):
# create result node
unit_triples = list(self._metadata.triples((None, Namespaces.qudt.applicableUnit, None)))
assert len(unit_triples) == 1
assert self.datatype in [Datatype.STRING, Datatype.ENUM, Datatype.BOOLEAN, Datatype.TIME] or len(unit_triples) == 1
data_graph.add((result_subject, Namespaces.rdf.type, rdflib.URIRef(Namespaces.sosa.Result)))
data_graph.add((result_subject, Namespaces.sosa.isResultOf, measurement_subject))
if len(unit_triples) == 1:
data_graph.add((result_subject, Namespaces.qudt.unit, unit_triples[0][2]))
data_graph.add((result_subject, Namespaces.schema.license, Semantics.data_license))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment