Page MenuHomePhabricator

SDC parser functions should accept Commons file names
Open, Needs TriagePublic


Unlike Wikidata, Wikimedia Commons has page names that are unique and can be associated 1-to-1 with the M-id. Also, unlike Wikidata, there are no sitelink linkages to structured data on Commons, even from the wiki page to its own WikibaseMediaInfo entities.

That means using the parser functions, like #statements, even just to display structured data from an image on its own wikitext page, requires providing an M-id, such as {{#statements:P760|from=M{{PAGEID}} }} and from any other page besides its own wiki page, you'd have to do something like {{#statements:P760|from=M{{PAGEID: File:<filename>}} }}.

For usability, it would be best to do that lookup on the backend, and simply allow a user to use Wikimedia Commons filenames in the parser functions' from= parameter. The software can easily determine if the input is a Q-id, M-id, or page name, and perform the same action in the latter case that the user can already do with the unwieldy magic word approach above to translate the input page name to the M-id.