view lib/patchablegraph/README.md @ 1512:1e9cfec1be78

don't require first arg on PatchedGraph.serialize Ignore-this: bc695823e03dbd012e03efa4e40b6aca darcs-hash:1dbf9271b5ca55c78987c474ef223af9d5b811d2
author drewp <drewp@bigasterisk.com>
date Mon, 03 Feb 2020 23:46:29 -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}),
    ...
```