aboutsummaryrefslogtreecommitdiff
path: root/bh20simplewebuploader/main.py
diff options
context:
space:
mode:
authorPjotr Prins2020-10-28 16:35:02 +0000
committerPjotr Prins2020-10-28 16:35:02 +0000
commit2dddbdb2991df958699d5033b3f09f4f7367800b (patch)
tree91c2870bd0cca52d0471a8cabc77efc796f6eade /bh20simplewebuploader/main.py
parente9ea11c5332668af16c0497bf2b578433b05b32f (diff)
downloadbh20-seq-resource-2dddbdb2991df958699d5033b3f09f4f7367800b.tar.gz
bh20-seq-resource-2dddbdb2991df958699d5033b3f09f4f7367800b.tar.lz
bh20-seq-resource-2dddbdb2991df958699d5033b3f09f4f7367800b.zip
Country information
Diffstat (limited to 'bh20simplewebuploader/main.py')
-rw-r--r--bh20simplewebuploader/main.py10
1 files changed, 6 insertions, 4 deletions
diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py
index 0be9d9f..73503b4 100644
--- a/bh20simplewebuploader/main.py
+++ b/bh20simplewebuploader/main.py
@@ -724,22 +724,24 @@ def location():
"""Show country resource"""
loc = request.args.get('label')
logging.info(loc)
- logging.info("^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
+ # logging.info("^^^^^^^^^^^^^^^^^^^^^^^^^^^^")
query = f"""
PREFIX pubseq: <http://biohackathon.org/bh20-seq-schema#MainSchema/>
PREFIX sio: <http://semanticscience.org/resource/>
- select distinct ?name ?date where
+ select distinct ?name ?date ?geoname where
{{
?sample <http://purl.obolibrary.org/obo/GAZ_00000448> <{loc}> .
?sample <http://semanticscience.org/resource/SIO_000115> ?name .
?sample <http://ncicb.nci.nih.gov/xml/owl/EVS/Thesaurus.owl#C25164> ?date .
+ <{loc}> rdfs:label ?geoname .
}} order by ?name
"""
payload = {'query': query, 'format': 'json'}
r = requests.get(sparqlURL, params=payload)
result = r.json()['results']['bindings']
- logging.info(result)
- return render_template('list.html',id=loc,menu='',h=['name','date'],l=result)
+ geoname = result[0]['geoname']['value']
+ # logging.info(result)
+ return render_template('list.html',id=geoname,url=loc,menu='',h=['name','date'],l=result)
## Dynamic API functions starting here
## This is quick and dirty for now, just to get something out and demonstrate the queries