view README.md @ 37:e976b8b1160a

fix rdfdb.syncedgraph.grapheditapi import
author drewp@bigasterisk.com
date Sat, 27 Aug 2022 00:25:50 -0700
parents 8d908762fe1e
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 with starlette:

```
from patchablegraph.handler import StaticGraph, GraphEvents

masterGraph = PatchableGraph()

app = Starlette(
    routes=[
        Route('/graph/environment', StaticGraph(masterGraph)),
        Route('/graph/environment/events', GraphEvents(masterGraph)),
        ...
    ])

```

* Versions 0.x.x used cyclone web and twisted.
* Versions 1.x.x use starlette and asyncio.