Moreover, the correct URL to put in image
isn’t obvious for Wikimedia Commons–hosted files. For example, this traffic sign node links to the following page on Commons via wikimedia_commons=*
:
If I were to convert this tag to image=*
, which URL format would a data consumer expect me to use?
https://commons.wikimedia.org/wiki/File:Lane_use_diagram_sign_at_Interstate_280_and_Almaden_Plaza_Way,_San_Jose,_California.jpg
https://upload.wikimedia.org/wikipedia/commons/d/d2/Lane_use_diagram_sign_at_Interstate_280_and_Almaden_Plaza_Way%2C_San_Jose%2C_California.jpg
https://commons.wikimedia.org/wiki/Special:Redirect/file/Lane_use_diagram_sign_at_Interstate_280_and_Almaden_Plaza_Way,_San_Jose,_California.jpg
Format | Problem | Prevalence |
---|---|---|
https://commons.wikimedia.org/wiki/File:… |
Points to an HTML page, not an image per se. | 74,748 |
https://upload.wikimedia.org/wikipedia/commons/… |
Not a permalink: if someone uploads a new version of the image, for example to touch it up, then they’ll break this URL. (Old image revisions are moved to an archive/ directory.) Hotlinking this file violates its license. |
23,428 |
https://commons.wikimedia.org/wiki/Special:Redirect/file/… |
No one knows about Special:Redirect. Hotlinking this file violates its license. | 0 |
Sure, a data consumer could sniff out one of these URL formats and convert it to the desired format – either a link to the image description page, which contains the legally required attribution and license, or an API call that fetches the attribution along with the raw image URL. But parsing URLs is error-prone, and our general tendency is to prefer structured tags over freeform ones.