query-4762bdfe88fe21247b4a8f27d837cff8

rq turtle/ttl

Number of forms per language SELECT (SAMPLE(?number_of_forms) / SAMPLE(?number_of_lexemes) AS ?form_to_lexeme_ratio) (SAMPLE(?number_of_lexemes) AS ?number_of_lexemes) (SAMPLE(?number_of_forms) AS ?number_of_forms) ?language ?languageLabel WHERE { { SELECT ?language (COUNT() AS ?number_of_lexemes) WHERE { [] dct:language ?language . } GROUP BY ?language } UNION { SELECT ?language (COUNT() AS ?number_of_forms) WHERE { [] ^ontolex:lexicalForm / dct:language ?language . } GROUP BY ?language

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

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX ontolex: <http://www.w3.org/ns/lemon/ontolex#>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Number of forms per language
SELECT
  (SAMPLE(?number_of_forms) / SAMPLE(?number_of_lexemes) AS ?form_to_lexeme_ratio)
  (SAMPLE(?number_of_lexemes) AS ?number_of_lexemes)
  (SAMPLE(?number_of_forms) AS ?number_of_forms)
  ?language ?languageLabel 
WHERE {
  {
    SELECT ?language (COUNT(*) AS ?number_of_lexemes) WHERE {
      [] dct:language ?language .
    }
    GROUP BY ?language
  }
  UNION
  {
    SELECT ?language (COUNT(*) AS ?number_of_forms) WHERE {
      [] ^ontolex:lexicalForm / dct:language ?language .
    }
    GROUP BY ?language

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

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?form_to_lexeme_ratio") v3("?language"):::projected v5("?number_of_forms"):::projected v5("?number_of_lexemes"):::projected a1((" ")) a3((" ")) a2((" ")) c5(["bd:serviceParam"]):::iri c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?number_of_forms > '1^^xsd:integer'"]] f0 --> v5 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; a2 --"ontolex:lexicalForm"--> a3 a2 --"dct:language"--> v3 bind2[/"count(*)"/] bind2 --as--o v5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; a1 --"dct:language"--> v3 bind4[/"count(*)"/] bind4 --as--o v5 end union0r <== or ==> union0l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end bind9[/" / "/] null --o bind9 null --o bind9 bind9 --as--o v5 bind10[/"sample(?number_of_lexemes)"/] v5 --o bind10 bind10 --as--o v5 bind11[/"sample(?number_of_forms)"/] v5 --o bind11 bind11 --as--o v5