Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

License from 540/542 is not transformed #2103

Closed
acka47 opened this issue Nov 28, 2024 · 3 comments · Fixed by #2104
Closed

License from 540/542 is not transformed #2103

acka47 opened this issue Nov 28, 2024 · 3 comments · Fixed by #2104
Assignees

Comments

@acka47
Copy link
Contributor

acka47 commented Nov 28, 2024

Reported in FRL-624.

Example 99375068790006441 (MARC, JSON). From the MARC:

<datafield tag="540" ind1=" " ind2=" ">
  <subfield code="a">
    Creative Commons Attribution 4.0 International License
  </subfield>
  <subfield code="f">CC-BY 4.0</subfield>
  <subfield code="2">cc</subfield>
  <subfield code="u">https://creativecommons.org/licenses/by/4.0/</subfield>
</datafield>
<datafield tag="542" ind1="1" ind2=" ">
  <subfield code="a">https://creativecommons.org/licenses/by/4.0/</subfield>
</datafield>

Here is the relevant fix:

set_array("license[]")
do list(path: "542??", "var": "$i")
copy_field("$i.u", "license[].$append.id")
copy_field("$i.u", "license[].$last.label")
replace_all("license[].$last.label", "^(http://|https://)(.*)$","$2")
end

@dr0i
Copy link
Member

dr0i commented Nov 29, 2024

Should be deployed next Monday.

@acka47 acka47 linked a pull request Nov 29, 2024 that will close this issue
@TobiasNx
Copy link
Contributor

TobiasNx commented Jan 8, 2025

"license": [
      {
        "id": "http://creativecommons.org/publicdomain/zero/1.0",
        "label": "Creative Commons-Lizenz CC0 1.0 Universal"
      }
    ]
  },

https://lobid.org/resources/99375068790006441.json

Now the license is mapped. @acka47 could you have a look if this is good now?

@TobiasNx TobiasNx assigned acka47 and unassigned TobiasNx Jan 8, 2025
@acka47
Copy link
Contributor Author

acka47 commented Jan 14, 2025

"license": [
      {
        "id": "http://creativecommons.org/publicdomain/zero/1.0",
        "label": "Creative Commons-Lizenz CC0 1.0 Universal"
      }
    ]

https://lobid.org/resources/99375068790006441.json

Now the license is mapped. @acka47 could you have a look if this is good now?

This is from describedBy.license, the license objet on the root level looks like this:

"license": [

        {
              "id": "https://creativecommons.org/licenses/by/4.0/",
              "label": "creativecommons.org/licenses/by/4.0/"
        }

  ]

ZB MED has closed FRL-624 so this is fine and we can close it. It might make sense to use 540.f or so for the label (see MARC source in original comment) but there are rpobably other cases where it would not be a good idea. Closing.

@acka47 acka47 closed this as completed Jan 14, 2025
@github-project-automation github-project-automation bot moved this from Review to Done in lobid-resources Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants