Help
Difference between revisions of "SPARQL"
(→Speaker name → Speaker Qid: done) |
|||
Line 85: | Line 85: | ||
|style="padding: 0 3em;width:60%"| | |style="padding: 0 3em;width:60%"| | ||
<syntaxhighlight lang="sparql"> | <syntaxhighlight lang="sparql"> | ||
+ | SELECT ?predicate ?object | ||
+ | WHERE { | ||
+ | entity:Q42 ?predicate ?object . | ||
+ | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|| | || | ||
− | <query _pagination=" | + | <query _pagination="10" > |
− | SELECT ? | + | SELECT ?predicate ?object |
WHERE { | WHERE { | ||
− | entity:Q42 | + | entity:Q42 ?predicate ?object . |
− | |||
− | |||
− | |||
} | } | ||
</query> | </query> | ||
|} | |} | ||
− | + | ||
== Speaker Qid → Speaker data → speaker languages == | == Speaker Qid → Speaker data → speaker languages == | ||
+ | |||
+ | {| | ||
+ | |- style="vertical-align:top;" | ||
+ | |style="padding: 0 3em;width:60%"| | ||
+ | <syntaxhighlight lang="sparql"> | ||
+ | SELECT ?languages | ||
+ | WHERE { | ||
+ | entity:Q42 prop:P4 ?languages . | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | || | ||
+ | <query _pagination="5" > | ||
+ | SELECT ?predicate ?object | ||
+ | SELECT ?languages | ||
+ | WHERE { | ||
+ | entity:Q42 prop:P4 ?languages . | ||
+ | } | ||
+ | </query> | ||
+ | |} | ||
+ | |||
== Speaker Qid + language → list of all associated audios == | == Speaker Qid + language → list of all associated audios == | ||
== Is Language ([[Q3]]) → list all languages with number of unique words and speakers == | == Is Language ([[Q3]]) → list all languages with number of unique words and speakers == | ||
Line 111: | Line 132: | ||
== Tools == | == Tools == | ||
* [[Special:ApisSandbox]] – API queries generator for Lingualibre wikipage and wikibase contents. | * [[Special:ApisSandbox]] – API queries generator for Lingualibre wikipage and wikibase contents. | ||
− |
Revision as of 17:48, 5 December 2021
Base
- Special:ListProperties
- List of properties with possible values. Ex: Gender (P8) : male (male (Q16)), female (female (Q17)), intersex (intersex (Q18)).
- LinguaLibre:List of languages
- DataViz:Speakers
- DataViz:Records
✅ Is Sex or Gender(sex or gender (Q7)) → list all possible values
SELECT ?item ?itemLabel
WHERE {
?item prop:P2/prop:P9 * entity:Q7
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
}
}
|
|
✅ Is Speaker (speaker (Q3)) → list all speakers
select ?speaker ?speakerLabel
where {
?speaker prop:P2 entity:Q3 .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" .
}
}
|
|
Speaker name → Speaker Qid
select ?speakerName ?speakerId
where {
VALUES ?speakerName { "Yug" "VIGNERON" } #One or multiple values are acceptable here
BIND ( STRLANG(?speakerName, "en") AS ?speakerLabel )
?speakerId prop:P2 entity:Q3 ; rdfs:label ?speakerLabel .
}
|
|
Speaker Qid (0x010C (Q42)) → Speaker data
SELECT ?predicate ?object
WHERE {
entity:Q42 ?predicate ?object .
}
|
|
Speaker Qid → Speaker data → speaker languages
SELECT ?languages
WHERE {
entity:Q42 prop:P4 ?languages .
}
|
|
Speaker Qid + language → list of all associated audios
Is Language (speaker (Q3)) → list all languages with number of unique words and speakers
Isolang → Language LL Qid
Isolang → Language WD Qid
Language WD Qid → Language data
Language LL Qid → Language data
Langue + speaker + word → Audio's Qid
Audio Qid → Audio data
✅ Langue + speaker + word → Audio's Commons url
Tools
- Special:ApisSandbox – API queries generator for Lingualibre wikipage and wikibase contents.