query-bc63ce4957213bb05e53c6f428a18431

rq turtle/ttl

Royal Navy ships without vessel_class, including no_value, optional inception or launch date

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX schema: <http://schema.org/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?label ?date WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
  {
    SELECT DISTINCT ?item ?label ?date WHERE {
      ?item p:P137 ?statement0.
      ?statement0 (ps:P137/(wdt:P279*)) wd:Q172771.
      ?item wdt:P31 wd:Q11446;
         schema:description ?description;
         rdfs:label ?label.
      OPTIONAL {?item wdt:P571 ?inception}
      OPTIONAL {?item p:P793 ?statement1. ?statement1 (ps:P793/(wdt:P279*)) wd:Q596643.
                ?statement1 pq:P585 ?launchdate}
      BIND(COALESCE(?launchdate,?inception) as ?date)
  FILTER(LANG(?label) = "en").
  FILTER(CONTAINS(?label, "HMS")).
      MINUS {
        ?item p:P289 ?statement2.
        ?statement2 (ps:P289/(wdt:P279*)) _:anyValueP289.
      }
    }
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v8("?date"):::projected v4("?description") v5("?inception") v2("?item"):::projected v1("?label"):::projected v7("?launchdate") v3("?statement0") v6("?statement1") v9("?statement2") a4((" ")) a1((" ")) a2((" ")) a3((" ")) c4(["en-gb,en,mul"]):::literal c18(["wd:Q596643"]):::iri c2(["bd:serviceParam"]):::iri c12(["wd:Q11446"]):::iri c10(["wd:Q172771"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end f0[["contains(?label,'HMS')"]] f0 --> v1 f1[["?label = 'en'"]] f1 --> v1 v2 --"p:P137"--> v3 v3 --"p:statement/P137"--> a1 a1 --"p:direct/P279"--> c10 v2 --"p:direct/P31"--> c12 v2 --"schema:description"--> v4 v2 --"rdfs:label"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:direct/P571".-> v5 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."p:P793".-> v6 v6 --"p:statement/P793"--> a2 a2 --"p:direct/P279"--> c18 v6 --"p:qualifier/P585"--> v7 end bind2[/"?launchdate?inception"/] v7 --o bind2 v5 --o bind2 bind2 --as--o v8 subgraph minus3["MINUS"] style minus3 stroke-width:6px,fill:pink,stroke:red; v2 --"p:P289"--> v9 v9 --"p:statement/P289"--> a3 a3 --"p:direct/P279"--> a4 end