Page MenuHomePhabricator

Add location data to summaries
Closed, ResolvedPublic

Description

The summary endpoint is a great way to get metadata about a page that is useful to display to users to help them decide if they would like to read an article.

Location data is increasingly being added to designs for apps. We have nearby in Android, and v2 of the feature "Places" set to be released on iOS this quarter. This update includes both search and the ability to see top read articles on a map.

Just like wikidata description and thumb, these are starting to become a basic piece of data that clients may want to display in many other contexts.

This leads to the question: Is it feasible to return location data in the summary of articles?

How would this affect caching / cache invalidation / storage / CPU?

This ticket is intentionally very similar to:
T157061

Basically the thrust of both of these in enrichment of summary data

Event Timeline

mobrovac subscribed.

This one I think is a good idea :) I do find it informative and pertinent to the summary of the title being retrieved. Nothing should prevent us from implementing this since page coordinates count as a regular page edit.

Good idea indeed. Here's the MW API query that gives us the coordinates: https://en.wikipedia.org/w/api.php?action=query&prop=coordinates&titles=Boston

I'll create a PR

@Pchelolo @mobrovac - only occasionally do I have a good idea 😉

Seriously - awesome, thanks!

Fjalapeno renamed this task from Add location data to summaries? to Add location data to summaries.Feb 2 2017, 10:25 PM

Let's talk API. Here's what the MW API gives us: https://www.mediawiki.org/wiki/Extension:GeoData#prop.3Dcoordinates

Do we need just lat+lon? Do we need only primary coords? What of that data do we want to expose? All?

Only primary coordinates. It is a summary after all - and just lat/lon would be good.

I've created a PR to implement this: https://github.com/wikimedia/restbase/pull/758

I've intentionally didn't bump the version of the summary content-type, because bumping it would trigger regeneration of all of the summaries.
@Fjalapeno so you guys intent to use this data soon? If yes we can bump the content-type version and trigger the regeneration and pay the latency price, it no we can just let it update naturally.

@Pchelolo no need to bump it - the first to use it would be iOS maps which will be in development at least until next month

Thanks again

mobrovac assigned this task to Pchelolo.
mobrovac triaged this task as Medium priority.

Merged and deployed, resolving.