Skip to content

Commit

Permalink
Exclude all language-info that do not match the marc code #2062
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Sep 13, 2024
1 parent 1ff30a6 commit 2aba6dc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
10 changes: 7 additions & 3 deletions src/main/resources/alma/fix/otherFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,23 @@ substring("@008-lang", "35", "3")
copy_field("@008-lang", "@language.$append")
copy_field("041[ 01] .[adj]", "@language.$append")

uniq("@language")
flatten("@language")

set_array("language[]")
do list(path:"@language", "var":"$i")
unless any_match("$i","zxx|mul|sgn|und|.*[\\|\\#].*|\\s*")
copy_field("$i", "language[].$append.id")
copy_field("$i", "language[].$last.label")
if any_match("$i","[A-Za-z]{3}")
copy_field("$i", "language[].$append.id")
copy_field("$i", "language[].$last.label")
end
end
end

lookup("language[].*.label","ISO639-2-to-GND")
prepend("language[].*.id", "http://id.loc.gov/vocabulary/iso639-2/")

uniq("language[]")

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

Expand Down
4 changes: 0 additions & 4 deletions src/test/resources/alma-fix/990126426530206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,6 @@
"label" : "hbz - Hochschulbibliothekszentrum des Landes Nordrhein-Westfalen, Netzwerkzone",
"type" : [ "Collection" ]
} ],
"language" : [ {
"id" : "http://id.loc.gov/vocabulary/iso639-2/deutsch",
"label" : "deutsch"
} ],
"note" : [ "In: Energie Spektr.. - 11 (1996) Nr. 3 S. 18/21 : Abb.; 2 Lit." ],
"bibliographicCitation" : "Energie Spektr.. - 11 (1996) Nr. 3 S. 18/21 : Abb.; 2 Lit.",
"hasItem" : [ {
Expand Down
3 changes: 0 additions & 3 deletions src/test/resources/alma-fix/990173607780206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,6 @@
"language" : [ {
"id" : "http://id.loc.gov/vocabulary/iso639-2/eng",
"label" : "Englisch"
}, {
"id" : "http://id.loc.gov/vocabulary/iso639-2/engl.",
"label" : "engl."
} ],
"extent" : "192 S. : zahlr. Ill., teils farb.",
"natureOfContent" : [ {
Expand Down

0 comments on commit 2aba6dc

Please sign in to comment.