Repository navigation
Metadata API: Fix license urls #266
Description
The bug
Currently we output the url of the license table as the license url. However we have the following urls in our MySQL:
mysql> select id, title, url from license;
+----+-----------------------------------------------------------------------------------------------------+-----------------------------------------------------------+
| id | title | url |
+----+-----------------------------------------------------------------------------------------------------+-----------------------------------------------------------+
| 1 | Dieses Werk steht unter der freien Lizenz CC BY-SA 4.0. | https://creativecommons.org/licenses/by-sa/4.0/deed.de |
| 2 | Das ISB Bayern h�lt an Teilen dieses Werkes die Rechte. | https://www.isb.bayern.de/ |
| 3 | Das Z-MNU h�lt an Teilen dieses Werkes die Rechte. | http://btmdx1.mat.uni-bayreuth.de/smart/wp/ |
| 4 | Dieses Werk steht unter der freien Lizenz CC BY-SA 4.0 mit Namensnennung von Herrn Rudolf Brinkmann | https://123mathe.de |
| 5 | Lizenzhinweis f�r das BOS Intranet | http://www.bos-sozial.musin.de/ |
| 6 | Dieses Werk steht unter der freien Lizenz CC BY-SA 4.0 mit Namensnennung von Herrn Franz Strobl. | http://www.strobl-f.de/ |
| 7 | Dieses Werk steht unter der freien Lizenz CC BY-SA 4.0 mit Namensnennung von Herrn G�nther Rasch | http://www.raschweb.de/ |
| 8 | Herr Thomas Unkelbach h�lt an Teilen dieses Werkes die Rechte. | http://ne.lo-net2.de/selbstlernmaterial/ |
| 9 | This content is licensed under cc-by-sa-4.0 | http://creativecommons.org/licenses/by/4.0/ |
| 10 | Standard-YouTube-Lizenz | https://www.youtube.com/static?gl=DE&template=terms |
| 11 | Dieses Werk steht unter der freien Lizenz CC BY-NC-SA 3.0. | https://creativecommons.org/licenses/by-nc-sa/3.0/deed.de |
| 12 | F�r dieses Werk gelten die Nutzungsbedingungen des Pr�fungsarchivs von www.mebis.bayern.de. | https://mediathek.mebis.bayern.de/archiv.php |
| 13 | This content is licensed under cc-by-sa-4.0 | https://creativecommons.org/licenses/by/4.0/ |
| 14 | Este contenido est� licenciado bajo cc-by-sa-4.0 | https://creativecommons.org/licenses/by-sa/4.0/deed.es |
| 15 | F�r dieses Video gelten die Nutzungsbedingungen der BR Mediathek. | https://www.br.de/mediathek/nutzungsbedingungen |
| 16 | Dieses Werk steht unter der Lizenz CC BY-ND 4.0 | https://creativecommons.org/licenses/by-nd/4.0/ |
| 17 | This content is licensed under cc-by-sa-4.0 | http://creativecommons.org/licenses/by/4.0/ |
| 18 | Ce contenu est sous licence cc-by-sa-4.0 | http://creativecommons.org/licenses/by/4.0/ |
| 19 | CC BY 4.0 - Landesbildungsserver Baden-W�rttemberg | https://www.schule-bw.de/ |
| 21 | Licencia est�ndar de YouTube | https://www.youtube.com/static?template=terms&gl=ES |
| 22 | Esta obra est� bajo la licencia libre CC BY-SA 4.0 de la iniciativa colectiva �frica en la Escuela | https://www.facebook.com/AfricaenlaEscuela/ |
| 23 | Este ejercicio/tarea est� bajo la licencia libre CC BY-SA 4.0 del se�or Franz Strobl. | http://www.strobl-f.de/ |
| 24 | Dieses Werk steht unter der freien Lizenz CC BY-SA 4.0 mit Namensnennung von MNWeG | https://mnweg.org |
| 25 | | |
+----+-----------------------------------------------------------------------------------------------------+-----------------------------------------------------------+
When you now look at the license with id 7 it is a CC-BY-SA license. However the license url is http://www.raschweb.de/ and not https://creativecommons.org/licenses/by-sa/4.0/deed.de. The url http://www.raschweb.de/ needs to be added to the contributors.
Expected result
All items in the Metadata API with a CC license (you can spot them in the title) need to return as url in the form https://creativecommons.org/licenses/.... When there is currently a different URL, than it need to be added to the contributors.
Possible solutions
- Add extra code in the database layer for the special licenses OR
- Add a column
contribution_urlwhich can be null. For example for license with ID 7 you can seturl=https://creativecommons.org/licenses/by-sa/4.0/deed.deandcontribution_url=http://www.raschweb.de/. Add a new contributor in the metadata API whencontribution_urlis set (maybe have a better name forcontribution_urlas well).
Follow Ups
- Inform edusharing ( inhalte
at-zeichenedu-sharing.net ) after bug is fixed
Activity
hejtful commentedon Oct 11, 2023
@AndreasHuber and I would like to check some things:
titlecolumn is not matching the license type in theurlcolumn, namely the "ShareAlike" term is missing in theurlcolumn. Should we make sure that they match? And if so, which column should we use as the source of truth? (rows in question are 9, 13, 17)urlcolumn is pointing to a deed in English, while thetitlecolumn is in another language. Should we adapt theurlcolumn to point to a deed in the language matching thetitlecolumn? (row 16 is in German, row 18 is in French)@kulla Can you maybe answer these questions?
kulla commentedon Oct 11, 2023
Yes
Yes (the title column has the truth)
AndreasHuber commentedon Oct 12, 2023
The Creative Commons license text seems to call it attribution, so
attributionorattribution_urlsounds like a good name.kulla commentedon Oct 12, 2023
How the
creatorshall be addedSee https://dini-ag-kim.github.io/amb/draft/#creator and https://w3id.org/kim/amb/draft/schemas/creator.json:
{ "creator": [{ "id": "http://raschweb.de/", "name": "http://raschweb.de/", "type": "Organization" }] }