Skip to content

Instantly share code, notes, and snippets.

@jswright61
Created January 4, 2025 16:42
Show Gist options
  • Select an option

  • Save jswright61/323da3d03bc38f2d83f7e2718b7d326e to your computer and use it in GitHub Desktop.

Select an option

Save jswright61/323da3d03bc38f2d83f7e2718b7d326e to your computer and use it in GitHub Desktop.
SparQL Query
SELECT DISTINCT
?id
?idLabel
(SAMPLE(?birth) as ?birth_date)
(SAMPLE(?death_date) as ?dateOfDeath)
(SAMPLE(?manner_of_death) as ?mannerOfDeath)
(SAMPLE(?cause_of_death) as ?causeOfDeath)
WHERE {
?id wdt:P31 wd:Q5.
?id wdt:P569 ?birth .
OPTIONAL{
?id wdt:P570 ?death_date .
?id wdt:P1196 ?manner_of_death .
?id wdt:P509 ?cause_of_death .
}
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en".
?id rdfs:label ?idLabel .
}
?id ?label "Bill Clinton"@en.
}
GROUP BY ?id ?idLabel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment