Last active
September 15, 2022 20:16
-
-
Save DavidMoraisFerreira/bad2febaa44e0339fbd141cbee51ada1 to your computer and use it in GitHub Desktop.
Retrieves a list of first names and gender for Luxembourgish citizens on Wikidata
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#For a list of family names, change SELECT and GROUP BY | |
PREFIX schema: <http://schema.org/> | |
PREFIX wd: <http://www.wikidata.org/entity/> | |
PREFIX wdt: <http://www.wikidata.org/prop/direct/> | |
SELECT ?givenNameLabel ?genderLabel #?familyNameLabel | |
WHERE | |
{ | |
?human wdt:P31 wd:Q5 ; | |
wdt:P27 wd:Q32 . | |
?human wdt:P735 ?givenName . | |
#?human wdt:P734 ?familyName FILTER (!wikibase:isSomeValue(?familyName)). | |
?human wdt:P21 ?gender . | |
OPTIONAL { | |
?human schema:isPartOf <https://lb.wikipedia.org/> . | |
} | |
FILTER NOT EXISTS { | |
?human wdt:P97 ?nobility #Excludes nobility from the result set | |
} | |
SERVICE wikibase:label { bd:serviceParam wikibase:language "lb,fr,de,en" } | |
} GROUP BY ?givenNameLabel ?genderLabel #?familyNameLabel |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment