Page MenuHomePhabricator

Wikipedia Preview gallery caption
Closed, ResolvedPublic

Description

Problem

Goal of this ticket is to understand what are the options available and decide what should be used for the Wikipedia Preview gallery caption information.

Context

We have researched what are the current captions being used with different Wikipedia galleries (such as in iOS, Android, mobile web). We think it's probably best to aim for consistency across galleries.

Here are some examples from the gallery of the Wikipedia article for "ivory":

https://commons.m.wikimedia.org/wiki/File:Cylindrical_Ivory_Casket.jpg

Mobile webiOSAndroid

https://commons.wikimedia.org/wiki/File:Porphyrogenetus.jpg

Mobile webiOSAndroid

https://commons.m.wikimedia.org/wiki/File:Vierge_a_l'Enfant_debout.jpg

Mobile webiOSAndroid

As part of the research to simply understand what are the possible options, note that:

  • I'm including the commons.wikimedia.org/wiki/File for each example. In that link, you can see that images have a 'Caption' table (sometime with more than one language) as well as a 'Description' field in the 'Summary' table [1]. We are looking at both of those to understand what's usable and available.
  • We currently know that:
    • we can obtain description value from Commons with query like this [2]
    • we can obtain a caption value from media-list endpoint [3]
  • It seems the mobile web gallery is the only one using media-list caption, where as Android and iOS use Commons data

Questions that need to be answered

  1. What is the caption value we should use for the Wikipedia Preview gallery? Is there a specific logic to follow if more than one value is available (for example, use description if available, otherwise use caption)?
  1. If we are to use the value from the 'Caption' table (sometime with more than one language) in Commons (as shown in [1]), what is the API query for that? We have reviewed the corresponding documentation [4] but haven't found any information with regard to that caption field

[1]

[2]

https://commons.wikimedia.org/w/api.php?action=query&format=json&iiextmetadatafilter=License|LicenseUrl|LicenseShortName|ImageDescription|Artist&iiextmetadatalanguage=en&iiextmetadatamultilang=1&iiprop=url|extmetadata|dimensions&iiurlwidth=640&prop=imageinfo&rawcontinue=&titles=File:Volc%C3%A1n_Ubinas,_Arequipa,_Per%C3%BA,_2015-08-02,_DD_50.JPG

[3]

https://en.wikipedia.org/api/rest_v1/#/Page%20content/getContent-media-list

[4]

API Documentation: https://www.mediawiki.org/wiki/API:Imageinfo
API Sandbox:
https://www.mediawiki.org/wiki/Special:ApiSandbox#action=query&format=json&prop=imageinfo&meta=&titles=File%3AAlbert%20Einstein%20Head.jpg&iiprop=url%7Cextmetadata&iiextmetadatafilter=Caption%7CLicense%7CImageDescription

Recommended Order

Use this order to determine what content to show for image descriptions:

  • Commons captions.
  • If that is not available; show the description from Commons.
  • If that is not available; show the description from media-list.
Note

For optimization reasons, we are not following the above recommended order and keeping the gallery caption description similar to the iOS app.

Event Timeline

eamedina created this task.Sep 4 2020, 5:35 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptSep 4 2020, 5:35 PM
AMuigai claimed this task.Sep 11 2020, 2:17 PM

After research, let's use this order to determine what content to show for image descriptions:

  1. Commons captions
  2. If that is not available; show the description from Commoons
  3. If that is not available; show the description from media-list
SGautam_WMF updated the task description. (Show Details)Sep 22 2020, 5:57 AM
AMuigai updated the task description. (Show Details)Sep 22 2020, 10:35 AM
AMuigai removed AMuigai as the assignee of this task.Sep 22 2020, 2:57 PM
AMuigai triaged this task as Medium priority.
AMuigai added a subscriber: AMuigai.
hueitan claimed this task.Oct 5 2020, 1:19 PM
hueitan moved this task from Ready for Dev to Dev on the Inuka-Team (Kanban) board.

After research, let's use this order to determine what content to show for image descriptions:

  1. Commons captions
  2. If that is not available; show the description from Commoons
  3. If that is not available; show the description from media-list

After several trying, I don't see the option (1) coming from the API, I also don't see any extra filter in iOS app (source code)

API Documentation: https://www.mediawiki.org/wiki/API:Imageinfo
API Sandbox: > https://www.mediawiki.org/wiki/Special:ApiSandbox#action=query&format=json&prop=imageinfo&meta=&titles=File%3AAlbert%20Einstein%20Head.jpg&iiprop=url%7Cextmetadata&iiextmetadatafilter=Caption%7CLicense%7CImageDescription

Adding Caption to the filter field doesn't work

SBisson added a subscriber: SBisson.Oct 6 2020, 3:01 PM

I believe the caption in question is structured data. It's available via a different API. I don't think adding an additional API call for every image is worth it.

The PR proposed above makes it behave like the iOS app.

SBisson moved this task from Code Review to QA on the Inuka-Team (Kanban) board.Oct 6 2020, 3:02 PM
Jpita added a subscriber: Jpita.

waiting for a comment reply on github

waiting for a comment reply on github

Replied, in short, that's expected behaviour. No data is given.

Jpita moved this task from QA to Design sign off on the Inuka-Team (Kanban) board.Oct 8 2020, 3:15 PM
SGautam_WMF updated the task description. (Show Details)Oct 9 2020, 4:40 PM
SGautam_WMF added a subscriber: SGautam_WMF.

Updated the task with a note and moving it for product signoff.

AMuigai closed this task as Resolved.Oct 12 2020, 1:39 PM