Help
Difference between revisions of "SPARQL"
Line 6: | Line 6: | ||
* [[DataViz:Records]] | * [[DataViz:Records]] | ||
− | == ✅ Is Sex or Gender(Q7) → list all possible values == | + | == ✅ Is Sex or Gender([[Q7]]) → list all possible values == |
{| | {| | ||
|- style="vertical-align:top;" | |- style="vertical-align:top;" | ||
Line 31: | Line 31: | ||
|} | |} | ||
− | == ✅ Is Speaker (Q3) → list all speakers == | + | == ✅ Is Speaker ([[Q3]]) → list all speakers == |
{| | {| | ||
|- style="vertical-align:top;" | |- style="vertical-align:top;" | ||
|style="padding: 0 3em;width:60%"| | |style="padding: 0 3em;width:60%"| | ||
<syntaxhighlight lang="sparql"> | <syntaxhighlight lang="sparql"> | ||
− | select ? | + | select ?speaker ?speakerLabel |
where { | where { | ||
− | ? | + | ?speaker prop:P2 entity:Q3 . |
SERVICE wikibase:label { | SERVICE wikibase:label { | ||
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . | bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . | ||
Line 45: | Line 45: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
|| | || | ||
− | <query _pagination="5" | + | <query _pagination="5" speaker="Item" speakerLabel="Speaker" langLabel="Language"> |
− | select ? | + | select ?speaker ?speakerLabel |
where { | where { | ||
− | ? | + | ?speaker prop:P2 entity:Q3 . |
SERVICE wikibase:label { | SERVICE wikibase:label { | ||
bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . | bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . | ||
Line 56: | Line 56: | ||
|} | |} | ||
== Speaker name → Speaker Qid == | == Speaker name → Speaker Qid == | ||
− | == Speaker Qid → Speaker data == | + | == Speaker Qid ([[Q42]]) → Speaker data == |
+ | {| | ||
+ | |- style="vertical-align:top;" | ||
+ | |style="padding: 0 3em;width:60%"| | ||
+ | <syntaxhighlight lang="sparql"> | ||
+ | </syntaxhighlight> | ||
+ | || | ||
+ | <query _pagination="5" speaker="Item" speakerLabel="Speaker" langLabel="Language"> | ||
+ | SELECT ?speaker ?speakerLabel | ||
+ | WHERE { | ||
+ | entity:Q42 * ?speaker. | ||
+ | SERVICE wikibase:label { | ||
+ | bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . | ||
+ | } | ||
+ | } | ||
+ | </query> | ||
+ | |} | ||
+ | <!-- | ||
== Speaker Qid → Speaker data → speaker languages == | == Speaker Qid → Speaker data → speaker languages == | ||
== Speaker Qid + language → list of audios in target language == | == Speaker Qid + language → list of audios in target language == | ||
Line 69: | Line 86: | ||
== 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 23:33, 4 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
Speaker Qid (0x010C (Q42)) → Speaker data
|