query-d17fe103cdec7818bf91c915b312fa55
What awards did they receive?
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#>
# Count of P166 'award received' grouped by award type, for
#'Wikidata entries for British ambassadors and high commissioners
select ?awardedLabel (count(distinct ?person) as ?count)
where {
{ ?position wdt:P31 wd:Q18115939 . } union { ?position wdt:P31 wd:Q56760832 } .
?person p:P39 ?positionStatement . ?positionStatement ps:P39 ?position .
?person wdt:P166 ?awarded . # what award(s) were made to them
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} group by ?awardedLabel
#defaultView:BubbleChart
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?awarded")
v5("?count")
v2("?person"):::projected
v1("?position")
v3("?positionStatement")
c2(["wd:Q18115939"]):::iri
c8(["bd:serviceParam"]):::iri
c3(["wd:Q56760832"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"p:direct/P31"--> c3
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"p:direct/P31"--> c2
end
union0r <== or ==> union0l
end
v2 --"p:P39"--> v3
v3 --"p:statement/P39"--> v1
v2 --"p:direct/P166"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind1[/"count(?person)"/]
v2 --o bind1
bind1 --as--o v5