Wikidata:Synia:lexicalcategory-language

From Wikidata
Jump to navigation Jump to search

Synia: Lexical category and language

[edit]

Lexemes

[edit]
PREFIX target1: <http://www.wikidata.org/entity/Q24905>
PREFIX target2: <http://www.wikidata.org/entity/Q9035>

# List lexemes wrt. a lexical category and language
SELECT
  ?lexeme ?lexemeLabel
  (CONCAT("#lexeme/", SUBSTR(STR(?lexeme), 32)) AS ?lexemeUrl)

  ?length
  ?number_of_compounds
WHERE {
  {
    SELECT 
      ?lexeme
      (COUNT(?compound) AS ?number_of_compounds)
    {
      ?lexeme wikibase:lexicalCategory target1: ;
              dct:language target2: .
      OPTIONAL { ?compound wdt:P5238 ?lexeme }
    }
    GROUP BY ?lexeme
  }
  ?lexeme wikibase:lemma ?lexemeLabel
  BIND(STRLEN(?lexemeLabel) AS ?length)
}
ORDER BY ?lexemeLabel ?length ?number_of_compounds
LIMIT 10000
Try it!

Lexeme descriptors

[edit]
PREFIX target1: <http://www.wikidata.org/entity/Q24905>
PREFIX target2: <http://www.wikidata.org/entity/Q9035>

# List lexemes wrt. a lexical category and language
SELECT
  ?number_of_lexemes

  ?descriptor ?descriptorLabel
  (CONCAT("#lexemedescriptor/", SUBSTR(STR(?descriptor), 32)) AS ?descriptorUrl)
  ?descriptorDescription
WITH {      
  SELECT 
    ?descriptor
    (COUNT(?lexeme) AS ?number_of_lexemes)
  WHERE {
    ?lexeme wikibase:lexicalCategory target1: ;
            dct:language target2: ;
            wdt:P1343 ?descriptor .
  }
  GROUP BY ?descriptor
} AS %result
WHERE {
  INCLUDE %result
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?number_of_lexemes)
LIMIT 10000
Try it!