query-e07a8182211196d2ac39a15399d7c548
Propertiesinstance of (P31)head of government (P6)
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?first_letter (count(?first_letter) as ?count) WHERE {
?Estatu_subiranoa wdt:P31 wd:Q3624078;
rdfs:label ?Estatu_subiranoaLabel;
wdt:P6 ?agintaria.
?agintaria rdfs:label ?agintariaLabel.
FILTER(lang(?Estatu_subiranoaLabel)="en" && lang(?agintariaLabel)="en")
bind( substr( ?agintariaLabel, 1, 1 ) as ?first_letter )
}
GROUP BY ?first_letter
ORDER by DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?Estatu_subiranoa")
v2("?Estatu_subiranoaLabel")
v5("?agintaria")
v3("?agintariaLabel")
v7("?count")
v6("?first_letter"):::projected
c3(["wd:Q3624078"]):::iri
f0[["?Estatu_subiranoaLabel = 'en'?agintariaLabel = 'en'"]]
f0 --> v2
f0 --> v3
v4 --"wdt:P31"--> c3
v4 --"rdfs:label"--> v2
v4 --"wdt:P6"--> v5
v5 --"rdfs:label"--> v3
bind1[/"substring(?agintariaLabel,'1^^xsd:integer','1^^xsd:integer')"/]
v3 --o bind1
bind1 --as--o v6
bind3[/"count(?first_letter)"/]
v6 --o bind3
bind3 --as--o v7