query-5394926e6bbe4f93af81a090a4d164aa
Finding items with duplicate valuesI tried to find duplicate property values, i.e. cases where an item has two different statements for the same property with the same value:
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
SELECT DISTINCT ?item
WHERE {
?item ?claim ?statement1, ?statement2 FILTER(?statement1 != ?statement2).
?property wikibase:claim ?claim;
wikibase:statementProperty ?statement.
?statement1 ?statement ?value.
?statement2 ?statement ?value.
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?claim")
v3("?item"):::projected
v5("?property")
v6("?statement")
v1("?statement1")
v2("?statement2")
v7("?value")
f0[["?statement1 != ?statement2"]]
f0 --> v1
f0 --> v2
v3 -->v4--> v1
v3 -->v4--> v2
v5 --"wikibase:claim"--> v4
v5 --"wikibase:statementProperty"--> v6
v1 -->v6--> v7
v2 -->v6--> v7