Last modified: 2014-11-14 20:28:07 UTC
On Wikimedia Commons, users may indicate how they wish to be attributed through two specific mechanisms. One is the {{Credit line}} template − see for example [1] The other one is the attribution parameter of license templates − see for example [2] As documented in [3], the attribution line in the second mechanism is marked with a <span class='licensetpl_attr'> − the first one is not but I just made a proposal for it to be. This information should be retrieved by CommonsMetadata. [1] <https://commons.wikimedia.org/wiki/File:Corse-du-Sud_Evisa.jpg> [2] <https://commons.wikimedia.org/wiki/File:Car_Park_entrance_at_Ealing_Magistrates_Court_-_geograph.org.uk_-_1729971.jpg> [3] <https://commons.wikimedia.org/wiki/Commons:Machine-readable_data>
The license template part will be covered by the pending patch in bug 57197. {{Information}} fragments have their own mechanism, see the section about infobox templates on [[Commons:Machine-readable data]]. I think it would be better to follow that, and keep the licensetpl_* stuff for actual license templates. {{Credit line}} already uses a fileinfotpl_credit attribute, except it is a class, not an id. I think the cleanest solution would be to change that to an id, and document it in [[Commons:Machine-readable data]].
Also, licensetpl_* fields will probably be handled in a more complex way due to the possibility of multilicensing - most clients will probably want to show a single license only, so we will try select the least restrictive one and ignore attributes not belonging to that. "Global", license-independent attributes should better not use that mechanism. (Although this is just speculation at this point, there is no proper handling of multiple licenses currently - that is bug 57259.)
Huh, well, not sure what I was supposed to do but whatever. Attribution specified through {{Credit line}} is now wrapped in a class="licensetpl_attr".
The current implementation of CommonsMetadata ignores licensetpl_* fields not wrapped in a licensetpl class, so this won't have any effect. As I said, adding it to the information template metadata syntax seems like a more logical solution to me.
(In reply to Tisza Gergő from comment #4) > The current implementation of CommonsMetadata ignores licensetpl_* fields > not wrapped in a licensetpl class, so this won't have any effect. I know. I was merely trying to make a stab at harmonizing Commons various, « inconsistent » ways of specifying attribution. If that’s not useful, well, *shrug*.
(In reply to Jean-Fred from comment #5) > (In reply to Tisza Gergő from comment #4) > > The current implementation of CommonsMetadata ignores licensetpl_* fields > > not wrapped in a licensetpl class, so this won't have any effect. > > I know. I was merely trying to make a stab at harmonizing Commons various, « > inconsistent » ways of specifying attribution. If that’s not useful, well, > *shrug*. Scrap that, I misread your comment. Well, *shrug*² then.
Again, how about adding id="fileinfotpl_credit" (to the first column, not the second) instead of class="fileinfotpl_credit"? That would be at least consistent with how other {{Information}} fields are marked, and trivial to parse.
(In reply to Tisza Gergő from comment #7) > Again, how about adding id="fileinfotpl_credit" (to the first column, not > the second) instead of class="fileinfotpl_credit"? That would be at least > consistent with how other {{Information}} fields are marked, and trivial to > parse. {{done}}
Change 136833 had a related patch set uploaded by Gergő Tisza: Handle id="fileinfotpl_credit" and class="licensetpl_attr" https://gerrit.wikimedia.org/r/136833
Change 136833 merged by jenkins-bot: Handle id="fileinfotpl_credit" and class="licensetpl_attr" https://gerrit.wikimedia.org/r/136833
Done in theory, can be tested after it is deployed on Commons (now-ish) and the files are purged: * http://en.wikipedia.beta.wmflabs.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File:Corse-du-Sud_Evisa.jpg * http://en.wikipedia.beta.wmflabs.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File:Car_Park_entrance_at_Ealing_Magistrates_Court_-_geograph.org.uk_-_1729971.jpg
(In reply to Tisza Gergő from comment #11) > can be tested after it is deployed on Commons (now-ish) Uh, next Tuesday, I mean. Also, via a local API query - remote repo queries are cached more aggressively. * http://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File:Corse-du-Sud_Evisa.jpg * http://commons.wikimedia.org/w/api.php?action=query&prop=imageinfo&iiprop=extmetadata&titles=File:Car_Park_entrance_at_Ealing_Magistrates_Court_-_geograph.org.uk_-_1729971.jpg