query-6c4f85c8cb9eccd56e4136f308f3b46f
TODO
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#>
SELECT ?q ?qLabel ?dod ?dob
WHERE {
?q wdt:P106 wd:Q36180 ; wdt:P31 wd:Q5 . #writer
OPTIONAL { ?q wdt:P570 ?dod . FILTER ( year(?dod) < 1948 ) } #death before 1948
OPTIONAL { ?q wdt:P569 ?dob . FILTER (year(?dob) < 1840) } #birth before 1840
{ ?q wdt:P103/wdt:P279* wd:Q7850 } UNION { ?q wdt:P1412/wdt:P279* wd:Q7850 }
SERVICE wikibase:label { bd:serviceParam wikibase:language "zh,[AUTO_LANGUAGE],en" }
}
ORDER BY DESC(?dod)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?dob"):::projected
v1("?dod"):::projected
v3("?q"):::projected
a1((" "))
a2((" "))
c16(["zh,#91;AUTO_LANGUAGE#93;,en"]):::literal
c4(["wd:Q36180"]):::iri
c11(["wd:Q7850"]):::iri
c14(["bd:serviceParam"]):::iri
c6(["wd:Q5"]):::iri
v3 --"wdt:P106"--> c4
v3 --"wdt:P31"--> c6
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P570".-> v1
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v3 -."wdt:P569".-> v2
end
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P1412"--> a2
a2 --"wdt:P279"--> c11
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v3 --"wdt:P103"--> a1
a1 --"wdt:P279"--> c11
end
union0r <== or ==> union0l
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c14 --"wikibase:language"--> c16
end