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
|
|
18 Web serving:
|
|
19
|
|
20 ``` from patchablegraph import CycloneGraphHandler,
|
|
21 CycloneGraphEventsHandler
|
|
22
|
|
23 reactor.listenTCP(9059, cyclone.web.Application([
|
|
24 ...
|
|
25 (r"/graph", CycloneGraphHandler, {'masterGraph': masterGraph}),
|
|
26 (r"/graph/events", CycloneGraphEventsHandler, {'masterGraph': masterGraph}),
|
|
27 ...
|
|
28 ```
|
|
29
|