query-e3cd582bcb48418b6f8e8be86ea48bc1
TODO
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 psn: <http://www.wikidata.org/prop/statement/value-normalized/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?country ?countryLabel ?countryArea
WHERE {
{
SELECT DISTINCT *
WHERE {
# Instances (P31) of country (Q3624078), sovereign state (Q183366), or disputed territory (Q15634554).
VALUES ?countryclass {wd:Q3624078 wd:Q183366 wd:Q15634554 }
?country wdt:P31 ?countryclass .
# the psn: prefix to normalize the values to a common unit of area (meters, in this case)
?country p:P2046/psn:P2046/wikibase:quantityAmount ?countryArea .
}
} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
} ORDER BY ASC(?countryLabel)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?country"):::projected
v4("?countryArea"):::projected
v1("?countryLabel"):::projected
v2("?countryclass")
a1((" "))
a2((" "))
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
bind0[/VALUES ?countryclass/]
bind0-->v2
bind00(["wd:Q3624078"])
bind00 --> bind0
bind01(["wd:Q183366"])
bind01 --> bind0
bind02(["wd:Q15634554"])
bind02 --> bind0
v3 --"p:direct/P31"--> v2
v3 --"p:P2046"--> a1
a1 --"p:statement/value-normalized/P2046"--> a2
a2 --"wikibase:quantityAmount"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end