query-979317ac1b1e2305c13579533ceea8a4
title: Official langagues of the country in which the mountin is found SELECT ?item ?itemLabel ?countryLabel ?label ?lang WHERE { VALUES ?item {wd:Q1286} OPTIONAL {?item rdfs:label ?itemLabel. filter(lang(?itemLabel)="en") } ?item wdt:P17 ?country . ?country wdt:P37/wdt:P424 ?langcode . OPTIONAL {?item rdfs:label ?label. BIND(lang(?label) as ?lang) filter(str(?lang) = str(?langcode)) } OPTIONAL {?country rdfs:label ?countryLabel . filter(lang(?countryLabel)="en") } }
Use at
- https://query.wikidata.org/sparql
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#>
#title: Official langagues of the country in which the mountin is found
SELECT ?item ?itemLabel ?countryLabel ?label ?lang
WHERE
{
VALUES ?item {wd:Q1286}
OPTIONAL {?item rdfs:label ?itemLabel. filter(lang(?itemLabel)="en") }
?item wdt:P17 ?country .
?country wdt:P37/wdt:P424 ?langcode .
OPTIONAL {?item rdfs:label ?label.
BIND(lang(?label) as ?lang)
filter(str(?lang) = str(?langcode)) }
OPTIONAL {?country rdfs:label ?countryLabel . filter(lang(?countryLabel)="en") }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?country")
v1("?countryLabel"):::projected
v5("?item"):::projected
v4("?itemLabel"):::projected
v7("?label"):::projected
v8("?lang"):::projected
v3("?langcode")
a1((" "))
bind0[/VALUES ?item/]
bind0-->v5
bind00(["wd:Q1286"])
bind00 --> bind0
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v5 -."rdfs:label".-> v4
end
v5 --"wdt:P17"--> v6
v6 --"wdt:P37"--> a1
a1 --"wdt:P424"--> v3
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v5 -."rdfs:label".-> v7
bind1[/"?label"/]
v7 --o bind1
bind1 --as--o v8
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v6 -."rdfs:label".-> v1
end