Help
Difference between revisions of "SPARQL for lexemes"
(Moving former SPARQL to dedicated page.) |
m (Yug moved page Help:SPARQL (lexeme) to Help:SPARQL for lexemes) |
Revision as of 15:08, 26 February 2024
Lexemes
Notable elements
- Table of notable wikidata properties to create.
Part of speech
To run on WDQS.[1]
#defaultEndpoint:Wikidata
SELECT ?item ?itemLabel
WHERE {
?item wdt:P31 wd:Q82042 # Q82042 'part of speech'
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
# GROUP BY ?item
ORDER BY ASC(?itemLabel)
|
|
✅ Language (d:Q12107) → List of Wikidata lexemes for Breton
To run on WDQS.[1] Source: User:VIGNERON/common.js.
#defaultEndpoint:Wikidata
SELECT DISTINCT ?lexemeLabel ?lexeme
WITH {
SELECT ?lexeme ?lexemeLabel ?lexical_category WHERE {
?lexeme a ontolex:LexicalEntry ;
dct:language wd:Q12107 ;
wikibase:lemma ?lexemeLabel .
OPTIONAL {
?lexeme wikibase:lexicalCategory ?lexical_category .
}
}
} AS %results
WHERE {
INCLUDE %results
OPTIONAL {
?lexical_category rdfs:label ?lexical_categoryLabel .
FILTER (LANG(?lexical_categoryLabel) = "en")
}
}
|
||
#defaultEndpoint:Wikidata
SELECT ?lexeme ?lemma
WHERE {
?lexeme dct:language wd:Q12107;
wikibase:lemma ?lemma.
}
|
✅ Language () → List of wd lexemes with LL audio
To run on WDQS.[1]
#defaultEndpoint:Wikidata
SELECT * WHERE {
?l ontolex:lexicalForm ?x .
?x wdt:P443 ?value .
FILTER regex (str(?value), "^http://commons.wikimedia.org/wiki/Special:FilePath/LL-").
}
|
|
✅ Language () → List of wd lexemes with (LL audio and) wd translation (d:Q150)
✅ Concept (Q3142) → All lexeme whom sense is this concept
To run on WDQS.[1]
#defaultEndpoint:Wikidata
#title: Lexemes with senses linked to the item about the colour "red" (Q314
SELECT ?wikidataLexeme ?languageLabel ?lemma ?sense WHERE {
?wikidataLexeme dct:language ?language ;
wikibase:lemma ?lemma ;
ontolex:sense ?sense.
?language rdfs:label ?languageLabel .
Filter(lang(?languageLabel)="en").
?sense wdt:P5137 wd:Q3142 . # Filter : P5137 'item for this sense' is Q3142 'red'
}
|
|
✅ Given language (d:Q5146) → List existing parts of speech
To run on WDQS.[1]
#defaultEndpoint:Wikidata
SELECT ?pos ?posLabel (COUNT(?wikidataLexeme) AS ?quantity)
WHERE {
?wikidataLexeme dct:language wd:Q5146 ; # Portugese
wikibase:lexicalCategory ?pos . # Parts of speech
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?pos ?posLabel
ORDER BY DESC(?quantity)
|
|
✅ Given language (d:Q9192) → List wikidata lexemes
To run on WDQS.[1]
#defaultEndpoint:Wikidata
SELECT ?wikidataLexeme ?posLabel (GROUP_CONCAT(?lemma;separator=" / ") as ?lemmas )
WHERE {
?wikidataLexeme dct:language wd:Q9192 ; # Chinese
wikibase:lemma ?lemma ; # Words
wikibase:lexicalCategory ?pos . # Part of speech
?pos rdfs:label ?posLabel .
Filter(lang(?posLabel)="en").
}
GROUP BY ?wikidataLexeme ?posLabel
|
|