query-4b831023b34fcb7fdb4af7a7c87760f2

rq turtle/ttl

Propertiesoccupation (P106)country of citizenship (P27)date of birth (P569)date of death (P570)VIAF ID (P214)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?person ?personLabel (URI(CONCAT("http://viaf.org/viaf/",?viaf)) AS ?viaf_id) ?birthyear ?deathyear WHERE {
?person wdt:P106 wd:Q49757;
        wdt:P27 wd:Q161885;
        wdt:P569 ?birthdate;
        wdt:P570 ?deathdate.
FILTER (!isBLANK(?birthdate))
FILTER (!isBLANK(?deathdate))
OPTIONAL{ ?person wdt:P214 ?viaf}
BIND(YEAR(?birthdate) AS ?birthyear)
BIND(YEAR(?deathdate) AS ?deathyear)
SERVICE wikibase:label {bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en,de,fr,ru"}
} ORDER BY ?birthyear

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?birthdate") v6("?birthyear"):::projected v2("?deathdate") v6("?deathyear"):::projected v4("?person"):::projected v5("?viaf"):::projected v7("?viaf_id") c9(["bd:serviceParam"]):::iri c11(["#91;AUTO_LANGUAGE#93;,mul,en,de,fr,ru"]):::literal c4(["wd:Q161885"]):::iri c2(["wd:Q49757"]):::iri f0[["not isBlank(?deathdate)"]] f0 --> v2 f1[["not isBlank(?birthdate)"]] f1 --> v3 v4 --"wdt:P106"--> c2 v4 --"wdt:P27"--> c4 v4 --"wdt:P569"--> v3 v4 --"wdt:P570"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P214".-> v5 end bind2[/"year-from-dateTime(?birthdate)"/] v3 --o bind2 bind2 --as--o v6 bind3[/"year-from-dateTime(?deathdate)"/] v2 --o bind3 bind3 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind4[/"concat('http://viaf.org/viaf/',?viaf)"/] v5 --o bind4 bind4 --as--o v7