query-8723e9170fbc2963f57a8d26b2b49139

rq turtle/ttl

PropertiesDictionary of Swedish National Biography ID (P3217)Wikimedia language code (P424)date of birth (P569)reference URL (P854)stated in (P248)imported from Wikimedia project (P143)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?date1 ?p1 ?c1 ?r1 ?refurl1 ?angesi1Label ?i1 ?date2 ?p2 ?c2 ?r2 ?refurl2 ?angesi2Label ?i2 WHERE
{
  ?item wdt:P3217 ?sbl .
  ?item p:P569 ?date1stm .
  ?date1stm psv:P569 ?date1node .
  ?date1node wikibase:timeValue ?date1 .
  ?date1node wikibase:timePrecision ?p1 .
  ?date1node wikibase:timeCalendarModel ?cal1 .
  BIND(IF(?cal1=wd:Q1985727,'G',IF(?cal1= wd:Q1985786, 'J', '?')) AS ?c1) 
  ?date1stm wikibase:rank ?rank1 .
  BIND(IF(?rank1=wikibase:PreferredRank,'P',IF(?rank1= wikibase:NormalRank, 'N', 'D')) AS ?r1) 
  OPTIONAL { ?date1stm prov:wasDerivedFrom ?ref1.
     OPTIONAL { ?ref1 pr:P854 ?refurl1 . }
     OPTIONAL { ?ref1 pr:P248 ?angesi1 . }
     OPTIONAL { ?ref1 pr:P143/wdt:P424 ?i1 . }
  }
  ?item p:P569 ?date2stm .
  ?date2stm psv:P569 ?date2node .
  ?date2node wikibase:timeValue ?date2 . 
  ?date2node wikibase:timePrecision ?p2 .
  ?date2node wikibase:timeCalendarModel ?cal2 .
  BIND(IF(?cal2=wd:Q1985727,'G',IF(?cal2= wd:Q1985786, 'J', '?')) AS ?c2) 
  ?date2stm wikibase:rank ?rank2 .
  BIND(IF(?rank2=wikibase:PreferredRank,'P',IF(?rank2= wikibase:NormalRank, 'N', 'D')) AS ?r2)
  OPTIONAL { ?date2stm prov:wasDerivedFrom ?ref2 .
     OPTIONAL { ?ref2 pr:P854 ?refurl2 . }
     OPTIONAL { ?ref2 pr:P248 ?angesi2 . }
     OPTIONAL { ?ref2 pr:P143/wdt:P424 ?i2 . }
  }
  FILTER(?date1<?date2)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "sv,en". }
}
ORDER BY ?item ?refurl1 ?refurl2

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v15("?angesi1") v25("?angesi2") v11("?c1"):::projected v21("?c2"):::projected v10("?cal1") v20("?cal2") v4("?date1"):::projected v8("?date1node") v7("?date1stm") v5("?date2"):::projected v18("?date2node") v17("?date2stm") v16("?i1"):::projected v26("?i2"):::projected v1("?item"):::projected v9("?p1"):::projected v19("?p2"):::projected v13("?r1"):::projected v23("?r2"):::projected v12("?rank1") v22("?rank2") v14("?ref1") v24("?ref2") v2("?refurl1"):::projected v3("?refurl2"):::projected v6("?sbl") a1((" ")) a2((" ")) c14(["bd:serviceParam"]):::iri c16(["sv,en"]):::literal f0[["?date1 < ?date2"]] f0 --> v4 f0 --> v5 v1 --"p:direct/P3217"--> v6 v1 --"p:P569"--> v7 v7 --"p:statement/value/P569"--> v8 v8 --"wikibase:timeValue"--> v4 v8 --"wikibase:timePrecision"--> v9 v8 --"wikibase:timeCalendarModel"--> v10 bind1[/"if(?cal1 = 'wd:Q1985727','G',if(?cal1 = 'wd:Q1985786','J','?'))"/] v10 --o bind1 bind1 --as--o v11 v7 --"wikibase:rank"--> v12 bind2[/"if(?rank1 = 'wikibase:PreferredRank','P',if(?rank1 = 'wikibase:NormalRank','N','D'))"/] v12 --o bind2 bind2 --as--o v13 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v7 -."prov:wasDerivedFrom".-> v14 subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v14 -."p:reference/P854".-> v2 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v14 -."p:reference/P248".-> v15 end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v14 -."p:reference/P143".-> a1 a1 --"p:direct/P424"--> v16 end end v1 --"p:P569"--> v17 v17 --"p:statement/value/P569"--> v18 v18 --"wikibase:timeValue"--> v5 v18 --"wikibase:timePrecision"--> v19 v18 --"wikibase:timeCalendarModel"--> v20 bind3[/"if(?cal2 = 'wd:Q1985727','G',if(?cal2 = 'wd:Q1985786','J','?'))"/] v20 --o bind3 bind3 --as--o v21 v17 --"wikibase:rank"--> v22 bind4[/"if(?rank2 = 'wikibase:PreferredRank','P',if(?rank2 = 'wikibase:NormalRank','N','D'))"/] v22 --o bind4 bind4 --as--o v23 subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v17 -."prov:wasDerivedFrom".-> v24 subgraph optional5["(optional)"] style optional5 fill:#bbf,stroke-dasharray: 5 5; v24 -."p:reference/P854".-> v3 end subgraph optional6["(optional)"] style optional6 fill:#bbf,stroke-dasharray: 5 5; v24 -."p:reference/P248".-> v25 end subgraph optional7["(optional)"] style optional7 fill:#bbf,stroke-dasharray: 5 5; v24 -."p:reference/P143".-> a2 a2 --"p:direct/P424"--> v26 end end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c14 --"wikibase:language"--> c16 end