query-ab11065d87f940348f1216863fe51374

rq turtle/ttl

Map of of Outdoor gyms with/without an image in WikidataWikishootMewith link

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: Outdoor Gyms with pictures in Wikidata
#defaultView:Map{"hide":["?coord"], "layer": "?layer"}
SELECT ?node ?nodeLabel ?nodeDescription ?WikiShootMe ?layer ?countryLabel 
(SAMPLE(?coord) AS ?coord) 
(SAMPLE(?img) AS ?img) 
(SAMPLE(?web) AS ?web) WHERE {

  ?node wdt:P6104 wd:Q107186275
  OPTIONAL { ?node wdt:P18 ?img. }
  OPTIONAL { ?node wdt:P17 ?country. }
  OPTIONAL { ?node wdt:P856 ?web. }
  ?node wdt:P625 ?coord.

  BIND(IF(BOUND(?img), "Picture", "Missing picture") AS ?layer)
  BIND(URI(CONCAT("https://wikishootme.toolforge.org/#q=", REPLACE(STR(?node), "http://www.wikidata.org/entity/", ""))) AS ?WikiShootMe)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "en,sv". }
}
GROUP BY ?node ?nodeLabel ?nodeDescription  ?countryLabel ?layer ?WikiShootMe

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v7("?WikiShootMe"):::projected v8("?coord"):::projected v3("?country") v8("?img"):::projected v6("?layer"):::projected v1("?node"):::projected v8("?web"):::projected c8(["bd:serviceParam"]):::iri c10(["en,sv"]):::literal c2(["wd:Q107186275"]):::iri v1 --"wdt:P6104"--> c2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P18".-> v8 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P17".-> v3 end subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v1 -."wdt:P856".-> v8 end v1 --"wdt:P625"--> v8 bind0[/"if(bound(?img),'Picture','Missing picture')"/] v8 --o bind0 bind0 --as--o v6 bind1[/"concat('https://wikishootme.toolforge.org/#q=',replace(str(?node),'http://www.wikidata.org/entity/',''))"/] v1 --o bind1 bind1 --as--o v7 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c8 --"wikibase:language"--> c10 end bind5[/"sample(?coord)"/] v8 --o bind5 bind5 --as--o v8 bind6[/"sample(?img)"/] v8 --o bind6 bind6 --as--o v8 bind7[/"sample(?web)"/] v8 --o bind7 bind7 --as--o v8