Skip to content

Commit

Permalink
Merge #1968 branch '1823-AddLanguageOfOriginal' of https://github.com…
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed Feb 19, 2024
2 parents 58242ea + d3bcd0c commit 42806d5
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/main/resources/alma/fix/otherFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ end
lookup("language[].*.label","ISO639-2-to-GND")
prepend("language[].*.id", "http://id.loc.gov/vocabulary/iso639-2/")


# 300 - Physical Description (R)
# We reuse the introx transformation here.

Expand Down
14 changes: 14 additions & 0 deletions src/main/resources/alma/fix/relatedRessourcesAndLinks.fix
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,20 @@ end

replace_all("exampleOfWork.label","<<|>>","")

# 041 h|k - Language code of original and/or intermediate translations of text

set_array("lang_temp")
copy_field("041[ 01] .[hk]", "lang_temp.$append")
set_array("exampleOfWork.language[]")
do list(path:"lang_temp", "var": "$i")
copy_field("$i","exampleOfWork.language[].$append.id")
copy_field("$i","exampleOfWork.language[].$last.label")
end
lookup("exampleOfWork.language[].*.label","ISO639-2-to-GND")
prepend("exampleOfWork.language[].*.id", "http://id.loc.gov/vocabulary/iso639-2/")



# following only with second indicator 2 for analytical entries:
# 700 - Added Entry-Personal Name (R)
# 710 - Added Entry-Corporate Name (R)
Expand Down
6 changes: 5 additions & 1 deletion src/test/resources/alma-fix/99371530278506441.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,11 @@
"exampleOfWork" : {
"label" : "De ente et essentia",
"id" : "https://d-nb.info/gnd/4117209-7",
"type" : [ "Work" ]
"type" : [ "Work" ],
"language" : [ {
"id" : "http://id.loc.gov/vocabulary/iso639-2/lat",
"label" : "Latein"
} ]
},
"language" : [ {
"id" : "http://id.loc.gov/vocabulary/iso639-2/kor",
Expand Down
6 changes: 6 additions & 0 deletions src/test/resources/alma-fix/99372423490706441.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
"label" : "hbz - Hochschulbibliothekszentrum des Landes Nordrhein-Westfalen, Netzwerkzone",
"type" : [ "Collection" ]
} ],
"exampleOfWork" : {
"language" : [ {
"id" : "http://id.loc.gov/vocabulary/iso639-2/eng",
"label" : "Englisch"
} ]
},
"language" : [ {
"id" : "http://id.loc.gov/vocabulary/iso639-2/ger",
"label" : "Deutsch"
Expand Down

0 comments on commit 42806d5

Please sign in to comment.