Mercurial > code > home > repos > rdferry
comparison 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 |
comparison
equal
deleted
inserted
replaced
9:b72f4ba1345d | 10:52e1bb1532f2 |
---|---|
1 from rdferry import Patch, PatchableGraph, StarletteServer | |
2 from rdflib import RDFS, Literal, Namespace | |
3 | |
4 EX = Namespace('http://example.com/') | |
5 | |
6 server = StarletteServer() | |
7 | |
8 g1 = PatchableGraph() | |
9 g1.patch(Patch(adds=[(EX['greeting'], RDFS.label, Literal('hello world'), EX['process'])])) | |
10 | |
11 server.add_graph_routes('/g1', g1) | |
12 | |
13 server.serve() |