view lib/patchablegraph/README.md @ 1372:26dd28671f70

fix old module name twisted_sse_demo Ignore-this: 9eae98ea57725eeaf68e94e9f9f46fec darcs-hash:8fd8f7ecbb21456a04a8dd842986ecc3f92da213
author drewp <drewp@bigasterisk.com>
date Mon, 06 May 2019 00:02:26 -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}),
    ...
```