Changeset - 412f798baf0c
[Not reviewed]
default
0 1 1
drewp@bigasterisk.com - 3 years ago 2022-05-21 22:53:56
drewp@bigasterisk.com
move rdfdb_setup.py code from the simplified launcher
2 files changed with 31 insertions and 23 deletions:
0 comments (0 inline, 0 general)
bin/rdfdb
Show inline comments
 
#!bin/python
 
import run_local  # noqa
 
import os
 
from rdflib import URIRef
 
from light9 import networking, showconfig
 
import rdfdb.service
 

	
 
rdfdb.service.main(
 
    dirUriMap={
 
        os.environ['LIGHT9_SHOW'].encode('ascii').rstrip(b'/') + b'/':
 
        URIRef(showconfig.showUri() + '/')
 
    },
 
    prefixes={
 
        'show': URIRef(showconfig.showUri() + '/'),
 
        '': URIRef('http://light9.bigasterisk.com/'),
 
        'rdf': URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#'),
 
        'rdfs': URIRef('http://www.w3.org/2000/01/rdf-schema#'),
 
        'xsd': URIRef('http://www.w3.org/2001/XMLSchema#'),
 
        'effect': URIRef('http://light9.bigasterisk.com/effect/'),
 
        'dev': URIRef('http://light9.bigasterisk.com/theater/skyline/device/'),
 
    },
 
    port=networking.rdfdb.port,
 
)
 
#!/bin/zsh
 
#pnpx vite -c light9/ascoltami/vite.config.ts &
 
pdm run uvicorn --port 8209 light9.rdfdb_setup:app
 
wait
light9/rdfdb_setup.py
Show inline comments
 
new file 100644
 
#!bin/python
 
from light9.run_local import log
 
import logging
 
log = logging.getLogger('rdfdb_setup')
 
import os
 
from pathlib import Path
 

	
 
import rdfdb.service
 
from rdflib import URIRef
 

	
 
from light9 import showconfig
 

	
 
rdfRoot = Path(os.environ['LIGHT9_SHOW'].rstrip('/') + '/')
 
showUri = URIRef(showconfig.showUri() + '/')
 

	
 
app = rdfdb.service.makeApp(  #
 
    dirUriMap={rdfRoot: showUri},
 
    prefixes={
 
        'show': showUri,
 
        '': URIRef('http://light9.bigasterisk.com/'),
 
        'rdf': URIRef('http://www.w3.org/1999/02/22-rdf-syntax-ns#'),
 
        'rdfs': URIRef('http://www.w3.org/2000/01/rdf-schema#'),
 
        'xsd': URIRef('http://www.w3.org/2001/XMLSchema#'),
 
        'effect': URIRef('http://light9.bigasterisk.com/effect/'),
 
        'dev': URIRef('http://light9.bigasterisk.com/theater/skyline/device/'),
 
    })
 
log.info('made app')
 
\ No newline at end of file
0 comments (0 inline, 0 general)