aboutsummaryrefslogtreecommitdiff
path: root/trygvis/eda/cli
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2017-01-05 08:36:50 +0100
committerTrygve Laugstøl <trygvis@inamo.no>2017-01-05 08:36:50 +0100
commit42070a2115b330b54b83523056554911b38037a4 (patch)
treeb755eda98675bad80665a529a13f0edaede48d16 /trygvis/eda/cli
parent7ec05971895a0428c9912a930d789ec7bf004a32 (diff)
downloadeda-rdf-42070a2115b330b54b83523056554911b38037a4.tar.gz
eda-rdf-42070a2115b330b54b83523056554911b38037a4.tar.bz2
eda-rdf-42070a2115b330b54b83523056554911b38037a4.tar.xz
eda-rdf-42070a2115b330b54b83523056554911b38037a4.zip
o Better check for db.update_url.
Diffstat (limited to 'trygvis/eda/cli')
-rw-r--r--trygvis/eda/cli/__init__.py9
1 files changed, 2 insertions, 7 deletions
diff --git a/trygvis/eda/cli/__init__.py b/trygvis/eda/cli/__init__.py
index 69905cd..308e1bd 100644
--- a/trygvis/eda/cli/__init__.py
+++ b/trygvis/eda/cli/__init__.py
@@ -45,17 +45,12 @@ def with_database(tx):
raise CliException("The database is corrupt: %s" % path)
elif db_type == 'sparql':
query_endpoint = config["db"]["url"]
+ update_endpoint = config["db"].get("update_url")
- if not hasattr(config["db"], "update_url") is None:
+ if update_endpoint is None:
g = sparqlstore.SPARQLStore()
g.open(query_endpoint)
else:
- update_endpoint = config["db"]["update_url"]
- # def my_bnode_ext(node):
- # if isinstance(node, BNode):
- # return '<bnode:b%s>' % node
- # else:
- # return sparqlstore._node_to_sparql(node)
g = sparqlstore.SPARQLUpdateStore(autocommit=False)
g.open((query_endpoint, update_endpoint))
else: