query-0c03537ee75e82e47cb7330810fad474
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 pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT DISTINCT ?x ?y ?countryLabel
WHERE {
?country wdt:P31/wdt:P279* wd:Q56061.
?country wdt:P1082 ?population.
?country wdt:P2046 ?area.
?country p:P610 ?hpt.
?hpt pq:P2044 ?height.
?country p:P1589 ?lpt.
?lpt pq:P2044 ?depth.
{
SELECT ?x ?y WHERE {
BIND(?population/?area AS ?density)
BIND(?area/?population AS ?idensity)
BIND((?depth+?height) AS ?span)
BIND((?span*?span)/?area AS ?inclination)
BIND(?density / ?inclination AS ?slopiness)
BIND((STRLEN(ROUND(300000000*?density*?density*?density*?density))-9)/4.0 AS ?x)
BIND((STRLEN(ROUND(300000000*?inclination*?inclination))-9)/4.0 AS ?y)
}
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP BY ?countryLabel ?x ?y
#ORDER BY DESC(?slopiness)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?area")
v1("?country")
v8("?density")
v7("?depth")
v5("?height")
v4("?hpt")
v9("?idensity")
v11("?inclination")
v6("?lpt")
v2("?population")
v12("?slopiness")
v10("?span")
v13("?x"):::projected
v14("?y"):::projected
a1((" "))
c10(["bd:serviceParam"]):::iri
c12(["en"]):::literal
c3(["wd:Q56061"]):::iri
v1 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v1 --"p:direct/P1082"--> v2
v1 --"p:direct/P2046"--> v3
v1 --"p:P610"--> v4
v4 --"p:qualifier/P2044"--> v5
v1 --"p:P1589"--> v6
v6 --"p:qualifier/P2044"--> v7
bind0[/"?population / ?area"/]
v2 --o bind0
v3 --o bind0
bind0 --as--o v8
bind1[/"?area / ?population"/]
v3 --o bind1
v2 --o bind1
bind1 --as--o v9
bind2[/"?depth + ?height"/]
v7 --o bind2
v5 --o bind2
bind2 --as--o v10
bind3[/"?span * ?span / ?area"/]
v10 --o bind3
v3 --o bind3
bind3 --as--o v11
bind4[/"?density / ?inclination"/]
v8 --o bind4
v11 --o bind4
bind4 --as--o v12
bind5[/"string-length(numeric-round('300000000^^xsd:integer' * ?density * ?density * ?density * ?density)) + '-9^^xsd:integer' / '4.0^^xsd:decimal'"/]
v8 --o bind5
bind5 --as--o v13
bind6[/"string-length(numeric-round('300000000^^xsd:integer' * ?inclination * ?inclination)) + '-9^^xsd:integer' / '4.0^^xsd:decimal'"/]
v11 --o bind6
bind6 --as--o v14
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end