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

Open
acka47 opened this issue Nov 28, 2024 · 1 comment · Fixed by #2104
Open

License from 540/542 is not transformed #2103

acka47 opened this issue Nov 28, 2024 · 1 comment · 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Review
Development

Successfully merging a pull request may close this issue.

3 participants