query-70f76293bce2c87eb1920b050030e451
Project country coverage statsI'm trying to write a query that would give some statistics on the number of articles on a particular country's citizens/subdivisions/other in each Wikipedia, but it keeps timing out. Even this query, which only deals with citizens and only lists the top 15, times out:
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 schema: <http://schema.org/>
SELECT ( count( ?q ) as ?i ) ?project WHERE {
?q wdt:P17 wd:Q30 ;
^schema:about / schema:isPartOf ?project .
FILTER EXISTS { ?project wikibase:wikiGroup 'wikipedia' . }
} GROUP BY ?project ORDER BY DESC ( ?i ) LIMIT 15
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?i")
v2("?project"):::projected
v3("?q"):::projected
a1((" "))
c4(["wd:Q30"]):::iri
c2(["wikipedia"]):::literal
f0[[" "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wikibase:wikiGroup"--> e0c2
e0v1("?project"):::projected
e0c2(["wikipedia"]):::literal
end
f0--EXISTS--> f0e0
f0 --> v2
f0 --> c1
f0 --> c2
v2 --"wikibase:wikiGroup"--> c2
v3 --"wdt:P17"--> c4
a1 --"schema:about"--> v3
a1 --"schema:isPartOf"--> v2
bind2[/"count(?q)"/]
v3 --o bind2
bind2 --as--o v4