query-2f6947107720621311fa42ffd2d34e5c

rq turtle/ttl

military operations between 1707 and 1800 that have UK as participant

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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
  {
    SELECT DISTINCT ?item WHERE {
      ?item p:P31 ?statement0.
      ?statement0 (ps:P31/(wdt:P279*)) wd:Q645883.
      ?item p:P580 ?statement_1.
      ?statement_1 psv:P580 ?statementValue_1.
      ?statementValue_1 wikibase:timePrecision ?precision_1.
      hint:Prior hint:rangeSafe "true"^^xsd:boolean.
      FILTER(?precision_1 >= 9 )
      ?statementValue_1 wikibase:timeValue ?P580_1.
      hint:Prior hint:rangeSafe "true"^^xsd:boolean.
      FILTER(?P580_1 >= "+1707-00-00T00:00:00Z"^^xsd:dateTime)
      #MINUS {?item p:P580 ?statement_2}
      ?item p:P582 ?statement_2.
      ?statement_2 psv:P582 ?statementValue_2.
      ?statementValue_2 wikibase:timePrecision ?precision_2.
      hint:Prior hint:rangeSafe "true"^^xsd:boolean.
      FILTER(?precision_2 >= 9 )
      ?statementValue_2 wikibase:timeValue ?P582_2.
      hint:Prior hint:rangeSafe "true"^^xsd:boolean.
      FILTER(?P582_2 < "+1800-00-00T00:00:00Z"^^xsd:dateTime)
      ?item p:P710 ?statement3.
      ?statement3 (ps:P710/(wdt:P279*)) wd:Q145.
    }
  }

Query found at