97
|
1 import logging
|
|
2 from pathlib import Path
|
|
3
|
|
4 from rdflib import URIRef
|
|
5
|
|
6 import rdfdb.service
|
|
7
|
|
8 logging.basicConfig(level=logging.INFO)
|
|
9 log = logging.getLogger()
|
|
10
|
|
11 root = Path('/tmp/rdfdb_demo')
|
|
12 root.mkdir(exist_ok=True)
|
|
13 (root / "demo.n3").write_text("""
|
|
14 @prefix : <http://example.com/myfavprefix> .
|
|
15
|
|
16 :hello :world :triple .
|
|
17 """)
|
|
18 (root / "demo2.n3").write_text("""
|
|
19 @prefix : <http://example.com/myfavprefix> .
|
|
20
|
|
21 :hello2 :world :triple .
|
|
22 """)
|
|
23 app = rdfdb.service.makeApp(
|
|
24 dirUriMap={
|
|
25 root: URIRef('http://example.com/root/'), #
|
|
26 },
|
|
27 prefixes={
|
|
28 '': URIRef('http://example.com/myfavprefix'),
|
|
29 'rdf': URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#'),
|
|
30 'rdfs': URIRef('http://www.w3.org/2000/01/rdf-schema#'),
|
|
31 },
|
|
32 )
|