query-fc6daa86458bdc47cb20ec8f8ad31c21

rq turtle/ttl

TODO

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX geof: <http://www.opengis.net/def/function/geosparql/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# coses segons el municipi
SELECT ?instLabel ?item ?itemLabel  ?layer ?layerLabel ?coord WHERE {
  ?item wdt:P17 wd:Q29.
  ?item wdt:P625 ?coord.
  wd:Q85692793 wdt:P625 ?centre.
  FILTER(geof:distance(?coord, ?centre) < 15).
  OPTIONAL {
    ?item wdt:P31 ?inst.
  }
  OPTIONAL {
    ?item wdt:P131* ?layer.
    ?layer wdt:P31 wd:Q33146843.
  }
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language "[AUTO_LANGUAGE],ca,en,es,fr,de" . 
  }
}
#defaultView:Map

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?centre") v1("?coord"):::projected v4("?inst") v3("?item"):::projected v5("?layer"):::projected c5(["wd:Q85692793"]):::iri c3(["wd:Q29"]):::iri c10(["bd:serviceParam"]):::iri c8(["wd:Q33146843"]):::iri c12(["#91;AUTO_LANGUAGE#93;,ca,en,es,fr,de"]):::literal f0[["http://www.opengis.net/def/function/geosparql/distance(?coord,?centre) < '15^^xsd:integer'"]] f0 --> v1 f0 --> v2 v3 --"wdt:P17"--> c3 v3 --"wdt:P625"--> v1 c5 --"wdt:P625"--> v2 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P31".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P131".-> v5 v5 --"wdt:P31"--> c8 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end