query-3e6fcca0f4618475e137e8302eb8942b
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 bd: <http://www.bigdata.com/rdf#>
#defaultView:Map{"markercluster": { } }
PREFIX geof: <http://www.opengis.net/def/geosparql/function/>
#Places within 10km of Seifhennersdorf
SELECT ?place ?placeLabel ?location ?instanceLabel ?image WHERE {
wd:Q165195 wdt:P625 ?loc.
SERVICE wikibase:around {
?place wdt:P625 ?location.
bd:serviceParam wikibase:center ?loc.
bd:serviceParam wikibase:radius "1".
}
?place wdt:P31 wd:Q1362233.
OPTIONAL { ?place wdt:P31 ?instance. }
OPTIONAL { ?place wdt:P18 ?image.} # <<<< --- Here's the addition (plus ?image in the select)
SERVICE wikibase:label { bd:serviceParam wikibase:language "de". }
BIND(geof:distance(?loc, ?location) AS ?dist)
}
ORDER BY ?dist
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?dist")
v6("?image"):::projected
v5("?instance")
v2("?loc")
v4("?location"):::projected
v3("?place"):::projected
c13(["de"]):::literal
c1(["wd:Q165195"]):::iri
c7(["1"]):::literal
c4(["bd:serviceParam"]):::iri
c9(["wd:Q1362233"]):::iri
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
v3 --"wdt:P31"--> c9
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P31".-> v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P18".-> v6
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c4 --"wikibase:language"--> c13
end
bind0[/"http://www.opengis.net/def/geosparql/function/distance(?loc,?location)"/]
v2 --o bind0
v4 --o bind0
bind0 --as--o v7