query-891c26c46b0d6de5cf82bf48b88642e8
battleships without uboat.net descriptions
Use at
- https://query.wikidata.org/sparql
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 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 ?pennant ?launchdate WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
{
SELECT DISTINCT ?item ?pennant ?launchdate WHERE {
?item p:P31 ?statement2.
?statement2 (ps:P31/(wdt:P279*)) wd:Q182531.
?item p:P137 ?statement3.
?statement3 (ps:P137/(wdt:P279*)) wd:Q172771.
?item p:P793 ?statement1.
?statement1 (ps:P793/(wdt:P279*)) wd:Q596643.
?statement1 pq:P585 ?launchdate.
?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)
OPTIONAL {?item wdt:P879 ?pennant}
MINUS {?item wdt:P1343 wd:Q21713173}
}
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?launchdate"):::projected
v6("?pennant"):::projected
v5("?statement1")
v3("?statement2")
v4("?statement3")
a1((" "))
a2((" "))
a3((" "))
a4((" "))
c4(["en-gb,en,mul"]):::literal
c10(["wd:Q182531"]):::iri
c16(["wd:Q596643"]):::iri
c20(["wd:Q21713173"]):::iri
c2(["bd:serviceParam"]):::iri
c13(["wd:Q172771"]):::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 --> v1
v2 --"p:P31"--> v3
v3 --"p:statement/P31"--> a1
a1 --"p:direct/P279"--> c10
v2 --"p:P137"--> v4
v4 --"p:statement/P137"--> a2
a2 --"p:direct/P279"--> c13
v2 --"p:P793"--> v5
v5 --"p:statement/P793"--> a3
a3 --"p:direct/P279"--> c16
v5 --"p:qualifier/P585"--> v1
v5 --"p:statement/P793"--> a4
a4 --"p:direct/P279"--> c16
v5 --"p:qualifier/P585"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."p:direct/P879".-> v6
end
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P1343"--> c20
end