Mercurial > code > home > repos > homeauto
view lib/patchablegraph/README.md @ 1529:0e0713fd23e7
build: place generated nim in its own dir
Ignore-this: 89c9a75595f0465d4efc44ef1b96abd7
darcs-hash:6a695011fe841ce7d6c020ebc33b6099ff26d964
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Thu, 23 Jan 2020 23:59:41 -0800 |
parents | 6a910da391e6 |
children |
line wrap: on
line source
RDF graph that accepts patches and serves them over HTTP (with a SSE protocol). Example: ``` from patchablegraph import PatchableGraph masterGraph = PatchableGraph() ``` Then, you call `masterGraph.patch`, etc to edit the graph. `rdfdb.grapheditapi.GraphEditApi` is mixed in, so you can use [higher-level functions](https://bigasterisk.com/darcs/?r=rdfdb;a=headblob;f=/rdfdb/grapheditapi.py) from there, such as patchObject. Web serving: ``` from patchablegraph import CycloneGraphHandler, CycloneGraphEventsHandler reactor.listenTCP(9059, cyclone.web.Application([ ... (r"/graph", CycloneGraphHandler, {'masterGraph': masterGraph}), (r"/graph/events", CycloneGraphEventsHandler, {'masterGraph': masterGraph}), ... ```