query-a45bc9473318e07892dcd276a2ce6478

rq turtle/ttl

lead ships that don't mention it in their vessel_class

Use at

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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?named ?namedLabel ?roleLabel ?classLabel WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
  {
    SELECT DISTINCT ?item ?named ?class ?role WHERE {
      ?item wdt:P31/wdt:P279* wd:Q559026.
      ?item wd:P137/wdt:P279* wd:Q172771.
      ?item wdt:P138 ?named.
      MINUS {?named wdt:P31/wdt:P279* wd:Q1229765}
      OPTIONAL {?named p:P289 [ ps:P289 ?class ; pq:P2868 ?role]}

      MINUS { ?item wdt:P31 wd:Q21514702}
    }
  }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v3("?class") v1("?item"):::projected v2("?named"):::projected v4("?role") a1((" ")) a2((" ")) a3((" ")) a4((" ")) c4(["en-gb,en,mul"]):::literal c7(["wd:Q559026"]):::iri c15(["wd:Q21514702"]):::iri c2(["bd:serviceParam"]):::iri c11(["wd:Q1229765"]):::iri c9(["wd:Q172771"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end v1 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c7 v1 --"wd:P137"--> a2 a2 --"p:direct/P279"--> c9 v1 --"p:direct/P138"--> v2 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v2 --"p:direct/P31"--> a3 a3 --"p:direct/P279"--> c11 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; a4 -."p:statement/P289".-> v3 a4 --"p:qualifier/P2868"--> v4 v2 --"p:P289"--> a4 end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v1 --"p:direct/P31"--> c15 end