I was wondering how we can get the gender of Wikidata results. For example
SELECT ?s ?sLabel
WHERE
{
?s wdt:P31 wd:Q6256 ; rdfs:label ?sLabel .
FILTER (lang(?sLabel) = 'fr') .
} limit 10
I want to get not only the labels in French but also their gender, like this
Canada Masculin
Bangladesh Masculin
Norvège Feminin
Is there anyway to do this using Wikidata queries?
SELECT ?country_label ?language_code ?gender_label {
?s wdt:P31 wd:Q6256 ;
rdfs:label ?country_label .
FILTER (lang(?country_label) = ?language_code)
?lexeme ontolex:sense?/wdt:P5137 ?s ;
dct:language/wdt:P424 ?language_code .
OPTIONAL {
?lexeme wdt:P5185 ?gender .
?gender rdfs:label ?gender_label .
FILTER (lang(?gender_label) = ?language_code)
}
} VALUES (?language_code) {('de')}
More info: https://www.wikidata.org/wiki/Wikidata:Lexicographical_data