Mercurial > code > home > repos > patchablegraph
view README.md @ 32:7a3044dfbcf5
pdm sauce
author | drewp@bigasterisk.com |
---|---|
date | Sun, 24 Apr 2022 00:48:00 -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.