aboutsummaryrefslogtreecommitdiff
path: root/bh20simplewebuploader/main.py
diff options
context:
space:
mode:
authorPjotr Prins2020-05-13 17:19:47 -0500
committerPjotr Prins2020-05-13 17:19:47 -0500
commit8ba790336086dc59a8819bfe4af486393158c219 (patch)
tree7f722e78f1da04661a44e1ff931f894cbacfdf25 /bh20simplewebuploader/main.py
parentb52dabb92f6b9577a69ea30da64ad4aeced75a0e (diff)
parentc44a03772f1fe12bb9a6fe27e242337d14356ff7 (diff)
downloadbh20-seq-resource-8ba790336086dc59a8819bfe4af486393158c219.tar.gz
bh20-seq-resource-8ba790336086dc59a8819bfe4af486393158c219.tar.lz
bh20-seq-resource-8ba790336086dc59a8819bfe4af486393158c219.zip
Merge branch 'master' of github.com:arvados/bh20-seq-resource
Diffstat (limited to 'bh20simplewebuploader/main.py')
-rw-r--r--bh20simplewebuploader/main.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py
index 1a441f0..2aebe80 100644
--- a/bh20simplewebuploader/main.py
+++ b/bh20simplewebuploader/main.py
@@ -451,8 +451,9 @@ def getDetailsForSeq():
@app.route('/api/getSEQCountbytech', methods=['GET'])
def getSEQCountbytech():
query="""SELECT ?tech ?tech_label (count(?fasta) as ?fastaCount) WHERE
- {?fasta ?x [<http://purl.obolibrary.org/obo/OBI_0600047> ?tech]
- BIND (concat(?tech,"_label") as ?tech_label)}
+ {?fasta ?x [<http://purl.obolibrary.org/obo/OBI_0600047> ?tech] .
+ OPTIONAL {?tech <http://www.w3.org/2000/01/rdf-schema#label> ?tech_tmp_label } .
+ BIND(IF(BOUND(?tech_tmp_label), ?tech_tmp_label,?tech) as ?tech_label)}
GROUP BY ?tech ?tech_label ORDER BY DESC (?fastaCount)
"""
payload = {'query': query, 'format': 'json'}
@@ -505,8 +506,9 @@ def getSEQbyLocation():
@app.route('/api/getSEQCountbyLocation', methods=['GET'])
def getSEQCountbyLocation():
query="""SELECT ?geoLocation ?geoLocation_label (count(?fasta) as ?fastaCount) WHERE
- {?fasta ?x [<http://purl.obolibrary.org/obo/GAZ_00000448> ?geoLocation]
- BIND (concat(?geoLocation,"_label") as ?geoLocation_label)}
+ {?fasta ?x [<http://purl.obolibrary.org/obo/GAZ_00000448> ?geoLocation] .
+ Optional {?geoLocation <http://www.w3.org/2000/01/rdf-schema#label> ?geoLocation_tmp_label}
+ BIND(IF(BOUND(?geoLocation_tmp_label), ?geoLocation_tmp_label, ?geoLocation) as ?geoLocation_label)}
GROUP BY ?geoLocation ?geoLocation_label ORDER BY DESC (?fastaCount)
"""
payload = {'query': query, 'format': 'json'}
@@ -521,9 +523,10 @@ def getSEQCountbyLocation():
def getSEQCountbySpecimenSource():
query="""SELECT ?specimen_source ?specimen_source_label (count(?fasta) as ?fastaCount) WHERE
{?fasta ?x [<http://purl.obolibrary.org/obo/OBI_0001479> ?specimen_source]
- BIND (concat(?specimen_source,"_label") as ?specimen_source_label)}
- GROUP BY ?specimen_source ?specimen_source_label
- ORDER BY DESC (?fastaCount)
+ Optional { ?specimen_source <http://www.w3.org/2000/01/rdf-schema#label> ?specimen_source_tmp_label}
+ BIND(IF(BOUND(?specimen_source_tmp_label), ?specimen_source_tmp_label ,?specimen_source) as ?specimen_source_label)}
+ GROUP BY ?specimen_source ?specimen_source_label
+ ORDER BY DESC (?fastaCount)
"""
payload = {'query': query, 'format': 'json'}
r = requests.get(baseURL, params=payload)