From d05f66ffc03ad758cf46ae63964a24cee8ea41cb Mon Sep 17 00:00:00 2001 From: Petra Maier Date: Thu, 15 Feb 2024 10:47:44 +0100 Subject: [PATCH] Reset manipulated xml-testfile to original state (#1823) Insert "prepend" into unless-clause --- src/main/resources/alma/fix/otherFields.fix | 5 +++-- src/main/resources/alma/fix/relatedRessourcesAndLinks.fix | 5 +++-- src/test/resources/alma-fix/99371530278506441.json | 5 +---- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/main/resources/alma/fix/otherFields.fix b/src/main/resources/alma/fix/otherFields.fix index 4a0e436de..45d1c5ca0 100644 --- a/src/main/resources/alma/fix/otherFields.fix +++ b/src/main/resources/alma/fix/otherFields.fix @@ -27,9 +27,10 @@ unless exists("130??|240??") 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/") end -lookup("exampleOfWork.language[].*.label","ISO639-2-to-GND") -prepend("exampleOfWork.language[].*.id", "http://id.loc.gov/vocabulary/iso639-2/") + # 300 - Physical Description (R) # We reuse the introx transformation here. diff --git a/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix b/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix index f21854be5..da16ed67b 100644 --- a/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix +++ b/src/main/resources/alma/fix/relatedRessourcesAndLinks.fix @@ -620,9 +620,10 @@ if exists("130??|240??") 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/") 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) diff --git a/src/test/resources/alma-fix/99371530278506441.json b/src/test/resources/alma-fix/99371530278506441.json index dda12a91a..67bce9763 100644 --- a/src/test/resources/alma-fix/99371530278506441.json +++ b/src/test/resources/alma-fix/99371530278506441.json @@ -103,11 +103,8 @@ "id" : "https://d-nb.info/gnd/4117209-7", "type" : [ "Work" ], "language" : [ { - "id" : "http://id.loc.gov/vocabulary/iso639-2/http://id.loc.gov/vocabulary/iso639-2/lat", + "id" : "http://id.loc.gov/vocabulary/iso639-2/lat", "label" : "Latein" - }, { - "id" : "http://id.loc.gov/vocabulary/iso639-2/http://id.loc.gov/vocabulary/iso639-2/rom", - "label" : "Romani" } ] }, "language" : [ {