query-85f37f8d2dd7ce197e80422e81898be4
Duplicates because of identifier changeArt UK made the (not so wise) decision to include the url that also includes the identifier. Every once in a while they update a title and the url breaks, but the identifier stays the same. I made a query to find these duplicates:
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT ?identifier (COUNT(?item) AS ?count) (GROUP_CONCAT(STR(?item)) AS ?item) (GROUP_CONCAT(STR(?value)) AS ?value) WHERE {
?item wdt:P1679 ?value .
BIND(REPLACE(?value, "^.*-(\\d+)$", "$1") AS ?identifier)
} GROUP BY ?identifier
HAVING (?count > 1)
ORDER BY DESC(?identifier)
LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?count")
v5("?identifier"):::projected
v5("?item"):::projected
v5("?value"):::projected
f0[["?count > '1^^xsd:integer'"]]
f0 --> v5
v5 --"wdt:P1679"--> v5
bind1[/"replace(?value,'^.*-(\d+)$','$1')"/]
v5 --o bind1
bind1 --as--o v5
bind5[/"count(?item)"/]
v5 --o bind5
bind5 --as--o v5
bind6[/"str(?item)"/]
v5 --o bind6
bind6 --as--o v5
bind7[/"str(?value)"/]
v5 --o bind7
bind7 --as--o v5