From 89ccd3ce507ea2abad408a9df559aa3bbcc0e377 Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Wed, 28 Oct 2020 15:21:05 +0000 Subject: Fix DEMO links --- bh20simplewebuploader/main.py | 25 +++++++++++++++---------- bh20simplewebuploader/static/main.js | 10 ++++------ 2 files changed, 19 insertions(+), 16 deletions(-) (limited to 'bh20simplewebuploader') diff --git a/bh20simplewebuploader/main.py b/bh20simplewebuploader/main.py index 4ec3251..92cea2e 100644 --- a/bh20simplewebuploader/main.py +++ b/bh20simplewebuploader/main.py @@ -669,7 +669,7 @@ def contact_page(): sparqlURL='http://sparql.genenetwork.org/sparql/' ## -# Example http://host/resource/MT326090.1 +# Example http://covid19.genenetwork.org/resource/MT326090.1 # Example http://host/resource/SRR11621868 @app.route('/resource/') def resource(id): @@ -842,10 +842,13 @@ def getSEQbyLocation(): @app.route('/api/getSEQCountbyLocation', methods=['GET']) def getSEQCountbyLocation(): - query="""SELECT ?geoLocation ?geoLocation_label (count(?fasta) as ?fastaCount) WHERE - {?fasta ?x [ ?geoLocation] . - Optional {?geoLocation ?geoLocation_tmp_label} - BIND(IF(BOUND(?geoLocation_tmp_label), ?geoLocation_tmp_label, ?geoLocation) as ?geoLocation_label)} + query=""" + SELECT ?geoLocation ?geoLocation_label (count(?fasta) as ?fastaCount) WHERE + { + ?fasta ?x [ ?geoLocation] . + Optional {?geoLocation ?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'} @@ -878,11 +881,13 @@ def getSEQCountbyContinent(): @app.route('/api/getSEQCountbyCountryContinent', methods=['GET']) def getSEQCountbyCountryContinent(): - query="""SELECT DISTINCT ?location ?location_label (count(?fasta) as ?fastaCount) WHERE { - ?fasta ?x[ ?location] . - ?location . - OPTIONAL { ?location rdfs:label ?key_tmp_label } - BIND(IF(BOUND(?key_tmp_label),?key_tmp_label, ?location) as ?location_label) + query=""" + SELECT DISTINCT ?location ?location_label (count(?fasta) as ?fastaCount) WHERE + { + ?fasta ?x[ ?location] . + ?location . + OPTIONAL { ?location rdfs:label ?key_tmp_label } + BIND(IF(BOUND(?key_tmp_label),?key_tmp_label, ?location) as ?location_label) } GROUP BY ?location ?location_label """ diff --git a/bh20simplewebuploader/static/main.js b/bh20simplewebuploader/static/main.js index c0bc23f..6e63ed3 100644 --- a/bh20simplewebuploader/static/main.js +++ b/bh20simplewebuploader/static/main.js @@ -72,9 +72,11 @@ function fetchHTMLTable(apiEndPoint) { for (var i=0; i"+data[i]["label"]+""+data[i]["count"]+"" } -*/ + */ for (var i=0; i"+data[i]["label"]+""+data[i]["count"]+"" + let url = data[i]["key"]; + let label = data[i]["label"]; + htmlString=htmlString+""+label+""+data[i]["count"]+"" } htmlString=htmlString+"" @@ -143,10 +145,6 @@ let fetchMap = () => { updateMapMarkers(); }; -let fetchSEQCountbyLocation = () => { - fetchHTMLTable("/api/getSEQCountbyLocation"); -}; - let fetchSEQByLocation = () => { console.log("Missing - set parameter for request, retrieve data") }; -- cgit v1.2.3