From 5ca83dcb967e8c73133be31687e958a5aab2607d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Tue, 4 Jun 2024 10:46:12 +0200 Subject: [PATCH 1/3] =?UTF-8?q?Add=20info=20of=20beigef=C3=BCgtes=20Werk?= =?UTF-8?q?=20to=20otherTitleInformation=20#1836?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/alma/fix/titleRelatedFields.fix | 6 ++++++ src/test/resources/alma-fix/990141342350206441.json | 2 +- src/test/resources/alma-fix/990202474680206441.json | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/resources/alma/fix/titleRelatedFields.fix b/src/main/resources/alma/fix/titleRelatedFields.fix index 1eff39116..cbb5ec9c0 100644 --- a/src/main/resources/alma/fix/titleRelatedFields.fix +++ b/src/main/resources/alma/fix/titleRelatedFields.fix @@ -182,6 +182,12 @@ replace_all("alternativeTitle[].*","<<|>>","") set_array("otherTitleInformation[]") copy_field("245??.b","otherTitleInformation[].$append") + + +# 249 beigefügtes Werk Subfield $a +do list(path:"249 ","var":"$i") + copy_field("$i.a","otherTitleInformation[].$append") +end unless any_match("otherTitleInformation[].*",".*\\.\\.\\.") replace_all("otherTitleInformation[].*","\\s?[./]\\s?$","") end diff --git a/src/test/resources/alma-fix/990141342350206441.json b/src/test/resources/alma-fix/990141342350206441.json index 5ddd8cd30..cad2c8b9c 100644 --- a/src/test/resources/alma-fix/990141342350206441.json +++ b/src/test/resources/alma-fix/990141342350206441.json @@ -12,7 +12,7 @@ "deprecatedUri" : "http://lobid.org/resources/TT001230001#!", "oclcNumber" : [ "1069149647" ], "alternativeTitle" : [ "Reliqua librorum Friderici II. ... de arte venandi cum avibus" ], - "otherTitleInformation" : [ "Cvm Manfredi Regis additionibus" ], + "otherTitleInformation" : [ "Cvm Manfredi Regis additionibus", "Albertvs Magnvs De Falconibus, Asturibus, & Accipitribus" ], "edition" : [ "Ex membranis vetustis nunc primùm edita" ], "publication" : [ { "startDate" : "1596", diff --git a/src/test/resources/alma-fix/990202474680206441.json b/src/test/resources/alma-fix/990202474680206441.json index 6baebb590..920d4b09a 100644 --- a/src/test/resources/alma-fix/990202474680206441.json +++ b/src/test/resources/alma-fix/990202474680206441.json @@ -35,6 +35,7 @@ "deprecatedUri" : "http://lobid.org/resources/HT018129805#!", "isbn" : [ "4472020327", "9784472020322" ], "oclcNumber" : [ "1073245396" ], + "otherTitleInformation" : [ "shisō mondai to kyōiku" ], "edition" : [ "Dai 4-satsu" ], "publication" : [ { "startDate" : "1986", From 3419dacee903c2fa204aceedd184f73a5ce6536f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Tue, 4 Jun 2024 11:04:47 +0200 Subject: [PATCH 2/3] Use macro for alternateGraphicRepresentation of array of strings --- src/main/resources/alma/fix/macros.fix | 25 ++++++++++ src/main/resources/alma/fix/otherFields.fix | 23 +-------- .../resources/alma/fix/titleRelatedFields.fix | 47 ++----------------- 3 files changed, 29 insertions(+), 66 deletions(-) diff --git a/src/main/resources/alma/fix/macros.fix b/src/main/resources/alma/fix/macros.fix index 3cc0c7b2a..719a72f68 100644 --- a/src/main/resources/alma/fix/macros.fix +++ b/src/main/resources/alma/fix/macros.fix @@ -24,6 +24,31 @@ do put_macro("alternateGraphicRepresationArrayOfObjects") end end +do put_macro("alternateGraphicRepresationArrayOfStrings") + if exists("$[variable].6") + copy_field("$[variable].6","$[variable].linkageTest") + do list(path:"880??","var":"$880") + if in ("$[variable].linkageTest","$880.linkageTest") + if in ("$880.@script.id","alternateGraphicRepresentation[].*.script.id") + do list(path:"alternateGraphicRepresentation[]","var":"$AGR") + if in ("$880.@script.id","$AGR.script.id") + unless exists("$AGR.record.$[targetArray]") + set_array("$AGR.record.$[targetArray]") + end + copy_field("$880.a","$AGR.record.$[targetArray].$append") + end + end + else + copy_field("$880.@script.id","alternateGraphicRepresentation[].$append.script.id") + copy_field("$880.@script.label","alternateGraphicRepresentation[].$last.script.label") + set_array("alternateGraphicRepresentation[].$last.record.$[targetArray]") + copy_field("$880.a","alternateGraphicRepresentation[].$last.record.$[targetArray].$append") + end + end + end + end +end + do put_macro("alternateGraphicRepresationIsPartOf") if exists("$[variable].6") copy_field("$[variable].6","$[variable].linkageTest") diff --git a/src/main/resources/alma/fix/otherFields.fix b/src/main/resources/alma/fix/otherFields.fix index c1bc5dd79..142b5a79b 100644 --- a/src/main/resources/alma/fix/otherFields.fix +++ b/src/main/resources/alma/fix/otherFields.fix @@ -106,28 +106,7 @@ uniq("note[]") do list(path:"500 ","var":"$i") - if exists("$i.6") - copy_field("$i.6","$i.linkageTest") - do list(path:"880??","var":"$880") - if in ("$i.linkageTest","$880.linkageTest") - if in ("$880.@script.id","alternateGraphicRepresentation[].*.script.id") - do list(path:"alternateGraphicRepresentation[]","var":"$AGR") - if in ("$880.@script.id","$AGR.script.id") - unless exists("$AGR.record.note[]") - set_array("$AGR.record.note[]") - end - copy_field("$880.a","$AGR.record.note[].$append") - end - end - else - copy_field("$880.@script.id","alternateGraphicRepresentation[].$append.script.id") - copy_field("$880.@script.label","alternateGraphicRepresentation[].$last.script.label") - set_array("alternateGraphicRepresentation[].$last.record.note[]") - copy_field("$880.a","alternateGraphicRepresentation[].$last.record.note[].$append") - end - end - end - end + call_macro("alternateGraphicRepresationArrayOfStrings",targetArray:"note[]",variable:"$i") end diff --git a/src/main/resources/alma/fix/titleRelatedFields.fix b/src/main/resources/alma/fix/titleRelatedFields.fix index cbb5ec9c0..1c0a1d59a 100644 --- a/src/main/resources/alma/fix/titleRelatedFields.fix +++ b/src/main/resources/alma/fix/titleRelatedFields.fix @@ -144,28 +144,7 @@ set_array("alternativeTitle[]") copy_field("246?[ 345678].a","alternativeTitle[].$append") do list(path:"246?[ 345678]","var":"$i") - if exists("$i.6") - copy_field("$i.6","$i.linkageTest") - do list(path:"880??","var":"$880") - if in ("$i.linkageTest","$880.linkageTest") - if in ("$880.@script.id","alternateGraphicRepresentation[].*.script.id") - do list(path:"alternateGraphicRepresentation[]","var":"$AGR") - if in ("$880.@script.id","$AGR.script.id") - unless exists("$AGR.record.alternativeTitle[]") - set_array("$AGR.record.alternativeTitle[]") - end - copy_field("$880.a","$AGR.record.alternativeTitle[].$append") - end - end - else - copy_field("$880.@script.id","alternateGraphicRepresentation[].$append.script.id") - copy_field("$880.@script.label","alternateGraphicRepresentation[].$last.script.label") - set_array("alternateGraphicRepresentation[].$last.record.alternativeTitle[]") - copy_field("$880.a","alternateGraphicRepresentation[].$last.record.alternativeTitle[].$append") - end - end - end - end + call_macro("alternateGraphicRepresationArrayOfStrings",targetArray:"alternativeTitle[]",variable:"$i") end @@ -199,28 +178,8 @@ copy_field("250 .a","edition[].$append") replace_all("edition[].*","\\s?[./]\\s?$","") do list(path:"250 ","var":"$i") - if exists("$i.6") - copy_field("$i.6","$i.linkageTest") - do list(path:"880??","var":"$880") - if in ("$i.linkageTest","$880.linkageTest") - if in ("$880.@script.id","alternateGraphicRepresentation[].*.script.id") - do list(path:"alternateGraphicRepresentation[]","var":"$AGR") - if in ("$880.@script.id","$AGR.script.id") - unless exists("$AGR.record.edition[]") - set_array("$AGR.record.edition[]") - end - copy_field("$880.a","$AGR.record.edition[].$append") - end - end - else - copy_field("$880.@script.id","alternateGraphicRepresentation[].$append.script.id") - copy_field("$880.@script.label","alternateGraphicRepresentation[].$last.script.label") - set_array("alternateGraphicRepresentation[].$last.record.edition[]") - copy_field("$880.a","alternateGraphicRepresentation[].$last.record.edition[].$append") - end - end - end - end + call_macro("alternateGraphicRepresationArrayOfStrings",targetArray:"edition[]",variable:"$i") + end # 260 - Publication, Distribution, etc. (Imprint) (R) - Subfield: $a (R), $b (R), $c (R) From 361e761822cafdf703dec84709e7308b61dc420f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tobias=20B=C3=BClte?= Date: Tue, 4 Jun 2024 11:08:09 +0200 Subject: [PATCH 3/3] =?UTF-8?q?Add=20alternateGraphicRepresentation=20for?= =?UTF-8?q?=20beigef=C3=BCgtes=20Werk=20#1836?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/alma/fix/titleRelatedFields.fix | 1 + src/test/resources/alma-fix/990202474680206441.json | 2 ++ 2 files changed, 3 insertions(+) diff --git a/src/main/resources/alma/fix/titleRelatedFields.fix b/src/main/resources/alma/fix/titleRelatedFields.fix index 1c0a1d59a..080b8c7c0 100644 --- a/src/main/resources/alma/fix/titleRelatedFields.fix +++ b/src/main/resources/alma/fix/titleRelatedFields.fix @@ -166,6 +166,7 @@ copy_field("245??.b","otherTitleInformation[].$append") # 249 beigefügtes Werk Subfield $a do list(path:"249 ","var":"$i") copy_field("$i.a","otherTitleInformation[].$append") + call_macro("alternateGraphicRepresationArrayOfStrings",targetArray:"otherTitleInformation[]",variable:"$i") end unless any_match("otherTitleInformation[].*",".*\\.\\.\\.") replace_all("otherTitleInformation[].*","\\s?[./]\\s?$","") diff --git a/src/test/resources/alma-fix/990202474680206441.json b/src/test/resources/alma-fix/990202474680206441.json index 920d4b09a..cbb7f5a9f 100644 --- a/src/test/resources/alma-fix/990202474680206441.json +++ b/src/test/resources/alma-fix/990202474680206441.json @@ -13,6 +13,7 @@ "label" : "Japanisch (Kanji, Hiragana und Katakana)" }, "record" : { + "otherTitleInformation" : [ "思想問題と教育" ], "title" : "小原国芳選集, 3: 全人教育論", "edition" : [ "第4刷" ], "contribution" : [ { @@ -27,6 +28,7 @@ "label" : "Katakana" }, "record" : { + "otherTitleInformation" : [ "シソウ モンダイ ト キョウイク" ], "title" : "3: ゼンジン キョウイクロン" } } ],