Mercurial > code > home > repos > rdfdb
view demo.py @ 128:bf5353908f3c
when SyncedGraph tries to clear the graph for a resync, don't attempt to send that patch out
author | drewp@bigasterisk.com |
---|---|
date | Sat, 27 May 2023 17:55:20 -0700 |
parents | 6443cb265a2f |
children |
line wrap: on
line source
import logging from pathlib import Path from rdflib import URIRef import rdfdb.service logging.basicConfig(level=logging.DEBUG) log = logging.getLogger() def makeSampleDir(): root = Path('/tmp/rdfdb_demo') root.mkdir(exist_ok=True) (root / "demo.n3").write_text(""" @prefix : <http://example.com/myfavprefix> . :hello :world :triple . """) (root / "demo2.n3").write_text(""" @prefix : <http://example.com/myfavprefix> . :hello2 :world :triple . """) return root #root = makeSampleDir() root = Path('/home/drewp/projects/light9/show/dance2023') app = rdfdb.service.makeApp( dirUriMap={ root: URIRef('http://example.com/root/'), # }, prefixes={ '': URIRef('http://example.com/myfavprefix'), 'rdf': URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#'), 'rdfs': URIRef('http://www.w3.org/2000/01/rdf-schema#'), }, )