query-2d85d10c8cb0386ad6266400d250eeaf
Propertiesinstance of (P31)occupation (P106)subclass of (P279)date of birth (P569)date of death (P570)country of citizenship (P27)
Use at
- https://query.wikidata.org/sparql
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#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?human ?humanLabel ?date_of_birth ?date_of_death (ROUND((?date_of_death - ?date_of_birth) / "365.2425"^^xsd:decimal) AS ?age) ?country_of_citizenship ?country_of_citizenshipLabel ?occupation ?occupationLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
?human wdt:P31 wd:Q5.
?human wdt:P106 ?occupation.
?occupation wdt:P279* wd:Q901.
?human wdt:P569 ?born.
OPTIONAL { ?human wdt:P569 ?date_of_birth. }
OPTIONAL { ?human wdt:P570 ?date_of_death. }
OPTIONAL { ?human wdt:P27 ?country_of_citizenship. }
FILTER((?born >= "1500-01-01T00:00:00Z"^^xsd:dateTime) && (?born <= "1700-01-01T00:00:00Z"^^xsd:dateTime))
OPTIONAL { ?human wdt:P106 ?occupation. }
}
LIMIT 100
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v7("?age")
v1("?born")
v6("?country_of_citizenship"):::projected
v4("?date_of_birth"):::projected
v5("?date_of_death"):::projected
v2("?human"):::projected
v3("?occupation"):::projected
c4(["bd:serviceParam"]):::iri
c11(["wd:Q901"]):::iri
c8(["wd:Q5"]):::iri
c6(["#91;AUTO_LANGUAGE#93;,en"]):::literal
f0[["?born >= '1500-01-01T00:00:00Z^^xsd:dateTime'?born <= '1700-01-01T00:00:00Z^^xsd:dateTime'"]]
f0 --> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end
v2 --"wdt:P31"--> c8
v2 --"wdt:P106"--> v3
v3 --"wdt:P279"--> c11
v2 --"wdt:P569"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P569".-> v4
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P570".-> v5
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P27".-> v6
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P106".-> v3
end
bind1[/"numeric-round(?date_of_death - ?date_of_birth / '365.2425^^xsd:decimal')"/]
v5 --o bind1
v4 --o bind1
bind1 --as--o v7