aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPjotr Prins2020-05-20 14:09:36 -0500
committerPjotr Prins2020-05-20 14:09:36 -0500
commitbd01d3fa635d28ca40ee1b413695f14d8a40a977 (patch)
tree9faef8cf5a2b678cc6ff72ef01b2620e2b6f0d8c
parent8118c9365c3663632d927e56cfafadccdca15ce1 (diff)
parent82c64075d7656e8c8f38fb887b86e4e98c81a5a9 (diff)
downloadbh20-seq-resource-bd01d3fa635d28ca40ee1b413695f14d8a40a977.tar.gz
bh20-seq-resource-bd01d3fa635d28ca40ee1b413695f14d8a40a977.tar.lz
bh20-seq-resource-bd01d3fa635d28ca40ee1b413695f14d8a40a977.zip
Merge branch 'master' of github.com:pjotrp/bh20-seq-resource
-rwxr-xr-xscripts/update_virtuoso/check_for_updates.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/scripts/update_virtuoso/check_for_updates.py b/scripts/update_virtuoso/check_for_updates.py
index 3deed7f..81496ce 100755
--- a/scripts/update_virtuoso/check_for_updates.py
+++ b/scripts/update_virtuoso/check_for_updates.py
@@ -18,6 +18,9 @@ fn = sys.argv[1]
user = sys.argv[2]
pwd = sys.argv[3]
+scriptdir = os.path.dirname(os.path.realpath(__file__))
+print(scriptdir)
+basedir = os.path.dirname(os.path.dirname(scriptdir))
def upload(fn):
# Upload into Virtuoso using CURL
@@ -33,10 +36,6 @@ def upload(fn):
print(output)
assert(p.returncode == 0)
-# --- Always update these
-upload("semantic_enrichment/labels.ttl")
-upload("semantic_enrichment/countries.ttl")
-
url = 'https://download.lugli.arvadosapi.com/c=lugli-4zz18-z513nlpqm03hpca/_/mergedmetadata.ttl'
# --- Fetch headers from TTL file on Arvados
r = requests.head(url)
@@ -57,6 +56,9 @@ if os.path.isfile(fn):
file.close
if stamp != last_modified_str:
+ upload(basedir+"/semantic_enrichment/labels.ttl")
+ upload(basedir+"/semantic_enrichment/countries.ttl")
+
print("Fetch metadata TTL")
r = requests.get(url)
assert(r.status_code == 200)
@@ -66,3 +68,5 @@ if stamp != last_modified_str:
upload("metadata.ttl")
with open(fn,"w") as f:
f.write(last_modified_str)
+else:
+ print("Metadata is up to date")