Skip to content

Commit d8b3bf6

Browse files
committed
Shortened the query, to fit the GET URL length limit
1 parent 4057ccd commit d8b3bf6

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

scholia/app/templates/location_nearby-organizations.sparql

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,21 @@
11
{% import 'sparql-helpers.sparql' as sparql_helpers -%}
2-
PREFIX target: <http://www.wikidata.org/entity/{{ q }}>
32
# title: Nearby academic institutions around a specified geographic entity.
4-
PREFIX bd: <http://www.bigdata.com/rdf#>
53
PREFIX wd: <http://www.wikidata.org/entity/>
64
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
7-
PREFIX wikibase: <http://wikiba.se/ontology#>
85
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
96
SELECT ?distance ?unit ?unitLabel ?organization ?organizationLabel ?organizationDescription (CONCAT("/organization/", SUBSTR(STR(?organization),32)) AS ?organizationUrl) WHERE {
107
{ # Compute distance.
118
SELECT ?organization ?distance ?unit WHERE {
12-
{ # Academic institutions on all levels
13-
SELECT DISTINCT ?organization ?other_geo WHERE {
14-
{ ?organization wdt:P361*/wdt:P31/wdt:P279* wd:Q3918 }
9+
# Academic institutions on all levels
10+
{ ?organization wdt:P361*/wdt:P31/wdt:P279* wd:Q3918 }
1511
UNION
1612
{ ?organization wdt:P361*/wdt:P31/wdt:P279* wd:Q1371037 }
1713
UNION
1814
{ ?organization wdt:P361*/wdt:P31/wdt:P279* wd:Q7315155 }
1915
UNION
2016
{ ?organization wdt:P361*/wdt:P31/wdt:P279* wd:Q31855 }
21-
?organization wdt:P625 ?other_geo .
22-
}
23-
}
24-
target: wdt:P159*/wdt:P625 ?geo .
17+
?organization wdt:P625 ?other_geo .
18+
wd:{{ q }} wdt:P159*/wdt:P625 ?geo .
2519
BIND (geof:distance(?other_geo,?geo) AS ?distance)
2620
BIND (wd:Q828224 AS ?unit)
2721
FILTER (?distance < 250)

0 commit comments

Comments
 (0)