query-29b8268ddacfff1e41d515b64ea532b1
Violations of the distinct value constraint for VIAF ids SELECT ?viafID (COUNT(DISTINCT ?item) AS ?itemCount) (GROUP_CONCAT(DISTINCT ?item; SEPARATOR=" | ") AS ?wdIDs) (GROUP_CONCAT(DISTINCT ?itemLabel;SEPARATOR=" | ") AS ?labels) WHERE { SELECT ?viafID ?item ?itemLabel ?itemDescription ?sitelinks WHERE { [] p:P214 [ wikibase:hasViolationForConstraint wds:P214-B36B72ED-7C33-4CF1-A4E9-55366E0B6501 ; ps:P214 ?viafID ]. OPTIONAL {?item wdt:P214 ?viafID} OPTIONAL {?item p:P214 [ps:P214 ?viafID]} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". ?item rdfs:label ?itemLabel} } } GROUP BY ?viafID HAVING (?itemCount > 1) ORDER BY DESC(?itemCount)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wds: <http://www.wikidata.org/entity/statement/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Violations of the distinct value constraint for VIAF ids
SELECT ?viafID (COUNT(DISTINCT ?item) AS ?itemCount) (GROUP_CONCAT(DISTINCT ?item; SEPARATOR=" | ") AS ?wdIDs) (GROUP_CONCAT(DISTINCT ?itemLabel;SEPARATOR=" | ") AS ?labels)
WHERE {
SELECT ?viafID ?item ?itemLabel ?itemDescription ?sitelinks
WHERE
{
[] p:P214 [
wikibase:hasViolationForConstraint wds:P214-B36B72ED-7C33-4CF1-A4E9-55366E0B6501 ;
ps:P214 ?viafID
].
OPTIONAL {?item wdt:P214 ?viafID}
OPTIONAL {?item p:P214 [ps:P214 ?viafID]}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,de". ?item rdfs:label ?itemLabel}
}
}
GROUP BY ?viafID
HAVING (?itemCount > 1)
ORDER BY DESC(?itemCount)