Page MenuHomePhabricator

Edit MediaInfo entities in API via Commons file name
Open, Needs TriagePublic

Description

As an API user who wants to add structured data to Wikimedia Commons files, I am working off a list of Commons file names. Maybe I copied them from a category or contributions page on-wiki, or got them from some other tool like Petscan or WDQS. Maybe I uploaded them myself and already have in hand the names I gave them. Currently, I must make multiple API calls to:

  1. obtain the page id of the filename, with action=query, and then
  2. set the MediaInfo entity statements, with action=wbeditentity or another method

If the API calls could use a Commons file name instead of MediaInfo entity id—since there will always be one, and exactly one, file name associated with any MediaInfo entity—this would allow you to do this action in one step. This is already the user experience on Wikidata, where the page name (i.e., what you use for [[links]], page URLs, etc.) *is* the same entity ID you use in the API, and there is no two-step process, but currently Commons is much harder to work with, and this would help.