Mercurial > code > home > repos > homeauto
view lib/patchablegraph/README.md @ 1420:8ffead2295e0
release 0.7.0
Ignore-this: da64b66a5123da5a08b7afa9816221ab
darcs-hash:1714de97f2c2f1cdf9f71c689f6acd81fc122371
author | drewp <drewp@bigasterisk.com> |
---|---|
date | Sun, 04 Aug 2019 12:57:25 -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}), ... ```