Mercurial > code > home > repos > homeauto
view lib/patchablegraph/README.md @ 1325:b4ad96f1e632
release 0.4.0
Ignore-this: a408a3b0bc32f3ef4543fcf13f0a51e6
darcs-hash:673ca0bfa5c163d4e0df6837a067f5f5e3b10e4a
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Tue, 23 Apr 2019 00:57:18 -0700 |
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}), ... ```