query-e89593db38bd199d157686adccf5fac6

rq turtle/ttl

title:Morti recenti SELECT ?q ?qLabel (YEAR(?died) as ?ydied) (MONTH(?died) as ?mdied) (DAY(?died) as ?ddied) ?pdied (YEAR(?born) as ?yborn) (MONTH(?born) as ?mborn) (DAY(?born) as ?dborn) ?pborn ?qDescription ?podLabel ?pod ?podnazioneLabel ?pobLabel ?pob ?pobnazioneLabel ?pusc WHERE { ?q wdt:P5739 ?pusc ; p:P570/psv:P570 [ wikibase:timePrecision ?pdied ; wikibase:timeValue ?died ] .

OPTIONAL { ?q wdt:P20 ?pod . ?pod wdt:P17 ?podnazione . } OPTIONAL { ?q p:P569/psv:P569 [ wikibase:timePrecision ?pborn ; wikibase:timeValue ?born ] . } OPTIONAL { ?q wdt:P19 ?pob . ?pob wdt:P17 ?pobnazione . }

BIND (NOW() - "P3M"^^xsd:duration AS ?month_ago) FILTER (?died >= ?month_ago && ?died < NOW()) SERVICE wikibase:label { bd:serviceParam wikibase:language "it". } } ORDER BY ?died

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 p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Morti recenti
SELECT ?q ?qLabel 
  (YEAR(?died) as ?ydied) (MONTH(?died) as ?mdied) (DAY(?died) as ?ddied) ?pdied
  (YEAR(?born) as ?yborn) (MONTH(?born) as ?mborn) (DAY(?born) as ?dborn) ?pborn
  ?qDescription ?podLabel ?pod ?podnazioneLabel ?pobLabel ?pob ?pobnazioneLabel ?pusc
WHERE {
  ?q wdt:P5739 ?pusc ; p:P570/psv:P570 [ wikibase:timePrecision ?pdied ; wikibase:timeValue ?died ] . 

  OPTIONAL { ?q wdt:P20 ?pod . ?pod wdt:P17 ?podnazione . }
  OPTIONAL { ?q p:P569/psv:P569 [ wikibase:timePrecision ?pborn ; wikibase:timeValue ?born ] . }
  OPTIONAL { ?q wdt:P19 ?pob . ?pob wdt:P17 ?pobnazione . }

  BIND (NOW() - "P3M"^^xsd:duration AS ?month_ago)
  FILTER (?died >= ?month_ago && ?died < NOW())
  SERVICE wikibase:label { bd:serviceParam wikibase:language "it". }
}
ORDER BY ?died

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?born"):::projected v17("?dborn") v14("?ddied") v1("?died"):::projected v16("?mborn") v13("?mdied") v12("?month_ago") v8("?pborn"):::projected v5("?pdied"):::projected v10("?pob"):::projected v11("?pobnazione") v6("?pod"):::projected v7("?podnazione") v4("?pusc"):::projected v3("?q"):::projected v15("?yborn") v12("?ydied") a2((" ")) a1((" ")) a4((" ")) a3((" ")) c14(["it"]):::literal c12(["bd:serviceParam"]):::iri f0[["?died >= ?month_ago?died < NOW()"]] f0 --> v1 f0 --> v12 v3 --"p:direct/P5739"--> v4 a1 --"wikibase:timePrecision"--> v5 a1 --"wikibase:timeValue"--> v1 v3 --"p:P570"--> a2 a2 --"p:statement/value/P570"--> a1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P20".-> v6 v6 --"p:direct/P17"--> v7 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; a3 -."wikibase:timePrecision".-> v8 a3 --"wikibase:timeValue"--> v9 v3 --"p:P569"--> a4 a4 --"p:statement/value/P569"--> a3 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v3 -."p:direct/P19".-> v10 v10 --"p:direct/P17"--> v11 end bind1[/"NOW() - 'P3M^^xsd:duration'"/] bind1 --as--o v12 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c12 --"wikibase:language"--> c14 end bind2[/"year-from-dateTime(?died)"/] v1 --o bind2 bind2 --as--o v12 bind3[/"month-from-dateTime(?died)"/] v1 --o bind3 bind3 --as--o v13 bind4[/"day-from-dateTime(?died)"/] v1 --o bind4 bind4 --as--o v14 bind5[/"year-from-dateTime(?born)"/] v9 --o bind5 bind5 --as--o v15 bind6[/"month-from-dateTime(?born)"/] v9 --o bind6 bind6 --as--o v16 bind7[/"day-from-dateTime(?born)"/] v9 --o bind7 bind7 --as--o v17