query-2c8a719c998e19966481f7aba8c2db9c

rq turtle/ttl

Outdoor gyms at bathwaters

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#>
#title: Swedish Outdoor gyms next to a bath water
#defaultView:Map{"hide":["?coord","?layer"], "layer": "?platsLabel"}
SELECT ?node (REPLACE(STR(?node), ".*Q", "Q") AS ?qid) ?nodeLabel ?nodeDescription ?BathId ?Hav  ?adminLabel ?HavsAPI
(SAMPLE(?coord) AS ?coord) ?plats ?platsLabel ?NatReg ?Nat ?shape WHERE {
   ?node wdt:P6104 wd:Q107186275.
?item  wdt:P6104 wd:Q107186275.
   OPTIONAL {?node wdt:P9616 ?BathId}
   {?node wdt:P3018  ?plats.
   ?plats wdt:P3613 ?NatReg}
   ?node wdt:P625 ?coord.
   ?plats wdt:P3896 ?shape      
  BIND (URI(CONCAT("https://badplatsen.havochvatten.se/badplatsen/api/detail/",?BathId)) AS ?HavsAPI)
  BIND(URI(CONCAT("https://badplatsen.havochvatten.se/badplatsen/karta/#/bath/",?BathId)) AS ?Hav)
  BIND(URI(CONCAT("http://skyddadnatur.naturvardsverket.se/sknat/?nvrid=",?NatReg)) AS ?Nat)

SERVICE wikibase:label { bd:serviceParam wikibase:language "sv". }
} Group By 
?node ?nodeLabel ?nodeDescription ?BathId  ?adminLabel  ?HavsAPI ?Hav ?NatReg ?plats ?platsLabel ?Nat ?shape
order by ?platsLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?BathId"):::projected v10("?Hav"):::projected v9("?HavsAPI"):::projected v11("?Nat"):::projected v6("?NatReg"):::projected v13("?coord"):::projected v3("?item") v2("?node"):::projected v5("?plats"):::projected v1("?platsLabel"):::projected v12("?qid") v8("?shape"):::projected c9(["bd:serviceParam"]):::iri c11(["sv"]):::literal c2(["wd:Q107186275"]):::iri v2 --"wdt:P6104"--> c2 v3 --"wdt:P6104"--> c2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P9616".-> v4 end v2 --"wdt:P3018"--> v5 v5 --"wdt:P3613"--> v6 v2 --"wdt:P625"--> v13 v5 --"wdt:P3896"--> v8 bind0[/"concat('https://badplatsen.havochvatten.se/badplatsen/api/detail/',?BathId)"/] v4 --o bind0 bind0 --as--o v9 bind1[/"concat('https://badplatsen.havochvatten.se/badplatsen/karta/#/bath/',?BathId)"/] v4 --o bind1 bind1 --as--o v10 bind2[/"concat('http://skyddadnatur.naturvardsverket.se/sknat/?nvrid=',?NatReg)"/] v6 --o bind2 bind2 --as--o v11 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c9 --"wikibase:language"--> c11 end bind4[/"replace(str(?node),'.*Q','Q')"/] v2 --o bind4 bind4 --as--o v12 bind5[/"sample(?coord)"/] v13 --o bind5 bind5 --as--o v13