query-b0ce01cb38fc5f0c5abdeddf349fdfe2
sparql title translated
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#>
# by Jura1, 2021-05-21
#title:Carte des glaciersv
# defaultView:Map{"hide":["?coor","?area_scale_km"], "layer": "?area_scale_km"}
SELECT ?item ?itemLabel ?itemDescription ?coor ?area_sqkm ?area_scale_km
{
?item wdt:P31/wdt:P279* wd:Q35666 .
OPTIONAL { ?item wdt:P625 ?coor }
OPTIONAL { ?item p:P2046 [ a wikibase:BestRank; psn:P2046/wikibase:quantityAmount ?area_sqm ] .
BIND( ROUND(?area_sqm/10000)/100 as ?area_sqkm)
BIND( strlen(str(ROUND(?area_sqm/1000000))) as ?area_scale_km)
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?area_scale_km"):::projected
v4("?area_sqkm"):::projected
v3("?area_sqm")
v2("?coor"):::projected
v1("?item"):::projected
a1((" "))
a2((" "))
a3((" "))
c6(["wikibase:BestRank"]):::iri
c11(["bd:serviceParam"]):::iri
c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c3(["wd:Q35666"]):::iri
v1 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."p:direct/P625".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
a2 -."a".-> c6
a2 --"p:statement/value-normalized/P2046"--> a3
a3 --"wikibase:quantityAmount"--> v3
v1 --"p:P2046"--> a2
bind0[/"numeric-round(?area_sqm / '10000^^xsd:integer') / '100^^xsd:integer'"/]
v3 --o bind0
bind0 --as--o v4
bind1[/"string-length(str(numeric-round(?area_sqm / '1000000^^xsd:integer')))"/]
v3 --o bind1
bind1 --as--o v5
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c11 --"wikibase:language"--> c13
end