query-1ca7853f36858171a7cc7b2314494362

rq turtle/ttl

TODO

Use at

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 schema: <http://schema.org/>
PREFIX psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?birth ?death ?statements ?linkcount where
{

{SELECT ?item (sample(?dob) as ?birth) (sample(?dod) as ?death) (count(*) as ?count) WHERE 
{
  ?item wdt:P106/wdt:P279* wd:Q169470. # item has occupation = physicist or subclass thereof
  ?article schema:about ?item ;        # has a de.wiki sitelink
          schema:isPartOf <https://de.wikipedia.org/> .

  ?item p:P569/psv:P569 ?birth_date_node . # has a dob with day precision
  {?birth_date_node wikibase:timePrecision "11"^^xsd:integer .}
  ?birth_date_node wikibase:timeValue ?dob .

  optional {
  ?item p:P570/psv:P570 ?death_date_node . #if has a dod, it has day precision
  {?death_date_node wikibase:timePrecision "11"^^xsd:integer .}
  ?death_date_node wikibase:timeValue ?dod .
  }
} group by ?item }  ?item wikibase:statements ?statements .
  OPTIONAL {?item wikibase:sitelinks ?linkcount .}
  filter (?count<2) #exclude people with more than one dob / dod
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}  order by ?birth

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?article") v9("?birth"):::projected v5("?birth_date_node") v10("?count") v9("?death"):::projected v7("?death_date_node") v6("?dob") v8("?dod") v3("?item"):::projected v11("?linkcount"):::projected v10("?statements"):::projected a1((" ")) a2((" ")) a3((" ")) c7([https://de.wikipedia.org/]):::iri c11(["11^^xsd:integer"]):::literal c4(["wd:Q169470"]):::iri c18(["bd:serviceParam"]):::iri c20(["#91;AUTO_LANGUAGE#93;,en"]):::literal f0[["?count < '2^^xsd:integer'"]] f0 --> v10 v3 --"p:direct/P106"--> a1 a1 --"p:direct/P279"--> c4 v4 --"schema:about"--> v3 v4 --"schema:isPartOf"--> c7 v3 --"p:P569"--> a2 a2 --"p:statement/value/P569"--> v5 v5 --"wikibase:timePrecision"--> c11 v5 --"wikibase:timeValue"--> v6 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:P570".-> a3 a3 --"p:statement/value/P570"--> v7 v7 --"wikibase:timePrecision"--> c11 v7 --"wikibase:timeValue"--> v8 end bind4[/"sample(?dob)"/] v6 --o bind4 bind4 --as--o v9 bind5[/"sample(?dod)"/] v8 --o bind5 bind5 --as--o v9 bind6[/"count(*)"/] bind6 --as--o v10 v3 --"wikibase:statements"--> v10 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wikibase:sitelinks".-> v11 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c18 --"wikibase:language"--> c20 end