Page MenuHomePhabricator

Automatically display structured copyright data in Lua-driven infobox templates on Wikimedia Commons file pages
Open, Needs TriagePublic

Description

See https://commons.wikimedia.org/wiki/Commons_talk:Structured_data/Modeling/Copyright#Also_add_copyright_data_to_Lua-driven_infobox_templates?

SDC data modeling conventions for copyright and licenses are well established and widely used. But copyright information, at this moment, still needs to be duplicated in the Wikitext infobox template, for instance as follows:

== {{int:license-header}} ==
{{cc-by-sa-4.0}}

It would be great (at least for the simplest of cases/licenses) to have this data load in infobox templates using Lua as well, so that basic information templates could include a copyright section rather like this:

=={{int:license-header}}==
{{license}}

It would even be more simple if, for instance, a bare {{Information}} template would auto-include the license.

Having this would e.g. make the upload process via batch upload tools like OpenRefine a lot easier for the uploader, as they'd have to deal with less complex Wikitext and can focus on mainly uploading correctly modeled SDC.

Event Timeline

Thanks for participating in the Hackathon! We hope you had a great time.

  • If this task was being worked on and resolved at the Hackathon: Please change the task status to resolved via the Add Action...Change Status dropdown, and make sure that this task has a link to the public codebase.
  • If this task is still valid and should stay open: Please add another active project tag to this task, so others can find this task (as likely nobody in the future will look back at the Hackathon workboard when trying to find something they are interested in).
  • In case there is nothing else to do for this task, or nobody plans to work on this task anymore: Please set the task status to declined.

Thank you,
Phabricator housekeeping service

This task was not done during the hackathon, but still very valid!

Update: apparently there is a template {{License from structured data}} started by @Jarekt in 2021 (?) which has the basics for this.

After some testing, the template seems to support many commonly used Creative Commons licenses, but not yet public domain statements (?) (more testing needed).

I can imagine it may be a good idea to continue improving this specific template, starting with the most commonly used public domain scenarios.

I can revisit the Module:License code and work on supporting more cases. If someone wants to help I could use a tester adding cases to Module:License/doc cataloging cases where current code gave adequate result and when it did not

I can revisit the Module:License code and work on supporting more cases. If someone wants to help I could use a tester adding cases to Module:License/doc cataloging cases where current code gave adequate result and when it did not

Thank you so much @Jarekt - that's amazing! (and Happy New Year to you!)

Do I understand correctly that you'd like us to test the cases at Module:License/doc and add new-to-develop examples and cases there too? Or use the talk page to list these new cases? What kind of process would work best for you?

Based on my (still superficial) tests, the basic Creative Commons licenses work OK most of the time, but it's the many public domain scenarios that still need to be tackled.

I want to bring together a small working group to work on tasks like these (and improvement of other Lua-driven templates, see T354016: ☂️ Fully Lua-driven, minimal Wikitext templates to describe files on Wikimedia Commons for the umbrella task I've created. If you don't mind I'll include you in the communication of this group. Let me know if you don't appreciate this.

I can revisit the Module:License code and work on supporting more cases. If someone wants to help I could use a tester adding cases to Module:License/doc cataloging cases where current code gave adequate result and when it did not

Thank you so much @Jarekt - that's amazing! (and Happy New Year to you!)

Do I understand correctly that you'd like us to test the cases at Module:License/doc and add new-to-develop examples and cases there too? Or use the talk page to list these new cases? What kind of process would work best for you?

@Spinster, test cases in Module:License/doc compare licenses generated by the Template:License from structured data to the original licenses. What you see on that page is automatically generated by the template, and they mostly work. What I was thinking was to test more files with more licenses and find files where it does not work and where the code might need to be expanded.

I want to bring together a small working group to work on tasks like these (and improvement of other Lua-driven templates, see T354016: ☂️ Fully Lua-driven, minimal Wikitext templates to describe files on Wikimedia Commons for the umbrella task I've created. If you don't mind I'll include you in the communication of this group. Let me know if you don't appreciate this.

It is fine

@Spinster, Also I am not sure you are aware but {{Information}} template is fully compatible with SDC since 2018. What that means is that if you have standard SDC properties set up, than you can remove all the wikitext from {{Information}} template. See for example File:OpenRefine Commons editing - wikitext data extension.png file, where I removed all the wikitext from the template and it is pulled from SDC. That is the infobox used by 85M files. See Template:Information documentation (SDC was mentioned there but I just added examples).

At some point there was a plan to modify Commons upload wizard to store the results to SDC instead of Wikitext for new uploads and {{Information}} template backed up by Module:Information was ready for this switch. Latter I noticed that there was actually no ticket for it so I created T245861: Add Structured data during file upload with Upload Wizard in 2020, and promoted it at Community_Wishlist_Survey_2021 where it got a lot of support, but not much happened.