query-29b8268ddacfff1e41d515b64ea532b1

rq turtle/ttl

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

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)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?item"):::projected v5("?itemCount") v4("?itemLabel"):::projected v6("?labels") v2("?viafID"):::projected v5("?wdIDs") a2((" ")) a1((" ")) a3((" ")) c8(["bd:serviceParam"]):::iri c3(["wds:P214-B36B72ED-7C33-4CF1-A4E9-55366E0B6501"]):::iri c10(["#91;AUTO_LANGUAGE#93;,en,de"]):::literal f0[["?itemCount > '1^^xsd:integer'"]] f0 --> v5 a1 --"wikibase:hasViolationForConstraint"--> c3 a1 --"p:statement/P214"--> v2 a2 --"p:P214"--> a1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P214".-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; a3 -."p:statement/P214".-> v2 v3 --"p:P214"--> a3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 v3 --"rdfs:label"--> v4 end bind4[/"count(?item)"/] v3 --o bind4 bind4 --as--o v5 bind5[/"?item"/] v3 --o bind5 bind5 --as--o v5 bind6[/"?itemLabel"/] v4 --o bind6 bind6 --as--o v6