0
|
1 RDF graph that accepts patches and serves them over HTTP (with a SSE protocol).
|
|
2
|
|
3 Example:
|
|
4
|
|
5 ```
|
|
6 from patchablegraph import PatchableGraph
|
|
7
|
|
8 masterGraph = PatchableGraph()
|
|
9
|
|
10 ```
|
|
11
|
|
12 Then, you call `masterGraph.patch`, etc to edit the
|
|
13 graph. `rdfdb.grapheditapi.GraphEditApi` is mixed in, so you can
|
|
14 use
|
|
15 [higher-level functions](https://bigasterisk.com/darcs/?r=rdfdb;a=headblob;f=/rdfdb/grapheditapi.py) from
|
|
16 there, such as patchObject.
|
|
17
|
31
|
18 Web serving with starlette:
|
0
|
19
|
31
|
20 ```
|
|
21 from patchablegraph.handler import StaticGraph, GraphEvents
|
|
22
|
|
23 masterGraph = PatchableGraph()
|
0
|
24
|
31
|
25 app = Starlette(
|
|
26 routes=[
|
|
27 Route('/graph/environment', StaticGraph(masterGraph)),
|
|
28 Route('/graph/environment/events', GraphEvents(masterGraph)),
|
|
29 ...
|
|
30 ])
|
|
31
|
0
|
32 ```
|
|
33
|
31
|
34 * Versions 0.x.x used cyclone web and twisted.
|
|
35 * Versions 1.x.x use starlette and asyncio.
|