Help
Difference between revisions of "SPARQL (intermediate)"
Help:SPARQL 2 will explore federated queries fetching data from both LinguaguaLibre and Wikidata's endpoints, then Wikidata Lexemes, an emerging source of lexicographic data. The duo can be a solid combo to provide lexicographic and multimedia (audio recordings and images) for either Wikimedia modules or web developers.
Line 15: | Line 15: | ||
=== ✅ Language () → List of wd lexemes with LL audio === | === ✅ Language () → List of wd lexemes with LL audio === | ||
=== ✅ Language () → List of wd lexemes with LL audio and wd translation ([[:d:Q150]]) === | === ✅ Language () → List of wd lexemes with LL audio and wd translation ([[:d:Q150]]) === | ||
+ | |||
+ | === ✅ Language () → List of wd lexemes ([[:d:Q150]]) === | ||
+ | :''Strange query from [[User:VIGNERON/common.js]]'' | ||
+ | <pre> | ||
+ | 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") | ||
+ | } | ||
+ | } | ||
+ | </pre> |
Revision as of 18:24, 21 December 2021
Tools
- Lexemes Queries Generator
Languages
✅ Language () → List of LL languages with wd speaker population
Lexemes
✅ Language (d:Q12107) → List of wd lexemes
Example : Q12107 breton.
✅ Language () → List of wd lexemes with LL audio
✅ Language () → List of wd lexemes with LL audio and wd translation (d:Q150)
✅ Language () → List of wd lexemes (d:Q150)
- Strange query from User:VIGNERON/common.js
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") } }