query-17d5fab2853b754dbd4729f9d41618c3
Offical names for compromised 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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?item ?itemLabel ?name WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul"}
{
SELECT DISTINCT ?item ?name WHERE {
?item wdt:P31 wd:Q11446.
?item rdfs:label ?label. FILTER (lang(?label) = "en")
OPTIONAL {
?item wdt:P1448 ?officialname.
}
BIND(COALESCE(?officialname,?label) AS ?name)
}
}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?item"):::projected
v1("?label")
v4("?name"):::projected
v3("?officialname")
c4(["en-gb,en,mul"]):::literal
c2(["bd:serviceParam"]):::iri
c7(["wd:Q11446"]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
f0[["?label = 'en'"]]
f0 --> v1
v2 --"wdt:P31"--> c7
v2 --"rdfs:label"--> v1
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -."wdt:P1448".-> v3
end
bind1[/"?officialname?label"/]
v3 --o bind1
v1 --o bind1
bind1 --as--o v4