Mercurial > code > home > repos > rdferry
diff examples/serve_inline_graph.py @ 10:52e1bb1532f2
serve_inline_graph
author | drewp@bigasterisk.com |
---|---|
date | Sat, 16 Mar 2024 16:02:23 -0700 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/serve_inline_graph.py Sat Mar 16 16:02:23 2024 -0700 @@ -0,0 +1,13 @@ +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()