view lib/patchablegraph/README.md @ 1369:42f4fed9cd25

no more immediateUpdate since we push patch events now. and the code was broken for py3 anyway Ignore-this: 54edfd3885f749aa5ef3be2051c2f40f darcs-hash:0f1ccb011e9cf29bf9e2389de3833cbda3550631
author drewp <drewp@bigasterisk.com>
date Sun, 05 May 2019 17:09:12 -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}),
    ...
```