# HG changeset patch # User drewp@bigasterisk.com # Date 1684532449 25200 # Node ID dc126c757dbe5402c1a9e866dc87a9f97f76ec0b # Parent 9036ebf37b04005cb55a6991a976717324d08b9e import test for rdfdb diff -r 9036ebf37b04 -r dc126c757dbe bin/rdfdb --- a/bin/rdfdb Fri May 19 14:40:30 2023 -0700 +++ b/bin/rdfdb Fri May 19 14:40:49 2023 -0700 @@ -1,4 +1,4 @@ #!/bin/zsh #pnpm exec vite -c light9/ascoltami/vite.config.ts & -pdm run uvicorn --port 8209 light9.rdfdb_setup:app --no-access-log +pdm run uvicorn --port 8209 light9.rdfdb.service:app --no-access-log wait diff -r 9036ebf37b04 -r dc126c757dbe light9/rdfdb/service.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/light9/rdfdb/service.py Fri May 19 14:40:49 2023 -0700 @@ -0,0 +1,25 @@ +import logging +import os +from pathlib import Path + +import rdfdb.service +from rdflib import URIRef + +from light9 import showconfig +from light9.run_local import log + +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 diff -r 9036ebf37b04 -r dc126c757dbe light9/rdfdb/service_test.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/light9/rdfdb/service_test.py Fri May 19 14:40:49 2023 -0700 @@ -0,0 +1,11 @@ +import asyncio +from light9.run_local import log + + +def test_import(): + + async def go(): + # this sets up some watcher tasks + from service import app + + asyncio.run(go(), debug=True) diff -r 9036ebf37b04 -r dc126c757dbe light9/rdfdb_setup.py --- a/light9/rdfdb_setup.py Fri May 19 14:40:30 2023 -0700 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,27 +0,0 @@ -#!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