query-274c97bc99084ed18256f22508c67dc6
And just for fun:
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
SELECT ?initial (COUNT(*) as ?count)
{
[] schema:about wd:Q16520 ; schema:isPartOf ?wiki ; schema:name ?name .
?wp wdt:P856 ?wiki ; wdt:P282/wdt:P279* wd:Q8229 .
BIND( str(substr(?name, 1, 1)) as ?initial)
}
GROUP BY ?initial
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?count")
v4("?initial"):::projected
v2("?name")
v1("?wiki")
v3("?wp")
a1((" "))
a2((" "))
c8(["wd:Q8229"]):::iri
c2(["wd:Q16520"]):::iri
a1 --"schema:about"--> c2
a1 --"schema:isPartOf"--> v1
a1 --"schema:name"--> v2
v3 --"wdt:P856"--> v1
v3 --"wdt:P282"--> a2
a2 --"wdt:P279"--> c8
bind0[/"str(substring(?name,'1^^xsd:integer','1^^xsd:integer'))"/]
v2 --o bind0
bind0 --as--o v4
bind2[/"count(*)"/]
bind2 --as--o v5