query-6d3298dc27e77e9cc7e55106e85fc83b
Lithuanian church buildings sorted by confessions
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:Lithuanian church buildings sorted by confessions
#defaultView:Map{"hide": ["?layer"]}
SELECT
?templom ?templomLabel (SAMPLE(?templomLocation) AS ?templomLocation_) (SAMPLE(?templomImage) AS ?templomImage_)
(IF(?ref, "Calvinist" , " ") AS ?refLabel)
(IF(?evang, "Lutheran", " ") AS ?evangLabel)
(IF(?kat, "Catholic", " ") AS ?katLabel)
(IF(?ort, "Eastern Orthodox", " ") AS ?ortLabel)
(CONCAT(?refLabel, ?evangLabel, ?katLabel, ?ortLabel) AS ?layer)
WHERE {
?templom wdt:P31/wdt:P279* wd:Q16970;
wdt:P17 wd:Q37;
BIND(EXISTS { ?templom wdt:P31 wd:Q103842783. } AS ?ref)
BIND(EXISTS { ?templom wdt:P31 wd:Q56242275. } AS ?evang)
BIND(EXISTS { ?templom wdt:P31/wdt:P279* wd:Q2031836. } AS ?ort)
BIND(EXISTS { ?templom wdt:P31/wdt:P279* wd:Q1088552. } AS ?kat)
OPTIONAL { ?templom wdt:P625 ?templomLocation. }
OPTIONAL { ?templom wdt:P18 ?templomImage. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?templom ?templomLabel ?person ?personLabel ?ref ?evang ?kat ?ort
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?evang"):::projected
v11("?evangLabel"):::projected
v5("?kat"):::projected
v12("?katLabel"):::projected
v14("?layer")
v4("?ort"):::projected
v13("?ortLabel"):::projected
v2("?ref"):::projected
v10("?refLabel"):::projected
v1("?templom"):::projected
v7("?templomImage"):::projected
v9("?templomImage_")
v6("?templomLocation"):::projected
v8("?templomLocation_")
a1((" "))
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q16970"]):::iri
c5(["wd:Q37"]):::iri
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c3
v1 --"wdt:P17"--> c5
v1 --"wdt:P31"--> null
bind0[/" "/]
subgraph bind0e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0c2
e0v1("?templom"):::projected
e0c2(["wd:Q103842783"]):::iri
end
bind0--EXISTS--> bind0e0
v1 --o bind0
c1 --o bind0
null --o bind0
bind0 --as--o v2
v1 --"wdt:P31"--> null
bind1[/" "/]
subgraph bind1e1["Exists Clause"]
e1v1 --"wdt:P31"--> e1c2
e1v1("?templom"):::projected
e1c2(["wd:Q56242275"]):::iri
end
bind1--EXISTS--> bind1e1
v1 --o bind1
c1 --o bind1
null --o bind1
bind1 --as--o v3
v1 --"wdt:P31"--> null
null --"wdt:P279"--> null
bind2[/" "/]
subgraph bind2e2["Exists Clause"]
e2v1 --"wdt:P31"--> e2a1
e2a1 --"wdt:P279"--> e2c3
e2v1("?templom"):::projected
e2a1((" ")):::projected
e2c3(["wd:Q2031836"]):::iri
end
bind2--EXISTS--> bind2e2
v1 --o bind2
c1 --o bind2
null --o bind2
c2 --o bind2
null --o bind2
bind2 --as--o v4
v1 --"wdt:P31"--> null
null --"wdt:P279"--> null
bind3[/" "/]
subgraph bind3e3["Exists Clause"]
e3v1 --"wdt:P31"--> e3a1
e3a1 --"wdt:P279"--> e3c3
e3v1("?templom"):::projected
e3a1((" ")):::projected
e3c3(["wd:Q1088552"]):::iri
end
bind3--EXISTS--> bind3e3
v1 --o bind3
c1 --o bind3
null --o bind3
c2 --o bind3
null --o bind3
bind3 --as--o v5
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P625".-> v6
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind6[/"sample(?templomLocation)"/]
v6 --o bind6
bind6 --as--o v8
bind7[/"sample(?templomImage)"/]
v7 --o bind7
bind7 --as--o v9
bind8[/"if(?ref,'Calvinist',' ')"/]
v2 --o bind8
bind8 --as--o v10
bind9[/"if(?evang,'Lutheran',' ')"/]
v3 --o bind9
bind9 --as--o v11
bind10[/"if(?kat,'Catholic',' ')"/]
v5 --o bind10
bind10 --as--o v12
bind11[/"if(?ort,'Eastern Orthodox',' ')"/]
v4 --o bind11
bind11 --as--o v13
bind12[/"concat(?refLabel,?evangLabel,?katLabel,?ortLabel)"/]
v10 --o bind12
v11 --o bind12
v12 --o bind12
v13 --o bind12
bind12 --as--o v14