Mercurial > code > home > repos > rdferry
view examples/serve_inline_graph.py @ 11:0bc06da6bf74
start ferry1 patch protocol
author | drewp@bigasterisk.com |
---|---|
date | Mon, 18 Mar 2024 16:42:21 -0700 |
parents | 52e1bb1532f2 |
children |
line wrap: on
line source
from rdferry import Patch, PatchableGraph, StarletteServer from rdflib import RDFS, Literal, Namespace EX = Namespace('http://example.com/') server = StarletteServer() g1 = PatchableGraph() g1.patch(Patch(adds=[(EX['greeting'], RDFS.label, Literal('hello world'), EX['process'])])) server.add_graph_routes('/g1', g1) server.serve()