query-182d41ae0b583c428a846c7a89859d5b

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 psv: <http://www.wikidata.org/prop/statement/value/>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?place (sample(?latitude) as ?latitude) (sample(?longitude) as ?longitude)
WHERE {
  ?place_sub wdt:P279* wd:Q811979 .
  ?place wdt:P31 ?place_sub.
  SERVICE wikibase:around { 
    ?place wdt:P625 ?location.
    bd:serviceParam wikibase:center "Point(13.5812565 52.5153623)"^^geo:wktLiteral .
    bd:serviceParam wikibase:radius "5" .
    }
  ?place p:P625 ?statement .
  ?statement ps:P625 ?value.
  filter (?value=?location)
  ?statement psv:P625 ?coordinate_node .
  ?coordinate_node wikibase:geoLatitude ?latitude .
  ?coordinate_node wikibase:geoLongitude ?longitude . 
} group by ?place

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?coordinate_node") v9("?latitude"):::projected v2("?location") v9("?longitude"):::projected v4("?place"):::projected v3("?place_sub") v5("?statement") v1("?value") c8([sPoint(13.5812565 52.5153623)^^<http://www.opengis.net/ont/geosparql#wktLiteral>"]):::literal c2(["wd:Q811979"]):::iri c6(["bd:serviceParam"]):::iri c10(["5"]):::literal f0[["?value = ?location"]] f0 --> v1 f0 --> v2 v3 --"p:direct/P279"--> c2 v4 --"p:direct/P31"--> v3 subgraph s1["http://wikiba.se/ontology#around"] style s1 stroke-width:4px; v4 --"p:direct/P625"--> v2 c6 --"wikibase:center"--> c8 c6 --"wikibase:radius"--> c10 end v4 --"p:P625"--> v5 v5 --"p:statement/P625"--> v1 v5 --"p:statement/value/P625"--> v6 v6 --"wikibase:geoLatitude"--> v9 v6 --"wikibase:geoLongitude"--> v9 bind3[/"sample(?latitude)"/] v9 --o bind3 bind3 --as--o v9 bind4[/"sample(?longitude)"/] v9 --o bind4 bind4 --as--o v9