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

- fixed missing licences of some semantic resources

  - changed "schema.org" to http in instead of https
parent 8a0f1647
No related branches found
No related tags found
No related merge requests found
[![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) [![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 # Python Unified Device Interface
Current stable version: 10.0.7 Current stable version: 10.0.8
## Installation ## Installation
1. Install the WZL-UDI package via pip 1. Install the WZL-UDI package via pip
...@@ -69,6 +69,10 @@ Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) ...@@ -69,6 +69,10 @@ Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation)
## Recent changes ## Recent changes
**10.0.8** - 2024-03-25
- fixed missing licences of some semantic resources
- changed "schema.org" to http in instead of https
**10.0.7** - 2024-03-22 **10.0.7** - 2024-03-22
- fixed unit handling for the metadata provisioning - fixed unit handling for the metadata provisioning
......
...@@ -4,7 +4,7 @@ with open("README.md", "r", encoding="utf-8") as fh: ...@@ -4,7 +4,7 @@ with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read() long_description = fh.read()
setup(name='wzl-udi', setup(name='wzl-udi',
version='10.0.7', version='10.0.8',
url='https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python', url='https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python',
project_urls={ project_urls={
"Bug Tracker": "https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python/-/issues", "Bug Tracker": "https://git-ce.rwth-aachen.de/wzl-mq-public/soil/python/-/issues",
......
...@@ -215,6 +215,9 @@ class Measurement(Variable): ...@@ -215,6 +215,9 @@ class Measurement(Variable):
elif resource_type == ResourceType.metadata: elif resource_type == ResourceType.metadata:
result = self._metadata result = self._metadata
result.add((Semantics.namespace[f'{self._semantic_name}Range'], Namespaces.schema.license,
Semantics.metadata_license))
elif resource_type == ResourceType.range: elif resource_type == ResourceType.range:
result = copy.deepcopy(self._metadata) result = copy.deepcopy(self._metadata)
subjects = result.subjects() subjects = result.subjects()
...@@ -269,7 +272,7 @@ class Measurement(Variable): ...@@ -269,7 +272,7 @@ class Measurement(Variable):
data_graph.bind('earl', Namespaces.earl) data_graph.bind('earl', Namespaces.earl)
data_graph.add((uncertainty_subject, Namespaces.rdf.type, Namespaces.earl.NotApplicable)) data_graph.add((uncertainty_subject, Namespaces.rdf.type, Namespaces.earl.NotApplicable))
data_graph.add((uncertainty_subject, Namespaces.schema.license, Semantics.data_license)) data_graph.add((uncertainty_subject, Namespaces.schema.license, Semantics.metadata_license))
result = data_graph result = data_graph
elif resource_type == ResourceType.observation: elif resource_type == ResourceType.observation:
...@@ -292,7 +295,7 @@ class Measurement(Variable): ...@@ -292,7 +295,7 @@ class Measurement(Variable):
(measurement_subject, Namespaces.sosa.observedProperty, Semantics.namespace[self._semantic_name])) (measurement_subject, Namespaces.sosa.observedProperty, Semantics.namespace[self._semantic_name]))
data_graph.add((measurement_subject, Namespaces.sosa.hasResult, result_subject)) data_graph.add((measurement_subject, Namespaces.sosa.hasResult, result_subject))
data_graph.add((measurement_subject, Namespaces.sosa.madeBySensor, sensor_triples[0][2])) data_graph.add((measurement_subject, Namespaces.sosa.madeBySensor, sensor_triples[0][2]))
data_graph.add((measurement_subject, Namespaces.schema.license, Semantics.data_license)) data_graph.add((measurement_subject, Namespaces.schema.license, Semantics.metadata_license))
result = data_graph result = data_graph
else: else:
......
...@@ -149,6 +149,8 @@ class Parameter(Variable): ...@@ -149,6 +149,8 @@ class Parameter(Variable):
for subject in subjects: for subject in subjects:
if subject != Semantics.namespace[f'{self._semantic_name}Range']: if subject != Semantics.namespace[f'{self._semantic_name}Range']:
range_graph.remove((subject, None, None)) range_graph.remove((subject, None, None))
range_graph.add((Semantics.namespace[f'{self._semantic_name}Range'], Namespaces.schema.license,
Semantics.metadata_license))
return range_graph return range_graph
elif resource_type == ResourceType.metadata: elif resource_type == ResourceType.metadata:
result = copy.deepcopy(self._metadata) result = copy.deepcopy(self._metadata)
...@@ -161,6 +163,8 @@ class Parameter(Variable): ...@@ -161,6 +163,8 @@ class Parameter(Variable):
try: try:
rdf_value = self.serialize_value(result, self.__getitem__('value', 0)) rdf_value = self.serialize_value(result, self.__getitem__('value', 0))
result.add((Semantics.namespace[self._semantic_name], Namespaces.qudt['value'], rdf_value)) result.add((Semantics.namespace[self._semantic_name], Namespaces.qudt['value'], rdf_value))
result.add((Semantics.namespace[f'{self._semantic_name}Range'], Namespaces.schema.license,
Semantics.metadata_license))
except DeviceException as e: except DeviceException as e:
if isinstance(e._predecessor, NotImplementedException): if isinstance(e._predecessor, NotImplementedException):
pass pass
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment