Wikidata:Synia:language-lexemeattestor-index

From Wikidata
Jump to navigation Jump to search

Synia: Lexeme attestors for language

[edit]

Lexeme attestors

[edit]
PREFIX target: <http://www.wikidata.org/entity/Q9035> 

SELECT 
  ?lexemes

  ?attestor ?attestorLabel
  (CONCAT("#lexemeattestor/", SUBSTR(STR(?attestor), 32)) AS ?attestorUrl)
  ?attestorDescription

  ?example_lexeme
  (SUBSTR(STR(?example_lexeme), 32) AS ?example_lexemeLabel)
  (CONCAT("#lexeme/", SUBSTR(STR(?example_lexeme), 32)) AS ?example_lexemeUrl)

WITH {
  SELECT 
    (COUNT(?lexeme) AS ?lexemes)
    ?attestor
    (SAMPLE(?lexeme) AS ?example_lexeme)
  WHERE {
    ?lexeme wdt:P5323 ?attestor ;
            dct:language target: .
  }
  GROUP BY ?attestor
} AS %attestors
WHERE{
  INCLUDE %attestors
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?lexemes)
Try it!

Most attested lexemes

[edit]
PREFIX target: <http://www.wikidata.org/entity/Q9035> 

SELECT 
  ?number_of_attestors

  ?lexeme ?lexemeLabel
  (CONCAT("#lexeme/", SUBSTR(STR(?lexeme), 32)) AS ?lexemeUrl)

  ?example_attestor ?example_attestorLabel
  (CONCAT("#lexemeattestor/", SUBSTR(STR(?example_attestor), 32)) AS ?example_attestorUrl)

WITH {
  SELECT 
    (COUNT(?attestor) AS ?number_of_attestors)
    ?lexeme
    (SAMPLE(?attestor) AS ?example_attestor)
  WHERE {
    ?lexeme wdt:P5323 ?attestor ;
            dct:language target: .
  }
  GROUP BY ?lexeme
} AS %result
WHERE{
  INCLUDE %result
  ?lexeme wikibase:lemma ?lexemeLabel .
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?number_of_attestors)
Try it!