query-9fbcf43709a6000652f806ab90bfa06f
Daehan
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?date_of_birth ?date_of_death
WHERE
{
VALUES ?occupation { wd:Q15296811 wd:Q329439 wd: wd:Q11569986 }
?item wdt:P31 wd:Q5 . # ?item is human
?item wdt:P106/wdt:P279* ?occupation . # item's occupation is draughtsman or engraver
{
?item wdt:P734 wd:Q1158605 . # item's family name is Walker
}
# UNION
# {
# ?item rdfs:label ?label .
# FILTER CONTAINS(?label, "Walker")
# }
BIND(IF(IsLiteral(?dod), ?dod, "Somevalue") AS ?date_of_death)
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
OPTIONAL { ?item wdt:P569 ?dob . BIND(IF(IsLiteral(?dob), ?dob, "Somevalue") AS ?date_of_birth) }
OPTIONAL { ?item wdt:P570 ?dod . BIND(IF(IsLiteral(?dod), ?dod, "Somevalue") AS ?date_of_death) }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?date_of_birth"):::projected
v7("?date_of_death"):::projected
v4("?dob")
v6("?dod")
v2("?item"):::projected
v1("?occupation")
a1((" "))
c8(["bd:serviceParam"]):::iri
c6(["wd:Q1158605"]):::iri
c2(["wd:Q5"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?occupation/]
bind0-->v1
bind00(["wd:Q15296811"])
bind00 --> bind0
bind01(["wd:Q329439"])
bind01 --> bind0
bind02(["wd:"])
bind02 --> bind0
bind03(["wd:Q11569986"])
bind03 --> bind0
v2 --"wdt:P31"--> c2
v2 --"wdt:P106"--> a1
a1 --"wdt:P279"--> v1
v2 --"wdt:P734"--> c6
bind1[/"if(isLiteral(?dod),?dod,'Somevalue')"/]
v6 --o bind1
bind1 --as--o v7
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P569".-> v4
bind2[/"if(isLiteral(?dob),?dob,'Somevalue')"/]
v4 --o bind2
bind2 --as--o v5
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P570".-> v6
bind3[/"if(isLiteral(?dod),?dod,'Somevalue')"/]
v6 --o bind3
bind3 --as--o v7
end