query-4b5efd51425e2d3a5ff65e06c1cc1a57
Find duplicate monument IDs SELECT * WHERE { { SELECT ?id (COUNT(?obj) AS ?count) (GROUP_CONCAT(?obj; SEPARATOR = " , ") AS ?items) WHERE { ?obj wdt:P762 ?id. } GROUP BY ?id } FILTER(?count > 1) }
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
#Find duplicate monument IDs
SELECT * WHERE {
{
SELECT ?id (COUNT(?obj) AS ?count) (GROUP_CONCAT(?obj; SEPARATOR = " , ") AS ?items) WHERE {
?obj wdt:P762 ?id.
}
GROUP BY ?id
}
FILTER(?count > 1)
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?count"):::projected
v3("?id"):::projected
v4("?items"):::projected
v2("?obj")
f0[["?count > '1^^xsd:integer'"]]
f0 --> v4
v2 --"wdt:P762"--> v3
bind3[/"count(?obj)"/]
v2 --o bind3
bind3 --as--o v4
bind4[/"?obj"/]
v2 --o bind4
bind4 --as--o v4