LinguaLibre

Difference between revisions of "Stats/Languages"

< LinguaLibre:Stats

(over 60 % more performance with this query with identical results (~ 40 seconds -> 11-15 seconds))
(Merge two queries into a single one)
 
(7 intermediate revisions by 2 users not shown)
Line 4: Line 4:
 
== Languages by number of recordings == <!--T:5-->
 
== Languages by number of recordings == <!--T:5-->
 
</translate>
 
</translate>
<query _pagination="10" lang="<translate> <!--T:7--> Item (Language Qid)</translate>" langLabel="<translate> <!--T:8--> Language</translate>" code="<translate> <!--T:9--> ISO 639-3 code</translate>" nb="<translate> <!--T:10--> Number of records</translate>">
+
<query _pagination="10" lang="<translate> <!--T:7--> Item (Language Qid)</translate>" langLabel="<translate> <!--T:8--> Language</translate>" code="<translate> <!--T:9--> ISO 639-3 code</translate>" numRecords="<translate> <!--T:10--> Number of records</translate>" numSpeakers="<translate> <!--T:14--> Number of speakers</translate>">
SELECT ?lang ?langLabel ?code ?nb WHERE {
+
SELECT ?lang ?langLabel ?code ?numRecords ?numSpeakers WHERE {
 
   {
 
   {
     SELECT ?lang (COUNT(?record) as ?nb) WHERE {
+
     SELECT ?lang (COUNT(?record) as ?numRecords) WHERE {
 
       ?record prop:P4 ?lang ; prop:P2 entity:Q2
 
       ?record prop:P4 ?lang ; prop:P2 entity:Q2
 
     } GROUP BY ?lang
 
     } GROUP BY ?lang
 
   }
 
   }
 
    
 
    
   ?lang prop:P2 entity:Q4
+
   {
 
+
     SELECT ?lang (COUNT(DISTINCT ?recorder) as ?numSpeakers) WHERE {
  OPTIONAL { ?lang prop:P13 ?code }
+
       ?record prop:P2 entity:Q2 ;
         
+
              prop:P4 ?lang ;
  SERVICE wikibase:label {
+
              prop:P5 ?recorder
     bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
+
    } GROUP BY ?lang
    ?lang rdfs:label ?langLabel .
 
  }
 
} ORDER BY DESC(?nb)
 
</query>
 
 
 
<translate>
 
 
 
== Languages by number of speakers == <!--T:6-->
 
</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 (COUNT(?recorder) as ?nb) WHERE {
 
 
 
  {  
 
       SELECT ?lang ?recorder WHERE {
 
        ?record prop:P2 entity:Q2 ;
 
                prop:P4 ?lang ;
 
                prop:P5 ?recorder
 
      } GROUP BY ?lang ?recorder
 
 
   }
 
   }
 
    
 
    
   ?lang prop:P2 entity:Q4 .
+
   ?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
+
} ORDER BY DESC(?numRecords)
ORDER BY DESC(?nb)
 
 
</query>
 
</query>
  

Latest revision as of 17:27, 5 July 2024

Other languages:
Bahasa Indonesia • ‎Bahasa Melayu • ‎Deutsch • ‎English • ‎Esperanto • ‎Igbo • ‎Toki Pona • ‎brezhoneg • ‎euskara • ‎français • ‎galego • ‎occitan • ‎polski • ‎sicilianu • ‎svenska • ‎Ελληνικά • ‎башҡортса • ‎македонски • ‎русский • ‎עברית • ‎বাংলা • ‎தமிழ் • ‎తెలుగు
View statistics about:

Languages by number of recordings

... Loading ...

See also