query-92172dd12a20cecedccc853288d5d29a

rq turtle/ttl

naval vessels without uboat.net id

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 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 ?pennant ?launchdate WHERE {
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
  {
    SELECT DISTINCT ?item ?label ?pennant ?launchdate ?type WHERE {
      #?item wdt:P31 ?type.
      ?item wdt:P31/wdt:P279* wd:Q177597.
      #?item wdt:P137 wd:Q172771.
      ?item p:P793 ?statement1.
      ?statement1 (ps:P793/(wdt:P279*)) wd:Q596643.
      ?statement1 pq:P585 ?launchdate.
      FILTER (?launchdate >= "1918-01-01T00:00:00Z"^^xsd:dateTime && ?launchdate < "1946-01-01T00:00:00Z"^^xsd:dateTime)
      MINUS {?item wdt:P1343 wd:Q21713173}
      OPTIONAL {?item wdt:P879 ?pennant}
      OPTIONAL {?item wdt:P1448 ?officialname}
      OPTIONAL {?item rdfs:label ?en_label . FILTER(LANG(?en_label) = "en")}
      BIND(COALESCE (?officialname, ?en_label) AS ?label)
    }
  }
} ORDER BY ?label

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?en_label") v4("?item"):::projected v8("?label"):::projected v3("?launchdate"):::projected v7("?officialname") v6("?pennant"):::projected v5("?statement1") a1((" ")) a2((" ")) c4(["en-gb,en,mul"]):::literal c13(["wd:Q596643"]):::iri c16(["wd:Q21713173"]):::iri c2(["bd:serviceParam"]):::iri c10(["wd:Q177597"]):::iri subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c2 --"wikibase:language"--> c4 end f0[["?launchdate >= '1918-01-01T00:00:00Z^^xsd:dateTime'?launchdate < '1946-01-01T00:00:00Z^^xsd:dateTime'"]] f0 --> v3 v4 --"p:direct/P31"--> a1 a1 --"p:direct/P279"--> c10 v4 --"p:P793"--> v5 v5 --"p:statement/P793"--> a2 a2 --"p:direct/P279"--> c13 v5 --"p:qualifier/P585"--> v3 subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v4 --"p:direct/P1343"--> c16 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P879".-> v6 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v4 -."p:direct/P1448".-> v7 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."rdfs:label".-> v2 end bind2[/"?officialname?en_label"/] v7 --o bind2 v2 --o bind2 bind2 --as--o v8