query-206169a6fff5676072e6ea59c2fa9c20
TODO
Use at
- https://query.wikidata.org/sparql
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?dob ?age
WHERE {
?item wdt:P106 wd:Q1930187;
p:P108/ps:P108 wd:Q9684;
p:P108 ?st.
OPTIONAL {
?item wdt:P569 ?dob.
BIND(xsd:integer((NOW() - ?dob) / 365.25) AS ?age)
}
MINUS { # Former employee
?st ps:P108 wd:Q9684;
pq:P582 [].
}
MINUS { ?item wdt:P570 ?dod. } # Living deprived
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
ORDER BY DESC(?dob)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?age"):::projected
v1("?dob"):::projected
v5("?dod")
v2("?item"):::projected
v3("?st")
a2((" "))
a1((" "))
c2(["wd:Q1930187"]):::iri
c5(["wd:Q9684"]):::iri
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"p:direct/P106"--> c2
v2 --"p:P108"--> a1
a1 --"p:statement/P108"--> c5
v2 --"p:P108"--> v3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P569".-> v1
bind0[/"http://www.w3.org/2001/XMLSchema#integer(NOW() - ?dob / '365.25^^xsd:decimal')"/]
v1 --o bind0
bind0 --as--o v4
end
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v3 --"p:statement/P108"--> c5
v3 --"p:qualifier/P582"--> a2
end
subgraph minus2["MINUS"]
style minus2 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P570"--> v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end