query-1a1ad71f9462be95d6ae9ff25983a449
title:Cemeteries in Lithuania near churches SELECT ?cemetery ?cemeteryLabel ?churchLabel ?church ?distance { ?cemetery wdt:P31/wdt:P279 wd:Q39614; wdt:P17 wd:Q37; wdt:P625 ?cem_coords. SERVICE wikibase:around { ?church wdt:P625 ?chr_coords. bd:serviceParam wikibase:center ?cem_coords. bd:serviceParam wikibase:radius "0.02". bd:serviceParam wikibase:distance ?distance. } FILTER EXISTS { ?church wdt:P31/wdt:P279 wd:Q16970. } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en". } }
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#>
#title:Cemeteries in Lithuania near churches
SELECT ?cemetery ?cemeteryLabel ?churchLabel ?church ?distance {
?cemetery wdt:P31/wdt:P279* wd:Q39614;
wdt:P17 wd:Q37;
wdt:P625 ?cem_coords.
SERVICE wikibase:around {
?church wdt:P625 ?chr_coords.
bd:serviceParam wikibase:center ?cem_coords.
bd:serviceParam wikibase:radius "0.02".
bd:serviceParam wikibase:distance ?distance.
}
FILTER EXISTS {
?church wdt:P31/wdt:P279* wd:Q16970.
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE], en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?cem_coords")
v2("?cemetery"):::projected
v4("?chr_coords")
v1("?church"):::projected
v5("?distance"):::projected
a2((" "))
a1((" "))
c16(["#91;AUTO_LANGUAGE#93;, en"]):::literal
c6(["wd:Q37"]):::iri
c9(["bd:serviceParam"]):::iri
c12(["0.02"]):::literal
c3(["wd:Q16970"]):::iri
c4(["wd:Q39614"]):::iri
f0[[" "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0a1
e0a1 --"wdt:P279"--> e0c3
e0v1("?church"):::projected
e0a1((" ")):::projected
e0c3(["wd:Q16970"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> a1
f0 --> c2
f0 --> c3
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v2 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c4
v2 --"wdt:P17"--> c6
v2 --"wdt:P625"--> v3
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v1 --"wdt:P625"--> v4
c9 --"wikibase:center"--> v3
c9 --"wikibase:radius"--> c12
c9 --"wikibase:distance"--> v5
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c9 --"wikibase:language"--> c16
end