From 2dddbdb2991df958699d5033b3f09f4f7367800b Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Wed, 28 Oct 2020 16:35:02 +0000 Subject: Country information --- bh20simplewebuploader/main.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bh20simplewebuploader/main.py') 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: PREFIX sio: - select distinct ?name ?date where + select distinct ?name ?date ?geoname where {{ ?sample <{loc}> . ?sample ?name . ?sample ?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 -- cgit v1.2.3