aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2020-05-12 14:45:10 -0500
committerPjotr Prins2020-05-12 14:45:10 -0500
commit0db3674b14ee441851999cab091a487aa5286550 (patch)
treef453ea4de4f13952edb0357fef1f375ae14f0fc6
parent5348517df7f62ce81d33e388f70e97cba680f679 (diff)
downloadbh20-seq-resource-0db3674b14ee441851999cab091a487aa5286550.tar.gz
bh20-seq-resource-0db3674b14ee441851999cab091a487aa5286550.tar.lz
bh20-seq-resource-0db3674b14ee441851999cab091a487aa5286550.zip
Virtuoso uploader: does not delete graph yet
-rw-r--r--.gitignore4
-rwxr-xr-xscripts/update_virtuoso/check_for_updates.py24
2 files changed, 14 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore
index 9057a4f..5f45fad 100644
--- a/.gitignore
+++ b/.gitignore
@@ -10,6 +10,10 @@ eggs/
*.egg-info/
*.egg
+# Temp files
+metadata.ttl
+cache.txt
+
# Environments
.env
.venv
diff --git a/scripts/update_virtuoso/check_for_updates.py b/scripts/update_virtuoso/check_for_updates.py
index 1c7813a..0f84fb1 100755
--- a/scripts/update_virtuoso/check_for_updates.py
+++ b/scripts/update_virtuoso/check_for_updates.py
@@ -9,20 +9,22 @@
import requests
import time
+import sys
+
+assert(len(sys.argv)==4)
+fn = sys.argv[1]
+user = sys.argv[2]
+pwd = sys.argv[3]
+
def upload(fn):
# Upload into Virtuoso using CURL
# cmd = "curl -X PUT --digest -u dba:dba -H Content-Type:text/turtle -T metadata.ttl -G http://localhost:8890/sparql-graph-crud-auth --data-urlencode graph=http://covid-19.genenetwork.org/graph".split(" ")
- print("DELETE "+fn)
- cmd = ("curl --digest --user dba:dba --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(cmd)
- p = subprocess.Popen(cmd)
- output = p.communicate()[0]
- print(output)
- assert(p.returncode == 0)
+ # print("DELETE "+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" % pwd, 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" % (pwd, fn) ).split(" ")
print(cmd)
p = subprocess.Popen(cmd)
output = p.communicate()[0]
@@ -43,12 +45,6 @@ t_stamp = time.strptime(last_modified_str,"%a, %d %b %Y %H:%M:%S %Z" )
print(t_stamp)
# OK, it works, now check last stored value
-import sys
-assert(len(sys.argv)==4)
-fn = sys.argv[1]
-user = sys.argv[2]
-pwd = sys.argv[3]
-
import os.path
stamp = None
if os.path.isfile(fn):