79608329

Date: 2025-05-06 08:55:37
Score: 0.5
Natty:
Report link

I actually managed to do it, but i do not know if there is a better way than this :

from rdflib import Graph, URIRef, Literal, BNode
from rdflib.namespace import RDF, XSD

g=Graph()

g.add((URIRef("Obs001"), RDF.type, URIRef("sosa:Observation")))

bn = BNode()

g.add((URIRef("Obs001"), URIRef("sosa:hasResult"), bn))
g.add((bn, RDF.type, URIRef("qudt:QuantityValue")))
g.add((bn, URIRef("qudt:hasUnit"), URIRef("unit:DEG_C")))
g.add((bn, URIRef("qudt:value"), Literal(24.9, datatype=XSD.float)))
Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Micawber