query-f66f7e90ed11be1ff16607fcc9f6744a
Recently deceased SELECT ?item ?itemLabel ?itemDescription ?article_no ?cocLabel ?dob ?pobLabel ?dod ?podLabel ?pobuLabel WITH { SELECT ?item ?dod WHERE { ?item wdt:P31 wd:Q5; wdt:P570 ?dod.
BIND(NOW() - "1920-01-31"^^xsd:dateTime AS ?mintime)
BIND(?dod - "1920-01-01"^^xsd:dateTime AS ?dodtime)
FILTER(?dod > "2022-01-01"^^xsd:dateTime && ?dod < NOW())
FILTER(?dodtime > ?mintime)
} } AS %i WHERE { INCLUDE %i
OPTIONAL { ?article_no schema:about ?item; schema:isPartOf https://no.wikipedia.org/. } OPTIONAL { ?item wdt:P569 ?dob. } OPTIONAL { ?item wdt:P27 ?coc. } OPTIONAL { ?item wdt:P19 ?pob. } OPTIONAL { ?item wdt:P20 ?pod. } OPTIONAL { ?item wdt:P119 ?pobu. }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } } ORDER BY DESC(?dod)
Use at
- https://query.wikidata.org/sparql
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 bd: <http://www.bigdata.com/rdf#>
#Recently deceased
SELECT
  ?item ?itemLabel ?itemDescription ?article_no
  ?cocLabel ?dob ?pobLabel ?dod ?podLabel ?pobuLabel
WHERE {
   {
  SELECT ?item ?dod
  WHERE {
    ?item wdt:P31 wd:Q5;
      wdt:P570 ?dod.
    BIND(NOW() - "1920-01-31"^^xsd:date AS ?mintime)
    BIND(?dod - "1920-01-01"^^xsd:date AS ?dodtime)
    FILTER(?dod > "2022-01-01"^^xsd:date && ?dod < NOW())
    FILTER(?dodtime > ?mintime)
  }
}
  OPTIONAL {
    ?article_no schema:about ?item;
      schema:isPartOf <https://no.wikipedia.org/>.
  }
  OPTIONAL { ?item wdt:P569 ?dob. }
  OPTIONAL { ?item wdt:P27 ?coc. }
  OPTIONAL { ?item wdt:P19 ?pob. }
  OPTIONAL { ?item wdt:P20 ?pod. }
  OPTIONAL { ?item wdt:P119 ?pobu. }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
ORDER BY DESC(?dod)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
  v5("?article_no"):::projected 
  v7("?coc")
  v6("?dob"):::projected 
  v1("?dod"):::projected 
  v5("?dodtime")
  v4("?item"):::projected 
  v5("?mintime")
  v8("?pob")
  v10("?pobu")
  v9("?pod")
  c14(["bd:serviceParam"]):::iri 
  c7([https://no.wikipedia.org/]):::iri 
  c3(["wd:Q5"]):::iri 
  c16(["#91;AUTO_LANGUAGE#93;,en"]):::literal 
  f0[["?dodtime > ?mintime"]]
  f0 --> v5
  f0 --> v5
  f1[["?dod > '2022-01-01^^xsd:date'?dod < NOW()"]]
  f1 --> v1
  v4 --"wdt:P31"-->  c3
  v4 --"wdt:P570"-->  v1
  bind2[/"NOW() - '1920-01-31^^xsd:date'"/]
  bind2 --as--o v5
  bind3[/"?dod - '1920-01-01^^xsd:date'"/]
  v1 --o bind3
  bind3 --as--o v5
  subgraph optional0["(optional)"]
  style optional0 fill:#bbf,stroke-dasharray: 5 5;
    v5 -."schema:about".->  v4
    v5 --"schema:isPartOf"-->  c7
  end
  subgraph optional1["(optional)"]
  style optional1 fill:#bbf,stroke-dasharray: 5 5;
    v4 -."wdt:P569".->  v6
  end
  subgraph optional2["(optional)"]
  style optional2 fill:#bbf,stroke-dasharray: 5 5;
    v4 -."wdt:P27".->  v7
  end
  subgraph optional3["(optional)"]
  style optional3 fill:#bbf,stroke-dasharray: 5 5;
    v4 -."wdt:P19".->  v8
  end
  subgraph optional4["(optional)"]
  style optional4 fill:#bbf,stroke-dasharray: 5 5;
    v4 -."wdt:P20".->  v9
  end
  subgraph optional5["(optional)"]
  style optional5 fill:#bbf,stroke-dasharray: 5 5;
    v4 -."wdt:P119".->  v10
  end
  subgraph s1["http://wikiba.se/ontology#label"]
    style s1 stroke-width:4px;
    c14 --"wikibase:language"-->  c16
  end