Help
Difference between revisions of "SPARQL"
(→Speaker name → Speaker Qid: done) |
|||
Line 56: | Line 56: | ||
|} | |} | ||
== Speaker name → Speaker Qid == | == Speaker name → Speaker Qid == | ||
+ | |||
+ | {| | ||
+ | |- style="vertical-align:top;" | ||
+ | |style="padding: 0 3em;width:60%"| | ||
+ | <syntaxhighlight lang="sparql"> | ||
+ | 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 . | ||
+ | } | ||
+ | </syntaxhighlight> | ||
+ | || | ||
+ | |||
+ | <query _pagination="5"> | ||
+ | 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 . | ||
+ | } | ||
+ | </query> | ||
+ | |} | ||
+ | |||
== Speaker Qid ([[Q42]]) → Speaker data == | == Speaker Qid ([[Q42]]) → Speaker data == | ||
{| | {| |
Revision as of 17:42, 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
|