Mercurial > code > home > repos > homeauto
changeset 1642:78024b27f9ec
serve graph/config
author | drewp@bigasterisk.com |
---|---|
date | Fri, 17 Sep 2021 11:01:06 -0700 |
parents | 5403c6343fa4 |
children | c04b5303eb08 |
files | service/mqtt_to_rdf/mqtt_to_rdf.py |
diffstat | 1 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/service/mqtt_to_rdf/mqtt_to_rdf.py Wed Sep 15 23:56:21 2021 -0700 +++ b/service/mqtt_to_rdf/mqtt_to_rdf.py Fri Sep 17 11:01:06 2021 -0700 @@ -6,6 +6,8 @@ import logging import os +from rdfdb.patch import Patch + from mqtt_message import graphFromMessage import os import time @@ -396,6 +398,9 @@ inference=inference)) log.info(f'set up {len(srcs)} sources') + peg = PatchableGraph() + peg.patch(Patch(addQuads=[(s,p,o,URIRef('/config')) for s,p,o in expandedConfig])) + port = 10018 reactor.listenTCP(port, cyclone.web.Application([ @@ -406,6 +411,9 @@ (r"/build/(bundle.js)", cyclone.web.StaticFileHandler, { "path": "build" }), + (r"/graph/config", CycloneGraphHandler, { + 'masterGraph': peg, + }), (r"/graph/mqtt", CycloneGraphHandler, { 'masterGraph': masterGraph }),