diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2017-01-02 08:32:37 +0100 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2017-01-02 08:32:37 +0100 |
commit | 7ec05971895a0428c9912a930d789ec7bf004a32 (patch) | |
tree | f0a2f0db6cbd78efbe971da81bfe99420fae8d94 /trygvis/eda/cli/__init__.py | |
parent | 8c90d2e409e9c457a8e27fc11d8e030248eb6f70 (diff) | |
download | eda-rdf-7ec05971895a0428c9912a930d789ec7bf004a32.tar.gz eda-rdf-7ec05971895a0428c9912a930d789ec7bf004a32.tar.bz2 eda-rdf-7ec05971895a0428c9912a930d789ec7bf004a32.tar.xz eda-rdf-7ec05971895a0428c9912a930d789ec7bf004a32.zip |
o Don't to Graph.commit() unless this is an updateable SPARQL store.
Diffstat (limited to 'trygvis/eda/cli/__init__.py')
-rw-r--r-- | trygvis/eda/cli/__init__.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/trygvis/eda/cli/__init__.py b/trygvis/eda/cli/__init__.py index 04de836..69905cd 100644 --- a/trygvis/eda/cli/__init__.py +++ b/trygvis/eda/cli/__init__.py @@ -45,12 +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"]["update_url"] - if update_endpoint is None: + if not hasattr(config["db"], "update_url") 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 @@ -64,7 +64,8 @@ def with_database(tx): try: print("g=%s" % g) tx(g) - g.commit() + if isinstance(g, sparqlstore.SPARQLUpdateStore): + g.commit() finally: g.close() |