query-118c1896050772e2774bd18234d3a51c
Royal Navy shipwrecks
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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?ship ?shipLabel ?coordinates WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
{
SELECT DISTINCT ?ship WHERE {
?ship p:P137 ?statement0.
?statement0 (ps:P137/(wdt:P279*)) wd:Q172771.
{
?ship p:P31 ?statement1.
?statement1 (ps:P31/(wdt:P279*)) wd:Q852190.
}
UNION
{
?ship p:P366 ?statement2.
?statement2 (ps:P366/(wdt:P279*)) wd:Q852190.
}
}
}
OPTIONAL { ?ship wdt:P625 ?coordinates. }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?coordinates"):::projected
v1("?ship"):::projected
v2("?statement0")
v3("?statement1")
v4("?statement2")
a1((" "))
a2((" "))
a3((" "))
c4(["en-gb,en,mul"]):::literal
c2(["bd:serviceParam"]):::iri
c11(["wd:Q852190"]):::iri
c8(["wd:Q172771"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"p:P137"--> v2
v2 --"p:statement/P137"--> a1
a1 --"p:direct/P279"--> c8
subgraph union0[" Union "]
subgraph union0l[" "]
style union0l fill:#abf,stroke-dasharray: 3 3;
v1 --"p:P366"--> v4
v4 --"p:statement/P366"--> a3
a3 --"p:direct/P279"--> c11
end
subgraph union0r[" "]
style union0r fill:#abf,stroke-dasharray: 3 3;
v1 --"p:P31"--> v3
v3 --"p:statement/P31"--> a2
a2 --"p:direct/P279"--> c11
end
union0r <== or ==> union0l
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P625".-> v5
end