query-e0c503c4ba062028825af388eb013a24

rq turtle/ttl

Show Members and Applcants as Map

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
SELECT DISTINCT ?wLabel (SAMPLE(?geo) AS ?geo) ?rgb ?layer
WHERE 
{
   {
   ?w wdt:P463 wd:Q105757481 .
   {?w wdt:P625 ?geo} UNION {?w wdt:P276 ?ort . ?ort wdt:P625 ?geo .} UNION 
   {?w wdt:P159 ?hauptverwaltung . ?hauptverwaltung wdt:P625 ?geo .} UNION 
   {?w wdt:P131 ?verwaltungseinheit . ?verwaltungseinheit wdt:P625 ?geo .}
   } UNION {
     ?p wdt:P31 wd:Q98270496 . 
     ?p wdt:P1416 ?w .
     ?w wdt:P625 ?geo .
   }
   BIND(
    IF(bound(?p), "Member",
    IF(!bound(?p), "Applicant",
    "other"))
    AS ?layer).
    BIND(
    IF(bound(?p), "000000",
    IF(!bound(?p), "DE1A3B",
    "other"))
    AS ?rgb).
  SERVICE wikibase:label { bd:serviceParam wikibase:language "de,en" . }
} GROUP BY ?wLabel ?layer ?rgb
ORDER BY ASC(?wLabel)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v10("?geo"):::projected v5("?hauptverwaltung") v8("?layer"):::projected v4("?ort") v7("?p") v9("?rgb"):::projected v6("?verwaltungseinheit") v2("?w") v1("?wLabel"):::projected c2(["wd:Q105757481"]):::iri c11(["bd:serviceParam"]):::iri c13(["de,en"]):::literal c8(["wd:Q98270496"]):::iri subgraph union0[" Union "] subgraph union0l[" "] style union0l fill:#abf,stroke-dasharray: 3 3; v7 --"wdt:P31"--> c8 v7 --"wdt:P1416"--> v2 v2 --"wdt:P625"--> v10 end subgraph union0r[" "] style union0r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P463"--> c2 subgraph union1[" Union "] subgraph union1l[" "] style union1l fill:#abf,stroke-dasharray: 3 3; subgraph union2[" Union "] subgraph union2l[" "] style union2l fill:#abf,stroke-dasharray: 3 3; subgraph union3[" Union "] subgraph union3l[" "] style union3l fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P131"--> v6 v6 --"wdt:P625"--> v10 end subgraph union3r[" "] style union3r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P159"--> v5 v5 --"wdt:P625"--> v10 end union3r <== or ==> union3l end end subgraph union2r[" "] style union2r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P276"--> v4 v4 --"wdt:P625"--> v10 end union2r <== or ==> union2l end end subgraph union1r[" "] style union1r fill:#abf,stroke-dasharray: 3 3; v2 --"wdt:P625"--> v10 end union1r <== or ==> union1l end end union0r <== or ==> union0l end bind0[/"if(bound(?p),'Member',if(not bound(?p),'Applicant','other'))"/] v7 --o bind0 bind0 --as--o v8 bind1[/"if(bound(?p),'000000',if(not bound(?p),'DE1A3B','other'))"/] v7 --o bind1 bind1 --as--o v9 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end bind3[/"sample(?geo)"/] v10 --o bind3 bind3 --as--o v10