query-c942ea80258be57ede8a3742cde7bf20

rq turtle/ttl

Royal Navy ships without vessel_class after 1900

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 wdno: <http://www.wikidata.org/prop/novalue/>
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:P137 ?statement0.
      ?statement0 (ps:P137/(wdt:P279*)) wd:Q172771.
      MINUS {
        ?item p:P289 ?statement1.
        ?statement1 (ps:P289/(wdt:P279*)) _:anyValueP289.
      }
      ?item p:P729 ?statement_2.
      ?statement_2 psv:P729 ?statementValue_2.
      ?statementValue_2 wikibase:timePrecision ?precision_2.

      FILTER(?precision_2 >= 9 )
      ?statementValue_2 wikibase:timeValue ?P729_2.

      FILTER(?P729_2 >= "+1901-00-00T00:00:00Z"^^xsd:dateTime)
      ?item p:P31 ?statement3.
      ?statement3 (ps:P31/(wdt:P279*)) wd:Q1229765.
  filter not exists {?item a wdno:P289.}
  filter not exists {?item p:P289 [].}
    }
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?P729_2") v1("?item"):::projected v3("?precision_2") v4("?statement0") v5("?statement1") v8("?statement3") v7("?statementValue_2") v6("?statement_2") a4((" ")) a1((" ")) a2((" ")) a3((" ")) a5((" ")) c4(["en-gb,en,mul"]):::literal c7(["p:novalue/P289"]):::iri c2(["bd:serviceParam"]):::iri c21(["wd:Q1229765"]):::iri c13(["wd:Q172771"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end f0[["not "]] subgraph f0e0["Exists Clause"] e0v1 --"p:P289"--> e0a1 e0v1("?item"):::projected e0a1((" ")):::projected end f0--EXISTS--> f0e0 f0 --> v1 f0 --> c5 f0 --> a1 v1 --"p:P289"--> a1 f1[["not "]] subgraph f1e1["Exists Clause"] e1v1 --"a"--> e1c2 e1v1("?item"):::projected e1c2(["p:novalue/P289"]):::iri end f1--EXISTS--> f1e1 f1 --> v1 f1 --> c6 f1 --> c7 v1 --"a"--> c7 f2[["?P729_2 >= '+1901-00-00T00:00:00Z^^xsd:dateTime'"]] f2 --> v2 f3[["?precision_2 >= '9^^xsd:integer'"]] f3 --> v3 v1 --"p:P137"--> v4 v4 --"p:statement/P137"--> a2 a2 --"p:direct/P279"--> c13 subgraph minus4["MINUS"] style minus4 stroke-width:6px,fill:pink,stroke:red; v1 --"p:P289"--> v5 v5 --"p:statement/P289"--> a3 a3 --"p:direct/P279"--> a4 end v1 --"p:P729"--> v6 v6 --"p:statement/value/P729"--> v7 v7 --"wikibase:timePrecision"--> v3 v7 --"wikibase:timeValue"--> v2 v1 --"p:P31"--> v8 v8 --"p:statement/P31"--> a5 a5 --"p:direct/P279"--> c21