Page MenuHomePhabricator

Create a map-on-the-fly feature for people and objects for Wikidata items
Open, LowestPublic


With all of the various ways to use maps these days, we should be able to do this too. See for example this feature enabled for people on the RKD website (e.g. Rembrandt moved from Leiden to Amsterdam and also for artworks (e.g. this painting by Rembrandt Note how his works travel much farther than he did. All this does now is plot the locations in the record and plot a line between them.

Event Timeline


@mxn has created a script that can be used for logged in accounts on Wikidata to add in a map for objects that have coordinates. The script can be added to your common.js file on Wikidata:
mw.loader.load( '//' );

and when landing on the page for Leiden, you'll see a map like this:

wikidata-sample_leiden.png (795×513 px, 354 KB)

Now, this isn't exactly what you're refering to, but maybe some collaboration can take place starting with the script that @mxn has created. :)

Multichill added a subscriber: Smalyshev.

I was talking about this with Jane earlier. Focus of this task is . Here we have ways to visualize queries. These are described at . Here we request to implement a new view so we can do a query which returns combinations of coordinates and timestamps, and visualize that like the RKD example.

The RKD example uses Leaflet and that's what we are also using for the maps in the query service so I wonder how much tweaking needs to be done to get this working in the query service.

Yes that map for Leiden looks interesting on a per-location basis. I really like the idea of connecting the dots however. It also gives people some motivation to type in the places artists lived and worked, rather than just stopping at the birth and death places.

Aklapper renamed this task from Create a map-on-the-fly feature for people and obects for Wikidata items to Create a map-on-the-fly feature for people and objects for Wikidata items.Oct 5 2017, 8:08 PM

You could combine Result Views to build something like Scholia by @Fnielsen

It is very ease to create such a SPARQL driven app with some basic knowledge of HTML and JavaScript.
This might be also an interesting project for the upcoming hackathon.

Yes, see for instance here for Johannes V. Jensen or here for awards. At present Scholia is mostly for science and scientist though it will also work for Rembrandt, see

Hmm that is nice, that doesn't seem to work too well for Rembrandt. I guess his paintings have traveled too far over time. I like the plot of the places of residence, but it would be nice to have them plotted with lines in order of residence. We have lots of people on Wikidata (not just painters) who unlike Rembrandt, were born in one country, lived in another country, and died in yet some other country. Sometimes location data helps to get these people onto the radar of various nationally-oriented wikiprojects. I didn't know that Descartes lived for a short while within bicycling distance of my house. It made me look at his work in a different way.

"but it would be nice to have them plotted with lines in order of residence". This is not support by WDQS at the moment AFAIK. If you want that you might want such a specific functionality you might want to create a specific task and perhaps @Jonas could look into that at some point.

The WMF maps team won't have bandwidth to work on this in the foreseeable future. WMDE or volunteer patches welcome.

Jhernandez triaged this task as Lowest priority.Aug 7 2018, 3:12 PM

See this query: for an example of how to draw lines on a WDQS results map, based on values from variables in a WDQS query (in this case, drawing the bounding boxes of some maps)

The trick is to use CONCAT( ) to write the relevant data you want into a string of the right format, and then STRDT ( ) to promote the string to type geo:wktLiteral

See :en:Well-known text for some of the geometric shapes this makes available, eg lines, polygons, curves, etc.

Based on the responses this task description needs updating to make clear what the end result should be.

Here is one I did for JVJ's residence based on the @Jheald approach:

Very nice!

It's interesting that the sort-order in the subquery is preserved by the GROUP_CONCAT. (So eg this query works:

I'm not sure that the SPARQL standard guarantees this, indeed I thought I could remember @Lucas_Werkmeister_WMDE complaining that there seemed to be no way to ensure it. But it does indeed appear to work, so many thanks @Fnielsen for showing this is how it can be done.

Here's a very slightly tweaked version of @Fnielsen 's query -- this time workplaces of society portrait painter Philip de Laszlo, showing points as well as lines: