query-32ca8fdfaae1c7fc53759b0a49c485e7

rq turtle/ttl

Mapa de densidad de poblaciĆ³n de EE.UU

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#defaultView:Map{"hide":["?rgb","?coordenadas"]}
SELECT ?item ?itemLabel ?rgb ?geoshape ?densidad WHERE {
  {?item wdt:P31 wd:Q35657.}
  UNION
  {?item wdt:P31 wd:Q783733 .}
  ?item wdt:P3896 ?geoshape ;
        wdt:P1082 ?poblacion ;
        wdt:P2046 ?superficie .
  BIND(?poblacion/?superficie AS ?densidad)
  BIND(IF(?densidad>150,"FF0000",IF(?densidad>100,"FF3333",IF(?densidad>50,"FF5555",IF(?densidad>20,"FF8888","FFAAAA")))) as ?rgb)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],es". }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v5("?densidad"):::projected v2("?geoshape"):::projected v1("?item"):::projected v3("?poblacion") v6("?rgb"):::projected v4("?superficie") c8(["bd:serviceParam"]):::iri c10(["#91;AUTO_LANGUAGE#93;,es"]):::literal c3(["wd:Q783733"]):::iri c2(["wd:Q35657"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c3 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v1 --"wdt:P31"--> c2 end union0r <== or ==> union0l end v1 --"wdt:P3896"--> v2 v1 --"wdt:P1082"--> v3 v1 --"wdt:P2046"--> v4 bind0[/"?poblacion / ?superficie"/] v3 --o bind0 v4 --o bind0 bind0 --as--o v5 bind1[/"if(?densidad > '150^^xsd:integer','FF0000',if(?densidad > '100^^xsd:integer','FF3333',if(?densidad > '50^^xsd:integer','FF5555',if(?densidad > '20^^xsd:integer','FF8888','FFAAAA'))))"/] v5 --o bind1 bind1 --as--o v6 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end