Page MenuHomePhabricator

Display point features (coordinates) from the results of a SPARQL query on a map in Wikipedia
Open, LowPublic

Assigned To
None
Authored By
Ayack
Feb 26 2018, 6:12 PM
Tokens
"Mountain of Wealth" token, awarded by geraki."Mountain of Wealth" token, awarded by Sabas88."Burninate" token, awarded by Rehman."Burninate" token, awarded by Spinster."Like" token, awarded by Liuxinyu970226.

Description

On https://query.wikidata.org/, you can easily display the result of a query on a dynamic map (see the Venues in Broadway for example). But if you want to add this map to Wikipedia or any other Wikimedia project, you can't (except if you take a screenshot..).

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Ayack renamed this task from Display results of a SPARQL query on a map to Display results of a SPARQL query on a map in Wikipedia.Feb 26 2018, 6:13 PM

It is possible look here for example:
https://de.wikivoyage.org/wiki/Spiekeroog

@Yurik can explain you how it works.

It is possible look here for example:
https://de.wikivoyage.org/wiki/Spiekeroog

I see only one map in this page which (if I'm not wrong) is not based on a SPARQL query. Are you sure this is the right page?

@Evad37 has just confirmed here that this is not currently possible.

Since Kartographer already supports SPARQL queries (for geoshapes) and fetching coordinates from Wikidata based on a fixed list of Wikidata ids, I assume that it shouldn't be such a big change to display the results of a SPARQL query as geopoints on a map. WDQ already do that very well.

To clarify, what is wanted is a new external data service that takes in a query, looks up the P625 for each item from the query, and displays these as point features on a map
(in a similar way to how point features are displayed for geoJSON like { "type": "Point", "coordinates": [-150, 64] })

Basically, we should be able to use syntax like

<mapframe>
{
  "type": "ExternalData",
  "service": "geopoint",
  "query": "
// query goes here
"}
</mapframe>

to display point features based on wikidata coordinates, without having to know the wikidata ids in advance.

It would also be nice if there was a way to individually specify the Maki marker image, similar to how the geoshape example can specify fill colours for shapes.

Plus if there was also a way to just specify one or more wikidata ids without a query, then T178321 could be solved without having to use Lua.

Evad37 renamed this task from Display results of a SPARQL query on a map in Wikipedia to Display point features (coordinates) from the results of a SPARQL query on a map in Wikipedia.Jun 8 2018, 3:40 AM
MSantos moved this task from Unsorted to Feature requests on the Maps (Kartographer) board.

I want this too. Actually a deceptively simple thing that would be quite useful on Wikimedia Commons as well.

For instance, on gallery pages about artist James Ensor I want to include dynamic Wikidata-driven maps indicating the cultural institutions that have his works in their collection (simple query), where the map auto-updates as we add more works (and corresponding collections/institutions) on Wikidata.