Public
Edited
Aug 23, 2023
Importers
1 star
Insert cell
Insert cell
querySPARQL({brief: true, mapVars: {
itemLabel: "name",
isoCode2: "ID2",
isoCode3: "ID3",
item: undefined
}, name() {
return this.ID2
? this.ID3
? this.ID2 == String(this.ID3).slice(0, 2)
? `${this.name} [${this.ID2}(${String(this.ID3).slice(2)})]`
: `${this.name} [${this.ID2}/${this.ID3}]`
: `${this.name} (${this.ID2})`
: this.ID3
? `${this.name} (${this.ID3})`
: this.name;
}})`SELECT DISTINCT ?item ?itemLabel ?isoCode2 ?isoCode3 ?latitude ?longitude WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
{
SELECT DISTINCT ?item WHERE {
?item p:P31 ?statement0.
?statement0 (ps:P31/(wdt:P279*)) wd:Q6256.
}
}
OPTIONAL {
?item p:P297 ?isoStatement2.
?isoStatement2 ps:P297 ?isoCode2.
?item p:P298 ?isoStatement3.
?isoStatement3 ps:P298 ?isoCode3.

?item p:P625 ?coordinateLocationStatement.
?coordinateLocationStatement psv:P625 ?coordinateLocationValue.
?coordinateLocationValue wikibase:geoLatitude ?latitude.
?coordinateLocationValue wikibase:geoLongitude ?longitude.
}
FILTER NOT EXISTS {
?item p:P31 wd:Q3024240.
}
}`
Insert cell
Insert cell
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more