query-f24311ac191f0031bc98b4027e36e4a9
TODO
Use at
- https://query.wikidata.org/sparql
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#>
SELECT ?item ?itemLabel ?coord ?place ?placeLabel ?location ?dist
WHERE
{
?item wdt:P31/wdt:P279* wd:Q12323.
?item wdt:P625 ?coord.
?item wdt:P17 wd:Q17
BIND (geof:longitude(?coord) AS ?long)
FILTER (?long > 136)
FILTER (?long < 138)
SERVICE wikibase:around {
?place wdt:P625 ?location .
bd:serviceParam wikibase:center ?coord .
bd:serviceParam wikibase:radius "10.00001" .
bd:serviceParam wikibase:distance ?dist.
}
?place wdt:P31 wd:Q12323.
filter(str(?item) < str(?place))
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?coord"):::projected
v6("?dist"):::projected
v1("?item"):::projected
v5("?location"):::projected
v5("?long")
v2("?place"):::projected
a1((" "))
c8(["wd:Q17"]):::iri
c10(["bd:serviceParam"]):::iri
c17(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c13(["10.00001"]):::literal
c5(["wd:Q12323"]):::iri
f0[["str(?item) < str(?place)"]]
f0 --> v1
f0 --> v2
f1[["?long < '138^^xsd:integer'"]]
f1 --> v5
f2[["?long > '136^^xsd:integer'"]]
f2 --> v5
v1 --"wdt:P31"--> a1
a1 --"wdt:P279"--> c5
v1 --"wdt:P625"--> v4
v1 --"wdt:P17"--> c8
bind3[/"http://www.opengis.net/def/function/geosparql/longitude(?coord)"/]
v4 --o bind3
bind3 --as--o v5
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v2 --"wdt:P625"--> v5
c10 --"wikibase:center"--> v4
c10 --"wikibase:radius"--> c13
c10 --"wikibase:distance"--> v6
end
v2 --"wdt:P31"--> c5
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c10 --"wikibase:language"--> c17
end