query-0b469357b20783a3e497e59309113ee7

rq turtle/ttl

Next stepWe should also inform of calendar model used and sources

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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX prov: <http://www.w3.org/ns/prov#>
PREFIX pr: <http://www.wikidata.org/prop/reference/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX      dbpprop:  <http://dbpedia.org/property/>
PREFIX      foaf:  <http://xmlns.com/foaf/0.1/>
SELECT ?NobelId ?item ?LaureateNobelUri ?NobelBirth  ?WDBirth ?NobelDeath ?WDDeath ?statedin (?cm AS ?CalendarModel) (?p854 AS ?refURL) (?p143 AS ?ImportedFromWikipedia)
where
{

{SELECT ?NobelId ?item ?LaureateNobelUri ?NobelBirth ?NobelDeath ?WDBirth ?WDDeath ?statedin ?cm ?p854 ?p143{
  SERVICE <http://data.nobelprize.org/sparql>  {
      SELECT distinct ?NobelId ?LaureateNobelUri ?NobelBirth ?NobelDeath ?NobelGender WHERE {        
      ?LaureateNobelUri <http://data.nobelprize.org/terms/laureateAward> ?NobelAwardid.
      BIND(REPLACE(str(?LaureateNobelUri),"http://data.nobelprize.org/resource/laureate/","") AS ?NobelId)
      OPTIONAL{ ?LaureateNobelUri foaf:birthday ?NobelBirth}
      OPTIONAL{ ?LaureateNobelUri dbpprop:dateOfDeath ?NobelDeath}
      }
   }
  } 
 }  ?item wdt:P2888 ?LaureateNobelUri . 
  OPTIONAL{ ?item wdt:P569 ?birthDate.}
  OPTIONAL{  ?item p:P569 [ prov:wasDerivedFrom ?ref; psv:P569 [wikibase:timeCalendarModel ?cm ]] . 
     OPTIONAL { ?ref pr:P248 ?statedin }
     OPTIONAL { ?ref pr:P143 ?p143 }
     OPTIONAL { ?ref pr:P854 ?p854 } 
  }
  OPTIONAL{ ?item wdt:P570 ?diedDate.}
  BIND (SUBSTR(CONCAT("0",STR(DAY(?birthDate))),STRLEN(STR(DAY(?birthDate))),2) AS ?birthDay)
  BIND (SUBSTR(CONCAT("0",STR(MONTH(?birthDate))),STRLEN(STR(MONTH(?birthDate))),2) AS ?birthMonth)
  BIND (CONCAT(STR(YEAR(?birthDate)),"-",?birthMonth,"-",?birthDay) AS ?WDBirth)
  BIND (SUBSTR(CONCAT("0",STR(DAY(?diedDate))),STRLEN(STR(DAY(?diedDate))),2) AS ?diedDay)
  BIND (SUBSTR(CONCAT("0",STR(MONTH(?diedDate))),STRLEN(STR(MONTH(?diedDate))),2) AS ?diedMonth)
  BIND (CONCAT(STR(YEAR(?diedDate)),"-",?diedMonth,"-",?diedDay) AS ?WDDeath)
  FILTER (!(
        (BOUND(?NobelBirth) = BOUND(?WDBirth))
    &&
        (BOUND(?NobelDeath) = BOUND(?WDDeath))
    &&
        (str(?WDBirth) = str(?NobelBirth))
    &&
        (str(?WDDeath) = str(?NobelDeath)))
  )
}
 order by desc(xsd:integer(?NobelId))

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v20("?CalendarModel") v22("?ImportedFromWikipedia") v6("?LaureateNobelUri"):::projected v7("?NobelAwardid") v2("?NobelBirth"):::projected v4("?NobelDeath"):::projected v8("?NobelId"):::projected v18("?WDBirth"):::projected v20("?WDDeath"):::projected v9("?birthDate") v16("?birthDay") v17("?birthMonth") v11("?cm"):::projected v15("?diedDate") v18("?diedDay") v19("?diedMonth") v8("?item"):::projected v13("?p143"):::projected v14("?p854"):::projected v10("?ref") v21("?refURL") v12("?statedin"):::projected a1((" ")) a2((" ")) f0[["not bound(?NobelBirth) = bound(?WDBirth)bound(?NobelDeath) = bound(?WDDeath)str(?WDBirth) = str(?NobelBirth)str(?WDDeath) = str(?NobelDeath)"]] f0 --> v2 f0 --> v18 f0 --> v4 f0 --> v20 subgraph s1["http://data.nobelprize.org/sparql"] style s1 stroke-width:4px; v6 --http://data.nobelprize.org/terms/laureateAward--> v7 bind1[/"replace(str(?LaureateNobelUri),'http://data.nobelprize.org/resource/laureate/','')"/] v6 --o bind1 bind1 --as--o v8 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v6 -.http://xmlns.com/foaf/0.1/birthday.-> v2 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v6 -.http://dbpedia.org/property/dateOfDeath.-> v4 end end v8 --"p:direct/P2888"--> v6 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:direct/P569".-> v9 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; a1 -."prov:wasDerivedFrom".-> v10 a2 --"wikibase:timeCalendarModel"--> v11 a1 --"p:statement/value/P569"--> a2 v8 --"p:P569"--> a1 subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v10 -."p:reference/P248".-> v12 end subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v10 -."p:reference/P143".-> v13 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v10 -."p:reference/P854".-> v14 end end subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v8 -."p:direct/P570".-> v15 end bind2[/"substring(concat('0',str(day-from-dateTime(?birthDate))),string-length(str(day-from-dateTime(?birthDate))),'2^^xsd:integer')"/] v9 --o bind2 bind2 --as--o v16 bind3[/"substring(concat('0',str(month-from-dateTime(?birthDate))),string-length(str(month-from-dateTime(?birthDate))),'2^^xsd:integer')"/] v9 --o bind3 bind3 --as--o v17 bind4[/"concat(str(year-from-dateTime(?birthDate)),'-',?birthMonth,'-',?birthDay)"/] v9 --o bind4 v17 --o bind4 v16 --o bind4 bind4 --as--o v18 bind5[/"substring(concat('0',str(day-from-dateTime(?diedDate))),string-length(str(day-from-dateTime(?diedDate))),'2^^xsd:integer')"/] v15 --o bind5 bind5 --as--o v18 bind6[/"substring(concat('0',str(month-from-dateTime(?diedDate))),string-length(str(month-from-dateTime(?diedDate))),'2^^xsd:integer')"/] v15 --o bind6 bind6 --as--o v19 bind7[/"concat(str(year-from-dateTime(?diedDate)),'-',?diedMonth,'-',?diedDay)"/] v15 --o bind7 v19 --o bind7 v18 --o bind7 bind7 --as--o v20 bind8[/"?cm"/] v11 --o bind8 bind8 --as--o v20 bind9[/"?p854"/] v14 --o bind9 bind9 --as--o v21 bind10[/"?p143"/] v13 --o bind10 bind10 --as--o v22