Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DavidMoraisFerreira/d2f5f07ad56bbaa18b7fa03fe5323223 to your computer and use it in GitHub Desktop.
Save DavidMoraisFerreira/d2f5f07ad56bbaa18b7fa03fe5323223 to your computer and use it in GitHub Desktop.
Find Luxembourgish citizens on Wikidata without a family name
PREFIX schema: <http://schema.org/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
SELECT DISTINCT ?human ?humanLabel (group_concat(?givennameLabel;separator=', ') as ?givenNames)
WHERE
{
?human wdt:P31 wd:Q5 ;
wdt:P27 wd:Q32 .
?human wdt:P735 ?givenname .
FILTER NOT EXISTS {
?human wdt:P734 ?familyName
}
FILTER NOT EXISTS {
?human wdt:P97 ?nobility #Excludes nobility from the result set
}
OPTIONAL {
?human schema:isPartOf <https://lb.wikipedia.org/> .
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "lb,fr,de,en".
?human rdfs:label ?humanLabel.
?givenname rdfs:label ?givennameLabel.
}
}
GROUP BY ?human ?humanLabel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment