query-c8510ce604a7bbb74e2c85b2f992c9cc

rq turtle/ttl

Outdoor gyms with no coordinates on a MapQuery finding the Administrative location of a outdoor gym with no coordinate Nota Bene the layer option will just show one item per coordinate

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: map where we have outdoor gyms missing coordinates 
#defaultView:Map{"hide":["?coord","?layer"], "layer": "?adminLabel"}
SELECT ?item ?itemLabel ?itemDescription ?adminLabel ?www ?coordAdmin ?email WHERE {
  ?item wdt:P6104 wd:Q107186275.

  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "sv,en,de" . 
  }

OPTIONAL { ?item wdt:P131 ?country. }
OPTIONAL { ?item wdt:P131 ?admin. 
         ?admin wdt:P625 ?coordAdmin.
         OPTIONAL {?admin wdt:P968 ?email}
         }
OPTIONAL { ?item wdt:P856 ?www. }
minus { ?item wdt:P625 ?coord. }
OPTIONAL { ?item wdt:P217 ?id. }

} order by ?adminLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?admin") v1("?adminLabel"):::projected v8("?coord") v5("?coordAdmin"):::projected v3("?country") v6("?email"):::projected v9("?id") v2("?item"):::projected v7("?www"):::projected c4(["bd:serviceParam"]):::iri c6(["sv,en,de"]):::literal c2(["wd:Q107186275"]):::iri v2 --"wdt:P6104"--> c2 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c4 --"wikibase:language"--> c6 end subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P131".-> v3 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P131".-> v4 v4 --"wdt:P625"--> v5 subgraph optional2["(optional)"] style optional2 fill:#bbf,stroke-dasharray: 5 5; v4 -."wdt:P968".-> v6 end end subgraph optional3["(optional)"] style optional3 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P856".-> v7 end subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P625"--> v8 end subgraph optional4["(optional)"] style optional4 fill:#bbf,stroke-dasharray: 5 5; v2 -."wdt:P217".-> v9 end