query-a43435e046796ec4cc0e9372201a7c8a

rq turtle/ttl

find items that are instances of severe weather

with dates which could come either from a point in time or a start time property

but filter down to only the ones that happened between 2000 and 2023

SELECT DISTINCT ?item ?itemLabel ?date WHERE { #not sure why adding this initial pattern changes number of results ?item wdt:P31 ?type. ?type (wdt:P31?/wdt:P279*) wd:Q741507. ?item rdfs:label ?humanLabel.

{?item wdt:P585 ?date}
UNION
{?item wdt:P580 ?date}

FILTER (YEAR(?date) >= 2000 && YEAR(?date) <= 2023) SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]","en". } }

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#find items that are instances of severe weather
#with dates which could come either from a point in time or a start time property
#but filter down to only the ones that happened between 2000 and 2023
SELECT DISTINCT ?item ?itemLabel ?date WHERE {
  #not sure why adding this initial pattern changes number of results
  ?item wdt:P31 ?type.
  ?type (wdt:P31?/wdt:P279*) wd:Q741507.
  ?item rdfs:label ?humanLabel.

    {?item wdt:P585 ?date}
    UNION
    {?item wdt:P580 ?date}

  FILTER (YEAR(?date) >= 2000 && YEAR(?date) <= 2023)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]","en". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v1("?date"):::projected v4("?humanLabel") v2("?item"):::projected v3("?type") a1((" ")) c13(["en"]):::literal c5(["wd:Q741507"]):::iri c10(["bd:serviceParam"]):::iri c12(["#91;AUTO_LANGUAGE#93;"]):::literal f0[["year-from-dateTime(?date) >= '2000^^xsd:integer'year-from-dateTime(?date) <= '2023^^xsd:integer'"]] f0 --> v1 v2 --"wdt:P31"--> v3 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 --"wdt:P31"--> a1 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; end union0r <== or ==> union0l end a1 --"wdt:P279"--> c5 v2 --"rdfs:label"--> v4 subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P580"--> v1 end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P585"--> v1 end union1r <== or ==> union1l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 c10 --"wikibase:language"--> c13 end