query-5d7a53e31e09471179c80eb52abb845f
Select the ItemId, label and coordinate location SELECT ?place ?placeLabel ?location ?p821 WHERE { # Use the around service SERVICE wikibase:around { # Looking for items with coordinate locations(P625) ?place wdt:P625 ?location . # That are in a circle with a centre at this point bd:serviceParam wikibase:center "Point(-52.8118056 47.5195306)"^^geo:wktLiteral . # Where the circle has a specified radius in km bd:serviceParam wikibase:radius "10" . } # Use the label service to get the English label SERVICE wikibase:label { bd:serviceParam wikibase:language "en" . } FILTER NOT EXISTS {?place wdt:P821 []} }
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX geo: <http://www.opengis.net/ont/geosparql#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Select the ItemId, label and coordinate location
SELECT ?place ?placeLabel ?location ?p821 WHERE {
# Use the around service
SERVICE wikibase:around {
# Looking for items with coordinate locations(P625)
?place wdt:P625 ?location .
# That are in a circle with a centre at this point
bd:serviceParam wikibase:center "Point(-52.8118056 47.5195306)"^^geo:wktLiteral .
# Where the circle has a specified radius in km
bd:serviceParam wikibase:radius "10" .
}
# Use the label service to get the English label
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
FILTER NOT EXISTS {?place wdt:P821 []}
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?location"):::projected
v1("?place"):::projected
a1((" "))
c4(["bd:serviceParam"]):::iri
c6([sPoint(-52.8118056 47.5195306)^^<http://www.opengis.net/ont/geosparql#wktLiteral>"]):::literal
c11(["en"]):::literal
c8(["10"]):::literal
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P821"--> e0a1
e0v1("?place"):::projected
e0a1((" ")):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> a1
v1 --"wdt:P821"--> a1
subgraph s1["http://wikiba.se/ontology#around"]
style s1 stroke-width:4px;
v1 --"wdt:P625"--> v2
c4 --"wikibase:center"--> c6
c4 --"wikibase:radius"--> c8
end
subgraph s2["http://wikiba.se/ontology#label"]
style s2 stroke-width:4px;
c4 --"wikibase:language"--> c11
end