view lib/patchablegraph/README.md @ 1490:455b1b80516e

introduce capnp, more build, some demos Ignore-this: 29801e9e9f8a85fd0d822207c6eacce1 darcs-hash:b2da18876d27b0fb9192811375752b5c4e7322e0
author drewp <drewp@bigasterisk.com>
date Thu, 23 Jan 2020 21:00:47 -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}),
    ...
```