query-b7241aa68562d6ac82df0c6b311b1e43
Where were Ambassadors educated?
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 P69 'educated at' grouped by educational establishment, for
#'Wikidata entries for British ambassadors and high commissioners
select ?educatedLabel (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:P69 ?educated . # where were they educated
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} group by ?educatedLabel
#defaultView:BubbleChart
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?count")
v4("?educated")
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/P69"--> 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