fnielsen / ordia

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

property-value subaspect with count for languages #55

Closed fnielsen closed 4 years ago

fnielsen commented 5 years ago
SELECT
  ?count
  ?language ?languageLabel
  ?example_lexeme ?example_lexemeLabel
WITH {
  SELECT 
    (COUNT(?lexeme) AS ?count)
    ?language
    (SAMPLE(?lexeme) AS ?example_lexeme)
  {
    ?lexeme wdt:P31 wd:Q1520033 ;
            dct:language ?language
  }
  GROUP BY ?language
} AS %counts
WHERE {
  INCLUDE %counts

  ?example_lexeme wikibase:lemma ?example_lexemeLabel .
  ?language rdfs:label ?languageLabel .
  FILTER (LANG(?languageLabel) = 'en')
}
ORDER BY DESC(?count)
fnielsen commented 4 years ago

Now running, e.g., https://tools.wmflabs.org/ordia/property/P31/value/Q376431