query-ac102494a13d0e1f2554ef5a7481cab1
Selects all people who died in 1948 and shows their occupation SELECT ?h ?date ?occupation ?occupationLabel WHERE { SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,nl". } ?h wdt:P31 wd:Q5. ?h wdt:P570 ?date. OPTIONAL { ?h wdt:P106 ?occupation. } FILTER(?date < "1949-01-01T00:00:00Z"^^xsd:dateTime) FILTER(?date > "1947-12-31T00:00:00Z"^^xsd:dateTime) } ORDER BY ?date
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 bd: <http://www.bigdata.com/rdf#>
#Selects all people who died in 1948 and shows their occupation
SELECT ?h ?date ?occupation ?occupationLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en,nl". }
?h wdt:P31 wd:Q5.
?h wdt:P570 ?date.
OPTIONAL { ?h wdt:P106 ?occupation. }
FILTER(?date < "1949-01-01T00:00:00Z"^^xsd:dateTime)
FILTER(?date > "1947-12-31T00:00:00Z"^^xsd:dateTime)
}
ORDER BY ?date
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?date"):::projected
v2("?h"):::projected
v3("?occupation"):::projected
c6(["#91;AUTO_LANGUAGE#93;,en,nl"]):::literal
c4(["bd:serviceParam"]):::iri
c8(["wd:Q5"]):::iri
f0[["?date > '1947-12-31T00:00:00Z^^xsd:dateTime'"]]
f0 --> v1
f1[["?date < '1949-01-01T00:00:00Z^^xsd:dateTime'"]]
f1 --> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c4 --"wikibase:language"--> c6
end
v2 --"wdt:P31"--> c8
v2 --"wdt:P570"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P106".-> v3
end