query-f8e90cb4f37edb08d1c1fcf730f407d7
Church image duplicates (culled from Magnus Manske, Jheald)
SELECT ?church ?churchLabel ?img
WITH {
SELECT ?church ?img WHERE {
?church wdt:P31 wd:Q16970 .
?church wdt:P18 ?img
}
} AS %church_images
WHERE {
{
SELECT ?img (count(?church) AS ?cnt) {
INCLUDE %church_images
} GROUP BY ?img
HAVING (?cnt>1)
}
INCLUDE %church_images .
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY desc(?cnt) ?img ?churchLabel
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#>
#Church image duplicates (culled from Magnus Manske, Jheald)
SELECT ?church ?churchLabel ?img
WHERE {
{
SELECT ?img (count(?church) AS ?cnt) {
{
SELECT ?church ?img WHERE {
?church wdt:P31 wd:Q16970 .
?church wdt:P18 ?img
}
} } GROUP BY ?img
HAVING (?cnt>1)
}
{
SELECT ?church ?img WHERE {
?church wdt:P31 wd:Q16970 .
?church wdt:P18 ?img
}
}.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY desc(?cnt) ?img ?churchLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?church"):::projected
v3("?churchLabel"):::projected
v5("?cnt")
v2("?img"):::projected
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q16970"]):::iri
f0[["?cnt > '1^^xsd:integer'"]]
f0 --> v5
v4 --"wdt:P31"--> c3
v4 --"wdt:P18"--> v2
bind2[/"count(?church)"/]
v4 --o bind2
bind2 --as--o v5
v4 --"wdt:P31"--> c3
v4 --"wdt:P18"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end