query-0b174a6238c39cb47693ec7b1c91155a
TODO
Use at
- https://query.wikidata.org/sparql
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#>
#defaultView:Map
SELECT ?item ?labelsv ?coord (?color as ?layer) ?size
WHERE
{
?item wdt:P31/wdt:P279* wd:Q23442.
VALUES ?orter {wd:Q1010550 wd:Q596607 wd:Q216790 wd:Q633371 wd:Q179726 wd:Q179706 wd:Q179739 wd:Q179730}
?item wdt:P131 ?orter.
?item wdt:P625 ?coord.
?item rdfs:label ?labelsv . filter (lang(?labelsv) = "sv").
BIND(
IF(regex(?labelsv, "land", "i"), "green",
IF(regex(?labelsv, "holm", "i"), "green",
IF(regex(?labelsv, "skär", "i"), "blue",
IF(regex(?labelsv, "klobb", "i"), "blue",
IF(regex(?labelsv, "grund", "i"), "red",
IF(regex(?labelsv, "haru", "i"), "red",
IF(regex(?labelsv, "häll", "i"), "red",
IF(regex(?labelsv, "kläpp", "i"), "red",
IF(regex(?labelsv, "kobb", "i"), "red",
IF(regex(?labelsv, "gadd", "i"), "red",
IF(regex(?labelsv, "blek", "i"), "red",
IF(regex(?labelsv, "båda", "i"), "red",
IF(regex(?labelsv, "grynn", "i"), "red",
IF(regex(?labelsv, "rev", "i"), "red",
IF(regex(?labelsv, "ör", "i"), "blue",
IF(regex(?labelsv, "ön?$", "i"), "green",
"black"))))))))))))))))
AS ?color).
BIND(20 AS ?size)
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?color"):::projected
v4("?coord"):::projected
v2("?item"):::projected
v1("?labelsv"):::projected
v7("?layer")
v3("?orter")
v6("?size"):::projected
a1((" "))
c4(["wd:Q23442"]):::iri
f0[["?labelsv = 'sv'"]]
f0 --> v1
v2 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c4
bind1[/VALUES ?orter/]
bind1-->v3
bind10(["wd:Q1010550"])
bind10 --> bind1
bind11(["wd:Q596607"])
bind11 --> bind1
bind12(["wd:Q216790"])
bind12 --> bind1
bind13(["wd:Q633371"])
bind13 --> bind1
bind14(["wd:Q179726"])
bind14 --> bind1
bind15(["wd:Q179706"])
bind15 --> bind1
bind16(["wd:Q179739"])
bind16 --> bind1
bind17(["wd:Q179730"])
bind17 --> bind1
v2 --"wdt:P131"--> v3
v2 --"wdt:P625"--> v4
v2 --"rdfs:label"--> v1
bind2[/"if(regex(?labelsv,'land','i'),'green',if(regex(?labelsv,'holm','i'),'green',if(regex(?labelsv,'skär','i'),'blue',if(regex(?labelsv,'klobb','i'),'blue',if(regex(?labelsv,'grund','i'),'red',if(regex(?labelsv,'haru','i'),'red',if(regex(?labelsv,'häll','i'),'red',if(regex(?labelsv,'kläpp','i'),'red',if(regex(?labelsv,'kobb','i'),'red',if(regex(?labelsv,'gadd','i'),'red',if(regex(?labelsv,'blek','i'),'red',if(regex(?labelsv,'båda','i'),'red',if(regex(?labelsv,'grynn','i'),'red',if(regex(?labelsv,'rev','i'),'red',if(regex(?labelsv,'ör','i'),'blue',if(regex(?labelsv,'ön?$','i'),'green','black'))))))))))))))))"/]
v1 --o bind2
bind2 --as--o v5
bind3[/"'20^^xsd:integer'"/]
bind3 --as--o v6
bind4[/"?color"/]
v5 --o bind4
bind4 --as--o v7