Mercurial > code > home > repos > rdfdb
view demo.py @ 136:8fa6a47521d7
comment
author | drewp@bigasterisk.com |
---|---|
date | Thu, 01 Jun 2023 14:03:02 -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#'), }, )