query-33e36fc1a07185af203495efc41a97d8

rq turtle/ttl

Map Layer Colors. However, red as the color for countries with more than one billion people is used not only for India and China but also Equatorial Guinea and the Solomon Islands. And yesterday, I'm sure that Estonia was also red but is now green. one for population numbers, including here: coloring countries on a map Sic19I came across interesting sample queries by @Why isn't the mapping stable? Greenland yesterday also had another color (blue instead of orange). Stability would be helpful when documenting the maps somewhere else. How can I specify my own colors? Are colors being reused if the number of layers is too large? Or are these different shades of red, and I'm just not recognizing the difference? 14:10, 30 September 2018 (UTC) 37.201.181.41. Are there additional references or examples in this page's archives? Thanks in advance. --this documentation pageI could not find out more from You can specify the colour you want to assign to a range using BIND. For example, BIND(IF(?population > 1000000000, "FF0000","") AS ?rgb) will display the countries with a population of over 1 billion as red. You will need to do the same thing for each population range and assign an rgb colour to each. If you don't specify the colours they change each time the query runs. Please see the example query below:

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Locations depicted in Welsh Landscape Collection, on map
#defaultView:Map{"hide":["?geo", "?rgb", "?layer"],"markercluster": true}
SELECT DISTINCT ?geo ?subj ?depicts 
(SAMPLE(?sLabel) AS ?subjLabel) 
(SAMPLE(?dLabel) AS ?depictsLabel)
(SAMPLE(?pic) AS ?pic) 
(SAMPLE(?layer) AS ?layer) 
(SAMPLE(?rgb) AS ?rgb)  
WHERE {

  ?subj wdt:P361 wd:Q21542493 ;
        wdt:P180 ?depicts .
        OPTIONAL{ ?subj wdt:P18 ?pic . }

  ?depicts wdt:P3896 ?geo ;
           wdt:P31 ?is .  
           VALUES ?is { wd:Q23413 wd:Q160742 wd:Q2977 wd:Q39715 wd:Q16970 wd:Q19844914 wd:Q1802963 wd:Q16884952 }

  BIND(
    IF(?is = wd:Q23413, "castle",
    IF(?is = wd:Q160742, "abbey",
    IF(?is = wd:Q2977, "cathedral",
    IF(?is = wd:Q39715, "lighthouse",
    IF(?is = wd:Q16970, "church",  
    IF(?is = wd:Q19844914, "college",
    IF(?is = wd:Q1802963, "country house",
    IF(?is = wd:Q16884952, "country house",
           "")))))))) AS ?layer).

  BIND(
    IF(?is = wd:Q23413, "FF0000",
    IF(?is = wd:Q160742, "0080FF",
    IF(?is = wd:Q2977, "00FF00",
    IF(?is = wd:Q39715, "FF00FF",
    IF(?is = wd:Q16970, "FFFF00",  
    IF(?is = wd:Q19844914, "808080",
    IF(?is = wd:Q1802963, "80ffff",
    IF(?is = wd:Q16884952, "80ffff",
           "")))))))) AS ?rgb).

  SERVICE wikibase:label { bd:serviceParam wikibase:language "en". 
         ?subj rdfs:label ?sLabel .                
         ?depicts rdfs:label ?dLabel .   }
}
GROUP BY ?geo ?subj ?depicts

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v9("?dLabel"):::projected v2("?depicts"):::projected v11("?depictsLabel") v4("?geo"):::projected v6("?is") v12("?layer"):::projected v12("?pic"):::projected v12("?rgb"):::projected v8("?sLabel"):::projected v1("?subj"):::projected v10("?subjLabel") c8(["bd:serviceParam"]):::iri c10(["en"]):::literal c2(["wd:Q21542493"]):::iri v1 --"wdt:P361"--> c2 v1 --"wdt:P180"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P18".-> v12 end v2 --"wdt:P3896"--> v4 v2 --"wdt:P31"--> v6 bind0[/VALUES ?is/] bind0-->v6 bind00(["wd:Q23413"]) bind00 --> bind0 bind01(["wd:Q160742"]) bind01 --> bind0 bind02(["wd:Q2977"]) bind02 --> bind0 bind03(["wd:Q39715"]) bind03 --> bind0 bind04(["wd:Q16970"]) bind04 --> bind0 bind05(["wd:Q19844914"]) bind05 --> bind0 bind06(["wd:Q1802963"]) bind06 --> bind0 bind07(["wd:Q16884952"]) bind07 --> bind0 bind1[/"if(?is = 'wd:Q23413','castle',if(?is = 'wd:Q160742','abbey',if(?is = 'wd:Q2977','cathedral',if(?is = 'wd:Q39715','lighthouse',if(?is = 'wd:Q16970','church',if(?is = 'wd:Q19844914','college',if(?is = 'wd:Q1802963','country house',if(?is = 'wd:Q16884952','country house',''))))))))"/] v6 --o bind1 bind1 --as--o v12 bind2[/"if(?is = 'wd:Q23413','FF0000',if(?is = 'wd:Q160742','0080FF',if(?is = 'wd:Q2977','00FF00',if(?is = 'wd:Q39715','FF00FF',if(?is = 'wd:Q16970','FFFF00',if(?is = 'wd:Q19844914','808080',if(?is = 'wd:Q1802963','80ffff',if(?is = 'wd:Q16884952','80ffff',''))))))))"/] v6 --o bind2 bind2 --as--o v12 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 v1 --"rdfs:label"--> v8 v2 --"rdfs:label"--> v9 end bind8[/"sample(?sLabel)"/] v8 --o bind8 bind8 --as--o v10 bind9[/"sample(?dLabel)"/] v9 --o bind9 bind9 --as--o v11 bind10[/"sample(?pic)"/] v12 --o bind10 bind10 --as--o v12 bind11[/"sample(?layer)"/] v12 --o bind11 bind11 --as--o v12 bind12[/"sample(?rgb)"/] v12 --o bind12 bind12 --as--o v12