Opened 8 years ago
Last modified 8 years ago
#15264 closed enhancement
Add support for OSM+Wikidata SPARQL queries — at Initial Version
| Reported by: | nyurik | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Plugin wikipedia | Version: | |
| Keywords: | Cc: |
Description
The new OSM+Wikidata service offers a new approach to improve the quality of existing OSM data.
https://wiki.openstreetmap.org/wiki/Wikidata%2BOSM_SPARQL_query_service
The service has both OSM data as well as a full copy of Wikidata database, plus it includes information for the Wikipedia pageviews - allowing queries for the popularity of articles. The service uses SPARQL - a well known, standardized SQL-like language for graph databases. Numerous example queries, accessible directly from the service, would show some of the service capabilities. While the service can show things as a graph or a map, JOSM's integration would only need a simple table output. The service is actually an adaptation of Wikidata's existing storage, plus some OSM-specific features and data.
Implementation:
The easiest would be to simply look at all the returned columns, and use all value URIs that begin with a known prefix, e.g. <http://www.openstreetmap.org/node/2681940767> -- and then perform "download objects by IDs".
Geometry info:
Unlike OverpassTurbo, this service does not store or process geometries. Instead, it stores most object's centroids as a single point. I could fairly easily add bounding box storage (store two additional points per object), and queries can use geo searching functions.
https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries#Places_between_Arc_de_Triomphe_.28Q64436.29_and_Louvre_.28Q19675.29
has a few wikidata examples for using bounding box - JOSM could expand {{bbox}} into
bd:serviceParam wikibase:cornerWest "Point(2.295 48.8738)"geo:wktLiteral .
bd:serviceParam wikibase:cornerEast "Point(2.33575 48.861088888)"geo:wktLiteral .
and it could expand {{center}} into "Point(2.33575 48.861088888)"geo:wktLiteral constant.


