view lib/patchablegraph/README.md @ 1321:f1c32a6791f0

release 0.2.0 Ignore-this: 6209f59a7dbb64539adafbc8e648ecaf darcs-hash:6c7c48e5da088b4080c187dd4208597fe7a6e92b
author drewp <drewp@bigasterisk.com>
date Tue, 23 Apr 2019 00:11:04 -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}),
    ...
```