query-c313d51a28e29a9ecb7a01a5e0760008

rq turtle/ttl

. Then you know that the events are (hopefully) carefully selected by Wikipedia users:en:Timeline of Japanese historyWell, you could simply list all events linked to in the page 14:02, 1 August 2022 (UTC) 2001:610:450:40:0:0:0:1035 https://en.wikipedia.org/wiki/Timeline_of_Japanese_historyEvents could be very broad (sports, concerts, natural disasters, elections, inflation, pandemics, inventions, product releases etc), so I understand it is not easy to list them all in a nice way, but I have a feeling that Wikidata does not define the classification of events very intuitively. Still, my question was what would be a reasonable query which has a nice balance between recall and precision to gain an overview of important historical events for a country (or city), just like the way how Wikidata/Wikipedia lists all important relevant information about a country or city (i.e. wd:Q17). In short, I would say something like the following Wikipage would be very nice: Ok, thank you for your prompt reply. I thought it is enough to say I would like to see entities whose type is event in general. My first impression was that historical events (wd:Q13418847) could be enough to see a wide range of events interesting for historical research, but the query above returns a few hundreds events which has date information, which is not enough. In addition, I wonder if this entity focuses too much on war events.Dipsacus fullonum@ 11:27, 1 August 2022 (UTC)) talk (Dipsacus fullonumPlease define which historical events you want in the list. On this page we can help with SPARQL queries but you have to describe what they should do. I can't know what you want in the list. --

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 wd: <http://www.wikidata.org/entity/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pqv: <http://www.wikidata.org/prop/qualifier/value/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT distinct ?event ?eventLabel ?time ?begin ?end ?create ?destroy WHERE {
  VALUES ?city { wd:Q1490 }.
  VALUES ?startTime {"1990-12-31"^^xsd:dat}.
  {?event wdt:P131* ?city.} UNION {?event wdt:P276 ?city.}
#  ?event wdt:P31/wdt:P279* wd:Q1190554. (anyway timesout)
  {?event p:P276 ?statement.
    ?statement pqv:P580 ?beginvalue;
               pqv:P582 ?endvalue;
               ps:P276 ?city.
    ?beginvalue wikibase:timeValue ?begin .
    ?endvalue wikibase:timeValue ?end .
    FILTER("1990-12-31"^^xsd:date < ?begin && ?begin < "2020-00-00"^^xsd:dat||
           "1990-12-31"^^xsd:date < ?end && ?end < "2020-00-00"^^xsd:dat)
 }
 UNION
  { ?event wdt:P585 ?time.
   FILTER("1990-12-31"^^xsd:date < ?time && ?time < "2020-00-00"^^xsd:dat)
  }
 UNION
  { ?event wdt:P580 ?begin;
           wdt:P582 ?end.
    FILTER("1990-12-31"^^xsd:date < ?begin && ?begin < "2020-00-00"^^xsd:date ||
           "1990-12-31"^^xsd:date < ?end && ?end < "2020-00-00"^^xsd:dat)
  }
 UNION
  { ?event wdt:P571 ?create;
           wdt:P576 ?destroy;
    FILTER("1990-12-31"^^xsd:date < ?create && ?create < "2020-00-00"^^xsd:date ||
           "1990-12-31"^^xsd:date < ?destroy && ?destroy < "2020-00-00"^^xsd:dat)
  }         
  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; v4("?begin"):::projected v7("?beginvalue") v1("?city") v10("?create"):::projected v11("?destroy"):::projected v5("?end"):::projected v8("?endvalue") v3("?event"):::projected v2("?startTime") v6("?statement") v9("?time"):::projected c17(["bd:serviceParam"]):::iri c19(["#91;AUTO_LANGUAGE#93;,en"]):::literal bind0[/VALUES ?city/] bind0-->v1 bind00(["wd:Q1490"]) bind00 --> bind0 bind1[/VALUES ?startTime/] bind1-->v2 bind10([s1990-12-31^^<http://www.w3.org/2001/XMLSchema#dat>"]) bind10 --> bind1 subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v3 --"p:direct/P276"--> v1 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v3 --"p:direct/P131"--> v1 end union0r <== or ==> union0l end subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; f2[["('1990-12-31^^xsd:date' < ?create?create < '2020-00-00^^xsd:date' || '1990-12-31^^xsd:date' < ?destroy?destroy < s2020-00-00^^<http://www.w3.org/2001/XMLSchema#dat>')"]] f2 --> v10 f2 --> v11 v3 --"p:direct/P571"--> v10 v3 --"p:direct/P576"--> v11 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; f3[["('1990-12-31^^xsd:date' < ?begin?begin < '2020-00-00^^xsd:date' || '1990-12-31^^xsd:date' < ?end?end < s2020-00-00^^<http://www.w3.org/2001/XMLSchema#dat>')"]] f3 --> v4 f3 --> v5 v3 --"p:direct/P580"--> v4 v3 --"p:direct/P582"--> v5 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; f4[["'1990-12-31^^xsd:date' < ?time?time < s2020-00-00^^<http://www.w3.org/2001/XMLSchema#dat>'"]] f4 --> v9 v3 --"p:direct/P585"--> v9 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; f5[["('1990-12-31^^xsd:date' < ?begin?begin < s2020-00-00^^<http://www.w3.org/2001/XMLSchema#dat>' || '1990-12-31^^xsd:date' < ?end?end < s2020-00-00^^<http://www.w3.org/2001/XMLSchema#dat>')"]] f5 --> v4 f5 --> v5 v3 --"p:P276"--> v6 v6 --"p:qualifier/value/P580"--> v7 v6 --"p:qualifier/value/P582"--> v8 v6 --"p:statement/P276"--> v1 v7 --"wikibase:timeValue"--> v4 v8 --"wikibase:timeValue"--> v5 end union1r <== or ==> union1l end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c17 --"wikibase:language"--> c19 end