query-ac0b0d26e24188f8cb3618881ea9edb8
Discussion Request process 23:54, 13 October 2017 (UTC)) talk (Pasleim the remaining items have actually no precision set but the query service assigns the arbitrary precision of 1/3600. -- Done18:49, 16 October 2017 (UTC)) talk (Jarekt , This is great. Thank you. Any chance with no precision set can be changed to prec =1 degree? Also below I have query for finding items that should have their precision increased to an arcminute. Any chance you can tackle that challenge. I found some cases where coordinates imported from different Wikipedias differed only by precision and fixing it made them identical. That might be a subject of a new query and bot job, but eventually such coordinates should be merged. --Pasleim
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
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 bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?coord ?prec
WHERE
{
?item p:P625 ?coordinate.
?coordinate ps:P625 ?coord.
?coordinate psv:P625 ?coordinate_node.
?coordinate_node wikibase:geoLongitude ?lon.
?coordinate_node wikibase:geoLatitude ?lat.
?coordinate_node wikibase:geoPrecision ?prec.
FILTER (?lat=ROUND(?lat*60)/60) . # latitude with 1 minute precision
FILTER (?lon=ROUND(?lon*60)/60) . # longitude with 1 minute precision
FILTER (?prec<1/60) . # measurement precision less then one arcminute
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
} limit 5000
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?coord"):::projected
v5("?coordinate")
v7("?coordinate_node")
v4("?item"):::projected
v3("?lat")
v2("?lon")
v1("?prec"):::projected
c10(["bd:serviceParam"]):::iri
c12(["en"]):::literal
f0[["?prec < '1^^xsd:integer' / '60^^xsd:integer'"]]
f0 --> v1
f1[["?lon = numeric-round(?lon * '60^^xsd:integer') / '60^^xsd:integer'"]]
f1 --> v2
f2[["?lat = numeric-round(?lat * '60^^xsd:integer') / '60^^xsd:integer'"]]
f2 --> v3
v4 --"p:P625"--> v5
v5 --"p:statement/P625"--> v6
v5 --"p:statement/value/P625"--> v7
v7 --"wikibase:geoLongitude"--> v2
v7 --"wikibase:geoLatitude"--> v3
v7 --"wikibase:geoPrecision"--> v1
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end