query-0fa781ae953e642ce8859c422b1e1392
With images
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
#defaultView:ImageGrid
SELECT DISTINCT ?image ?name (CONCAT("Born ",str(?born), "; Died ", str(?died)) as ?dates) ?birthplace ?article WHERE {
?person wdt:P19 ?place ; # place of birth
wdt:P607 wd:Q361 ; # involved in World War I
wdt:P18 ?image ; #image
wdt:P569 ?dob #date of birth
{?place wdt:P131* wd:Q48015 } UNION { ?place wdt:P131* ?county. ?county wdt:P47 wd:Q23169 } # born in SE England or adjacent county to Oxfordshire
OPTIONAL { ?person wdt:P570 ?dod } #date of death
BIND(YEAR(?dob) as ?born)
BIND(YEAR(?dod) as ?died)
?person rdfs:label ?name filter (lang(?name) = "en")
?place rdfs:label ?birthplace filter (lang(?birthplace) = "en")
OPTIONAL{ ?article schema:about ?person; schema:isPartOf <https://en.wikipedia.org/> }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v11("?article"):::projected
v1("?birthplace"):::projected
v9("?born"):::projected
v7("?county")
v12("?dates")
v10("?died"):::projected
v6("?dob")
v8("?dod")
v5("?image"):::projected
v2("?name"):::projected
v3("?person")
v4("?place")
c8(["wd:Q48015"]):::iri
c10(["wd:Q23169"]):::iri
c15([https://en.wikipedia.org/]):::iri
c4(["wd:Q361"]):::iri
f0[["?birthplace = 'en'"]]
f0 --> v1
f1[["?name = 'en'"]]
f1 --> v2
v3 --"wdt:P19"--> v4
v3 --"wdt:P607"--> c4
v3 --"wdt:P18"--> v5
v3 --"wdt:P569"--> v6
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v4 --"wdt:P131"--> v7
v7 --"wdt:P47"--> c10
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v4 --"wdt:P131"--> c8
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P570".-> v8
end
bind2[/"year-from-dateTime(?dob)"/]
v6 --o bind2
bind2 --as--o v9
bind3[/"year-from-dateTime(?dod)"/]
v8 --o bind3
bind3 --as--o v10
v3 --"rdfs:label"--> v2
v4 --"rdfs:label"--> v1
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v11 -."schema:about".-> v3
v11 --"schema:isPartOf"--> c15
end
bind4[/"concat('Born ',str(?born),'; Died ',str(?died))"/]
v9 --o bind4
v10 --o bind4
bind4 --as--o v12