query-e0da7a9e3c2c035b20b73d61edf9c248
Lexemes
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX dct: <http://purl.org/dc/terms/>
PREFIX target1: <http://www.wikidata.org/entity/Q9027>
PREFIX target2: <http://www.wikidata.org/entity/Q4833830>
# 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 target2: ;
dct:language target1: .
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
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?compound")
v6("?length"):::projected
v4("?lexeme"):::projected
v1("?lexemeLabel"):::projected
v6("?lexemeUrl")
v6("?number_of_compounds"):::projected
c4([http://www.wikidata.org/entity/Q9027]):::iri
c2([http://www.wikidata.org/entity/Q4833830]):::iri
v4 --"wikibase:lexicalCategory"--> c2
v4 --"dct:language"--> c4
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."wdt:P5238".-> v4
end
bind1[/"count(?compound)"/]
v5 --o bind1
bind1 --as--o v6
v4 --"wikibase:lemma"--> v1
bind2[/"string-length(?lexemeLabel)"/]
v1 --o bind2
bind2 --as--o v6
bind3[/"concat('#lexeme/',substring(str(?lexeme),'32^^xsd:integer'))"/]
v4 --o bind3
bind3 --as--o v6