LinguaLibre
Difference between revisions of "Stats/Languages"
< LinguaLibre:Stats
(Optimizing query - Now only requires ~ 6 seconds to load) |
(over 60 % more performance with this query with identical results (~ 40 seconds -> 11-15 seconds)) |
||
Line 28: | Line 28: | ||
</translate> | </translate> | ||
<query _pagination="10" lang="<translate> <!--T:11--> Item (Language Qid)</translate>" langLabel="<translate> <!--T:12--> Language</translate>" code="<translate> <!--T:13--> ISO 639-3 code</translate>" nb="<translate> <!--T:14--> Number of speakers</translate>"> | <query _pagination="10" lang="<translate> <!--T:11--> Item (Language Qid)</translate>" langLabel="<translate> <!--T:12--> Language</translate>" code="<translate> <!--T:13--> ISO 639-3 code</translate>" nb="<translate> <!--T:14--> Number of speakers</translate>"> | ||
− | SELECT ?lang ?langLabel ?code ( | + | SELECT ?lang ?langLabel ?code (COUNT(?recorder) as ?nb) WHERE { |
− | ?lang prop:P2 entity: | + | |
− | + | { | |
+ | SELECT ?lang ?recorder WHERE { | ||
+ | ?record prop:P2 entity:Q2 ; | ||
+ | prop:P4 ?lang ; | ||
+ | prop:P5 ?recorder | ||
+ | } GROUP BY ?lang ?recorder | ||
+ | } | ||
+ | |||
+ | ?lang prop:P2 entity:Q4 . | ||
+ | |||
OPTIONAL { ?lang prop:P13 ?code } | OPTIONAL { ?lang prop:P13 ?code } | ||
+ | |||
SERVICE wikibase:label { | SERVICE wikibase:label { | ||
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . | bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . | ||
?lang rdfs:label ?langLabel . | ?lang rdfs:label ?langLabel . | ||
} | } | ||
− | } | + | } GROUP BY ?lang ?langLabel ?code |
− | GROUP BY ?lang ?langLabel ?code | ||
ORDER BY DESC(?nb) | ORDER BY DESC(?nb) | ||
</query> | </query> |
Revision as of 19:17, 20 May 2023
Languages by number of recordings