query-54f0ddf56df2515c682bd7c65730c3a1
Find people with duplicate award entries
SELECT ?item ?itemLabel ?value ?valueLabel (COUNT(?value) AS ?nr_items)
WHERE
{
?item wdt:P39 wd:Q3307529 . # NHL General Managers
?item p:P166 ?statement. # list all awards
?statement ps:P166 ?value. # get values
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?item ?itemLabel ?value ?valueLabel
Use at
- https://query.wikidata.org/sparql
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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Find people with duplicate award entries
SELECT ?item ?itemLabel ?value ?valueLabel (COUNT(?value) AS ?nr_items)
WHERE
{
?item wdt:P39 wd:Q3307529 . # NHL General Managers
?item p:P166 ?statement. # list all awards
?statement ps:P166 ?value. # get values
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?item ?itemLabel ?value ?valueLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v4("?nr_items")
v2("?statement")
v3("?value"):::projected
c2(["wd:Q3307529"]):::iri
c6(["bd:serviceParam"]):::iri
c8(["en"]):::literal
v1 --"p:direct/P39"--> c2
v1 --"p:P166"--> v2
v2 --"p:statement/P166"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind1[/"count(?value)"/]
v3 --o bind1
bind1 --as--o v4