query-6b568615f29a7d4816c01e4a5b519c64

rq turtle/ttl

Bathing waters in protected areas in Swedenwe have Swedish Nature reserves with geojson

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 Bathing waters in a Nature reserve
#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:Q106774536.
   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; v3("?BathId"):::projected v9("?Hav"):::projected v8("?HavsAPI"):::projected v10("?Nat"):::projected v5("?NatReg"):::projected v12("?coord"):::projected v2("?node"):::projected v4("?plats"):::projected v1("?platsLabel"):::projected v11("?qid") v7("?shape"):::projected c9(["bd:serviceParam"]):::iri c11(["sv"]):::literal c2(["wd:Q106774536"]):::iri v2 --"wdt:P6104"--> c2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P9616".-> v3 end v2 --"wdt:P3018"--> v4 v4 --"wdt:P3613"--> v5 v2 --"wdt:P625"--> v12 v4 --"wdt:P3896"--> v7 bind0[/"concat('https://badplatsen.havochvatten.se/badplatsen/api/detail/',?BathId)"/] v3 --o bind0 bind0 --as--o v8 bind1[/"concat('https://badplatsen.havochvatten.se/badplatsen/karta/#/bath/',?BathId)"/] v3 --o bind1 bind1 --as--o v9 bind2[/"concat('http://skyddadnatur.naturvardsverket.se/sknat/?nvrid=',?NatReg)"/] v5 --o bind2 bind2 --as--o v10 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 v11 bind5[/"sample(?coord)"/] v12 --o bind5 bind5 --as--o v12