query-bd26bfb2cb6e939186daf0fe36157b74
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX schema: <http://schema.org/>
SELECT ?first_letter (COUNT(?first_letter) as ?count) (?count/?total*100 AS ?pct)
WHERE
{
{
SELECT ?first_letter
WHERE
{
?article schema:name ?title.
?article schema:isPartOf <https://ca.wikipedia.org/>.
BIND (SUBSTR(?title, 1, 1) AS ?first_letter)
FILTER (! STRSTARTS(?title, "Categoria:"))
FILTER (! STRSTARTS(?title, "Plantilla:"))
}
}
{
SELECT (COUNT(?first_letter) AS ?total)
WHERE
{
{
SELECT ?first_letter
WHERE
{
?article schema:name ?title.
?article schema:isPartOf <https://ca.wikipedia.org/>.
BIND (SUBSTR(?title, 1, 1) AS ?first_letter)
FILTER (! STRSTARTS(?title, "Categoria:"))
FILTER (! STRSTARTS(?title, "Plantilla:"))
}
} }
}}
GROUP BY ?first_letter ?total
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?article")
v5("?count"):::projected
v4("?first_letter"):::projected
v6("?pct")
v1("?title")
v4("?total"):::projected
c5([https://ca.wikipedia.org/]):::iri
f0[["not starts-with(?title,'Plantilla:')"]]
f0 --> v1
f1[["not starts-with(?title,'Categoria:')"]]
f1 --> v1
v2 --"schema:name"--> v1
v2 --"schema:isPartOf"--> c5
bind2[/"substring(?title,'1^^xsd:integer','1^^xsd:integer')"/]
v1 --o bind2
bind2 --as--o v4
f3[["not starts-with(?title,'Plantilla:')"]]
f3 --> v1
f4[["not starts-with(?title,'Categoria:')"]]
f4 --> v1
v2 --"schema:name"--> v1
v2 --"schema:isPartOf"--> c5
bind5[/"substring(?title,'1^^xsd:integer','1^^xsd:integer')"/]
v1 --o bind5
bind5 --as--o v4
bind7[/"count(?first_letter)"/]
v4 --o bind7
bind7 --as--o v4
bind9[/"count(?first_letter)"/]
v4 --o bind9
bind9 --as--o v5
bind10[/"?count / ?total * '100^^xsd:integer'"/]
v5 --o bind10
v4 --o bind10
bind10 --as--o v6