User
Difference between revisions of "Yug/Gallery"
< User:Yug
(Created page with "=== ✅ Speakers → missing gender value === :''This query returns speakers who have missing gender value. See also Help:SPARQL#Is_Sex_or_Gender_.28Q7.29_.E2.86.92_List_exi...") |
|||
Line 39: | Line 39: | ||
|style="padding: 0 3em;width:60%"| | |style="padding: 0 3em;width:60%"| | ||
<syntaxhighlight lang="sparql"> | <syntaxhighlight lang="sparql"> | ||
− | SELECT ?language ?speaker ?speakerLabel | + | SELECT ?language ?speaker ?speakerLabel ?genderLabel (COUNT(?audio) AS ?audio) |
WHERE { | WHERE { | ||
VALUES ?language { entity:Q150 } | VALUES ?language { entity:Q150 } | ||
?speaker prop:P2 entity:Q3 . # P2 'instance of' is Q3 'speaker' | ?speaker prop:P2 entity:Q3 . # P2 'instance of' is Q3 'speaker' | ||
− | ?speaker prop:P4 ?language . # P4 'language' | + | ?speaker prop:P4 ?language . # P4 'language' |
− | # | + | ?speaker prop:P8 ?gender . # P8 'language' |
− | SERVICE wikibase:label { | + | # Audios |
− | + | ?audio prop:P5 ?speaker . # Filter: P5 'speaker' | |
− | + | ?audio prop:P4 ?language . # Filter: P4 'language' | |
+ | # Add labels | ||
+ | SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"} | ||
} | } | ||
+ | GROUP BY ?language ?speaker ?speakerLabel ?genderLabel | ||
+ | ORDER BY DESC (?audio) | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| | | | ||
<query _pagination="6" item="Property" itemLabel="Values"> | <query _pagination="6" item="Property" itemLabel="Values"> | ||
− | SELECT ?language ?speaker ?speakerLabel | + | SELECT ?language ?speaker ?speakerLabel ?genderLabel (COUNT(?audio) AS ?audio) |
WHERE { | WHERE { | ||
VALUES ?language { entity:Q150 } | VALUES ?language { entity:Q150 } | ||
?speaker prop:P2 entity:Q3 . # P2 'instance of' is Q3 'speaker' | ?speaker prop:P2 entity:Q3 . # P2 'instance of' is Q3 'speaker' | ||
− | ?speaker prop:P4 ?language . # P4 'language' | + | ?speaker prop:P4 ?language . # P4 'language' |
− | # | + | ?speaker prop:P8 ?gender . # P8 'language' |
− | SERVICE wikibase:label { | + | # Audios |
− | + | ?audio prop:P5 ?speaker . # Filter: P5 'speaker' | |
− | + | ?audio prop:P4 ?language . # Filter: P4 'language' | |
− | + | # Add labels | |
+ | SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"} | ||
+ | } | ||
+ | GROUP BY ?language ?speaker ?speakerLabel ?genderLabel | ||
+ | ORDER BY DESC (?audio) | ||
+ | </query> | ||
|} | |} |
Revision as of 12:21, 10 August 2022
✅ Speakers → missing gender value
- This query returns speakers who have missing gender value. See also list of genders.
SELECT ?speaker ?speakerLabel ?gender ?language ?languageLabel (COUNT(?audio) AS ?audio)
WHERE {
?speaker prop:P2 entity:Q3 .
FILTER NOT EXISTS { ?speaker prop:P8 ?gender }
?audio prop:P5 ?speaker . # Filter: P5 'speaker' is Q445757 'SangeetaRH'
?audio prop:P4 ?language . # Filter: P4 'language' is Q34 'Marathi'
# Add labels
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}
}
GROUP BY ?speaker ?speakerLabel ?genderLabel ?language ?languageLabel # Sorting first groups per language and speaker
ORDER BY DESC (?audio)
|
|
Language LL Qid (Q209) → List speakers
This query is going to be DEPRECATED as the queried data will no longer be available.
SELECT ?language ?speaker ?speakerLabel ?genderLabel (COUNT(?audio) AS ?audio)
WHERE {
VALUES ?language { entity:Q150 }
?speaker prop:P2 entity:Q3 . # P2 'instance of' is Q3 'speaker'
?speaker prop:P4 ?language . # P4 'language'
?speaker prop:P8 ?gender . # P8 'language'
# Audios
?audio prop:P5 ?speaker . # Filter: P5 'speaker'
?audio prop:P4 ?language . # Filter: P4 'language'
# Add labels
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en"}
}
GROUP BY ?language ?speaker ?speakerLabel ?genderLabel
ORDER BY DESC (?audio)
|
|