query-e3f11dd8e9fee0925ab8ae7f6574b3f5
Vessel classes not named after their lead ships
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?class ?ship ?classLabel ?shipLabel ?namedLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en". }
?class wdt:P31/wdt:P279* wd:Q19832479.
?class wdt:P138 ?named.
MINUS {?named wdt:P31/wdt:P279* wd:Q1229765}
?ship wdt:P289 ?class;
p:P289 [ pq:P2868 wd:Q2095057].
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?class"):::projected
v2("?named")
v3("?ship"):::projected
a1((" "))
a2((" "))
a3((" "))
c7(["wd:Q19832479"]):::iri
c4(["en-gb,en"]):::literal
c2(["bd:serviceParam"]):::iri
c9(["wd:Q1229765"]):::iri
c12(["wd:Q2095057"]):::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 --"p:direct/P138"--> v2
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v2 --"p:direct/P31"--> a2
a2 --"p:direct/P279"--> c9
end
v3 --"p:direct/P289"--> v1
a3 --"p:qualifier/P2868"--> c12
v3 --"p:P289"--> a3