Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Metadata API: Fix license urls #266

Closed
serlo/db-migrations
#167

Description

@kulla

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_url which can be null. For example for license with ID 7 you can set url=https://creativecommons.org/licenses/by-sa/4.0/deed.de and contribution_url=http://www.raschweb.de/. Add a new contributor in the metadata API when contribution_url is set (maybe have a better name for contribution_url as well).

Follow Ups

  • Inform edusharing ( inhalte at-zeichen edu-sharing.net ) after bug is fixed

Activity

  1. added
    bug
    on Aug 20, 2023
  2. hejtful commented on Oct 11, 2023

    @hejtful

    @AndreasHuber and I would like to check some things:

    1. For some rows, the license type in the title column is not matching the license type in the url column, namely the "ShareAlike" term is missing in the url column. 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)
    2. For a couple of rows, the url column is pointing to a deed in English, while the title column is in another language. Should we adapt the url column to point to a deed in the language matching the title column? (row 16 is in German, row 18 is in French)

    @kulla Can you maybe answer these questions?

  3. kulla commented on Oct 11, 2023

    @kulla
    MemberAuthor

    2. For a couple of rows, the url column is pointing to a deed in English, while the title column is in another language. Should we adapt the url column to point to a deed in the language matching the title column?

    Yes

    Should we make sure that they match? And if so, which column should we use as the source of truth?

    Yes (the title column has the truth)

  4. AndreasHuber commented on Oct 12, 2023

    @AndreasHuber

    (maybe have a better name for contribution_url as well)

    The Creative Commons license text seems to call it attribution, so attribution or attribution_url sounds like a good name.

  5. kulla commented on Oct 12, 2023

    @kulla
    MemberAuthor

    How the creator shall be added

    See 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"
      }]
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Metadata APIbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions