query-66169441e70becae5dfc1a61007ed695

rq turtle/ttl

19:05, 4 March 2017 (UTC)) talk (Mrutyunjaya Kar: replace p279 with p106 --Shyamal@06:33, 6 March 2017 (UTC)) talk (Shyamal who should be a scientist as well but perhaps we need to use subclass or has "ornithologist" not been defined as a kindof scientist? Q62357THanks a lot. I tried your other query as well but it does not pick up Scientists who were born or died in Berlin but evidently that is not the solution. this and this: Why does this pick "Theologians"? I went up the occupation tree and removed a couple of what appeared to be problematic classifications - Ijon@

Use at

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 DISTINCT ?item ?itemLabel ?itemDescription ?dob ?dod 
WHERE{
  ?item wdt:P106/wdt:P279*  wd:Q901 .       # scientist/subclass of scientist 
    { ?item wdt:P19 wd:Q64 }            # place of birth = Berlin (Q64)
        UNION   { ?item wdt:P20 wd:Q64 }    # place of death = Berlin (Q64)
    OPTIONAL { ?item wdt:P569 ?dob  }
    OPTIONAL { ?item wdt:P570 ?dod  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en" }
}
ORDER BY ?dob

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?dob"):::projected v3("?dod"):::projected v2("?item"):::projected a1((" ")) c10(["bd:serviceParam"]):::iri c3(["wd:Q901"]):::iri c5(["wd:Q64"]):::iri c12(["en"]):::literal v2 --"wdt:P106"--> a1 a1 --"wdt:P279"--> c3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P20"--> c5 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P19"--> c5 end union0r <== or ==> union0l end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P569".-> v1 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P570".-> v3 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end