query-bc0b05b8068db39c0bd820b2faf22ab1

rq turtle/ttl

Battles where country has a contemporary constraint potential issue warning. I got this working for countries with single value inceptions/dissolutions, but not when they had multiple value ones, so I need tweaks to (Q2171443)Action of 1 January 1800 comes up with a contemporary constraint issue warning in the GUI, as happens for (P17)country where the (Q178561)battle I need instances of

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE]". }
  ?item wdt:P31/wdt:P279* wd:Q178561. # battle
  ?item wdt:P17 ?country.
  ?country wdt:P571 ?inception.
  ?country wdt:P576 ?dissolved.
-->  BIND earliest ?inception as ?inception1.
-->  BIND latest ?dissolved as ?dissolved1.
   ?item wdt:P585 ?poi.
    FILTER (?poi > ?dissolved1|| ?poi < ?inception1)}
  }

Query found at