query-6b1ffa7ea413a517ca6781443063abbf
Order items according to their lat or their long
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?gare_ferroviaire ?gare_ferroviaireLabel ?lat ?long ?coords WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?gare_ferroviaire wdt:P31 wd:Q55488;
wdt:P17 wd:Q258; wdt:P16 wd:Q1925891;
wdt:P625 ?coordonnées_géographiques.
?gare_ferroviaire p:P625 ?statement . # coordinate-location statement
?statement psv:P625 ?coordinate_node .
?coordinate_node wikibase:geoLatitude ?lat .
?coordinate_node wikibase:geoLongitude ?long .
}order by ?lat
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?coordinate_node")
v3("?coordonnées_géographiques")
v2("?gare_ferroviaire"):::projected
v1("?lat"):::projected
v6("?long"):::projected
v4("?statement")
c8(["wd:Q258"]):::iri
c2(["bd:serviceParam"]):::iri
c4(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["wd:Q55488"]):::iri
c10(["wd:Q1925891"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v2 --"p:direct/P31"--> c6
v2 --"p:direct/P17"--> c8
v2 --"p:direct/P16"--> c10
v2 --"p:direct/P625"--> v3
v2 --"p:P625"--> v4
v4 --"p:statement/value/P625"--> v5
v5 --"wikibase:geoLatitude"--> v1
v5 --"wikibase:geoLongitude"--> v6