query-721cabac8e5835c8e82ef4ae4f3aa108

rq turtle/ttl

Find people with duplicate award entries SELECT ?item ?itemLabel ?value ?ref ?refLabel ?prop (COUNT(?ref) AS ?nr_items) WHERE { ?item wdt:P39 wd:Q18510612 .
# ?item p:P214 ?statement. # VIAF ?item p:P569 ?statement. # DOB # ?item ?prop ?statement.

?statement ps:P569 ?value.
?statement prov:wasDerivedFrom ?refnode.
# ?refnode   pr:P902 ?ref. ## HLS identifier
?refnode   pr:P248 ?ref.   ## ref name
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }

}

GROUP BY ?item ?itemLabel ?value ?statement ?ref ?refLabel ?prop HAVING(COUNT(?ref) > 1)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Find people with duplicate award entries
SELECT ?item ?itemLabel ?value ?ref  ?refLabel  ?prop (COUNT(?ref) AS ?nr_items)
WHERE
{
    ?item wdt:P39 wd:Q18510612 .  
    # ?item p:P214 ?statement. # VIAF
    ?item p:P569 ?statement. # DOB
    # ?item ?prop ?statement. 

    ?statement ps:P569 ?value.
    ?statement prov:wasDerivedFrom ?refnode.
    # ?refnode   pr:P902 ?ref. ## HLS identifier
    ?refnode   pr:P248 ?ref.   ## ref name
    SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}

GROUP BY ?item ?itemLabel ?value ?statement ?ref ?refLabel ?prop
HAVING(COUNT(?ref) > 1)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?_anon_d00291b7e9a143df8ec0be8c8ebd714c96954") v1("?item"):::projected v7("?nr_items") v5("?ref"):::projected v4("?refnode") v2("?statement") v3("?value"):::projected a1((" ")) c9(["bd:serviceParam"]):::iri c11(["en"]):::literal c3(["wd:Q18510612"]):::iri f0[[" > '1^^xsd:integer'"]] f0 --> a1 v1 --"p:direct/P39"--> c3 v1 --"p:P569"--> v2 v2 --"p:statement/P569"--> v3 v2 --"prov:wasDerivedFrom"--> v4 v4 --"p:reference/P248"--> v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind3[/"count(?ref)"/] v5 --o bind3 bind3 --as--o v6 bind4[/"count(?ref)"/] v5 --o bind4 bind4 --as--o v7