Mercurial > code > home > repos > homeauto
diff service/mqtt_to_rdf/mqtt_message.py @ 1706:2085ed9cfcc4
reworking UI to reflect the new inferencing code
author | drewp@bigasterisk.com |
---|---|
date | Sat, 23 Oct 2021 13:22:40 -0700 |
parents | b3132cd02686 |
children |
line wrap: on
line diff
--- a/service/mqtt_to_rdf/mqtt_message.py Sat Oct 23 13:21:06 2021 -0700 +++ b/service/mqtt_to_rdf/mqtt_message.py Sat Oct 23 13:22:40 2021 -0700 @@ -8,10 +8,12 @@ JSON = Namespace('http://bigasterisk.com/anyJson/') -def graphFromMessage(topic: bytes, body: bytes): +def graphFromMessage(topicUri: URIRef, topic: bytes, body: bytes): graph = Graph() message = URIRef(f'{uuid.uuid1().urn}') + graph.add((topicUri, ROOM['message'], message)) + graph.add((message, RDF.type, ROOM['MqttMessage'])) topicSegments = BNode()