Skip to content

Instantly share code, notes, and snippets.

@pbd84
Last active September 26, 2024 08:08
Show Gist options
  • Save pbd84/9ed44661c2cb82e52cb53458aa724525 to your computer and use it in GitHub Desktop.
Save pbd84/9ed44661c2cb82e52cb53458aa724525 to your computer and use it in GitHub Desktop.
Wikidata SPARQL query for (human) philosophers with de, en, fr, it labels; birth and death dates; authority file IDs for VIAF and GND
SELECT DISTINCT ?item ?gnd_id ?viaf_id ?label_en ?label_de ?label_fr ?label_it (year(?birth_date) as ?birth_year) (year(?death_date) as ?death_year)
WHERE
{
?item wdt:P106 wd:Q4964182 ; wdt:P31 wd:Q5.
OPTIONAL {?item wdt:P227 ?gnd_id.}
OPTIONAL {?item wdt:P214 ?viaf_id.}
OPTIONAL {?item wdt:P569 ?birth_date.}
OPTIONAL {?item wdt:P570 ?death_date.}
OPTIONAL {?item rdfs:label ?label_en filter (lang(?label_en) = "en").}
OPTIONAL {?item rdfs:label ?label_de filter (lang(?label_de) = "de").}
OPTIONAL {?item rdfs:label ?label_fr filter (lang(?label_fr) = "fr").}
OPTIONAL {?item rdfs:label ?label_it filter (lang(?label_it) = "it").}
}
@pbd84
Copy link
Author

pbd84 commented Sep 26, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment