aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlltommy2020-06-15 17:31:34 +0200
committerlltommy2020-06-15 17:31:34 +0200
commitaf09eb9bc73484f218303d2c492da3adb99441d6 (patch)
treef37bbc2c990c44f92fa7c188fc9868bfae9b2508
parent802c4001340baa6f79c8107bb58add5dba9ad2b8 (diff)
parent90baeb04aabf8d3004709fc7c5b4cc710c47fd0f (diff)
downloadbh20-seq-resource-af09eb9bc73484f218303d2c492da3adb99441d6.tar.gz
bh20-seq-resource-af09eb9bc73484f218303d2c492da3adb99441d6.tar.lz
bh20-seq-resource-af09eb9bc73484f218303d2c492da3adb99441d6.zip
Merge branch 'master' of https://github.com/arvados/bh20-seq-resource
-rwxr-xr-xscripts/update_virtuoso/check_for_updates.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/update_virtuoso/check_for_updates.py b/scripts/update_virtuoso/check_for_updates.py
index 81496ce..d5eee14 100755
--- a/scripts/update_virtuoso/check_for_updates.py
+++ b/scripts/update_virtuoso/check_for_updates.py
@@ -29,7 +29,7 @@ def upload(fn):
# cmd = ("curl --digest --user dba:%s --verbose --url -G http://sparql.genenetwork.org/sparql-graph-crud-auth --data-urlencode graph=http://covid-19.genenetwork.org/graph -X DELETE" % pwd).split(" ")
print("UPLOAD "+fn)
- cmd = ("curl -X PUT --digest -u dba:%s -H Content-Type:text/turtle -T %s -G http://sparql.genenetwork.org/sparql-graph-crud-auth --data-urlencode graph=http://covid-19.genenetwork.org/graph/%s" % (pwd, fn, fn) ).split(" ")
+ cmd = ("curl -X PUT --digest -u dba:%s -H Content-Type:text/turtle -T %s -G http://sparql.genenetwork.org/sparql-graph-crud-auth --data-urlencode graph=http://covid-19.genenetwork.org/graph/%s" % (pwd, fn, os.path.basename(fn)) ).split(" ")
print(cmd)
p = subprocess.Popen(cmd)
output = p.communicate()[0]
@@ -56,6 +56,15 @@ if os.path.isfile(fn):
file.close
if stamp != last_modified_str:
+ print("Delete graphs")
+ for graph in ["labels.ttl", "metadata.ttl", "countries.ttl" ""]:
+ cmd = ("curl --digest -u dba:%s --verbose --url http://127.0.0.1:8890/sparql-graph-crud-auth?graph=http://covid-19.genenetwork.org/graph/%s -X DELETE" % (pwd, graph))
+ print(cmd)
+ p = subprocess.Popen(cmd.split(" "))
+ output = p.communicate()[0]
+ print(output)
+ # assert(p.returncode == 0) -> may prevent update
+
upload(basedir+"/semantic_enrichment/labels.ttl")
upload(basedir+"/semantic_enrichment/countries.ttl")