fnielsen / ordia

Wikidata lexemes presentations
https://ordia.toolforge.org
Apache License 2.0
24 stars 13 forks source link

Add number of lexemes by statements? #124

Closed belett closed 2 years ago

belett commented 3 years ago

Hi,

Would it be possible to add a third SPARQL query on https://ordia.toolforge.org/language/ "Number of statements as a function of number of lexemes"?

If I didn't do mistake (to be checked), the query should be:

#defaultView:ScatterChart
SELECT
  (SAMPLE(?number_of_lexemes) AS ?number_of_lexemes)
  (SAMPLE(?number_of_stats) AS ?number_of_stats)
  ?language ?languageLabel 
WHERE {
  {
    SELECT ?language (COUNT(*) AS ?number_of_lexemes) WHERE {
      [] dct:language ?language .
    }
    GROUP BY ?language
  }
  UNION
  {
    SELECT ?language (SUM(?stats) AS ?number_of_stats) WHERE {
      [] wikibase:statements ?stats ; dct:language ?language .
    }
    GROUP BY ?language

  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?language ?languageLabel
HAVING (?number_of_stats > 1)

(not sure if it would be best to SUM and/or AVG, maybe both?)

fnielsen commented 2 years ago

I made a table instead. Perhaps it should have been a scatterplot. Both sum and average are there.