query-15f7e4e48633b5c454b13cead008df74
List all elements close to a wikielement Add #defaultView:Map pour avoir la carte TODO
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 geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?place ?placeLabel ?location ?instanceLabel ?dist WHERE {
wd:Q7901873 wdt:P625 ?loc .
SERVICE wikibase:around {
?place wdt:P625 ?location .
bd:serviceParam wikibase:center ?loc .
bd:serviceParam wikibase:radius 10 . # in kilometers
}
OPTIONAL {
?place wdt:P31 ?instance .
}
SERVICE wikibase:label { bd:serviceParam wikibase:language 'en' }
BIND(geof:distance(?loc, ?location) AS ?dist) .
} ORDER BY ASC(?dist)
Query found at
- https://www.wikidata.org/wiki/User:Bouzinac/Recherches_g%C3%A9ographiques
- https://www.wikidata.org/wiki/Wikidata:Request_a_query/Archive/2018/08
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?dist"):::projected
v5("?instance")
v2("?loc")
v4("?location"):::projected
v3("?place"):::projected
c4(["bd:serviceParam"]):::iri
c11(["en"]):::literal
c1(["wd:Q7901873"]):::iri
c7(["10^^xsd:integer"]):::literal
c1 --"wdt:P625"--> v2
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v3 --"wdt:P625"--> v4
c4 --"wikibase:center"--> v2
c4 --"wikibase:radius"--> c7
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P31".-> v5
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c4 --"wikibase:language"--> c11
end
bind0[/"http://www.opengis.net/def/function/geosparql/distance(?loc,?location)"/]
v2 --o bind0
v4 --o bind0
bind0 --as--o v6