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

1836-beigefügtesWerk #2020

Merged
merged 3 commits into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions src/main/resources/alma/fix/macros.fix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ("[email protected]","alternateGraphicRepresentation[].*.script.id")
do list(path:"alternateGraphicRepresentation[]","var":"$AGR")
if in ("[email protected]","$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("[email protected]","alternateGraphicRepresentation[].$append.script.id")
copy_field("[email protected]","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")
Expand Down
23 changes: 1 addition & 22 deletions src/main/resources/alma/fix/otherFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ("[email protected]","alternateGraphicRepresentation[].*.script.id")
do list(path:"alternateGraphicRepresentation[]","var":"$AGR")
if in ("[email protected]","$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("[email protected]","alternateGraphicRepresentation[].$append.script.id")
copy_field("[email protected]","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


Expand Down
54 changes: 10 additions & 44 deletions src/main/resources/alma/fix/titleRelatedFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -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 ("[email protected]","alternateGraphicRepresentation[].*.script.id")
do list(path:"alternateGraphicRepresentation[]","var":"$AGR")
if in ("[email protected]","$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("[email protected]","alternateGraphicRepresentation[].$append.script.id")
copy_field("[email protected]","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


Expand All @@ -182,6 +161,13 @@ 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")
call_macro("alternateGraphicRepresationArrayOfStrings",targetArray:"otherTitleInformation[]",variable:"$i")
end
unless any_match("otherTitleInformation[].*",".*\\.\\.\\.")
replace_all("otherTitleInformation[].*","\\s?[./]\\s?$","")
end
Expand All @@ -193,28 +179,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 ("[email protected]","alternateGraphicRepresentation[].*.script.id")
do list(path:"alternateGraphicRepresentation[]","var":"$AGR")
if in ("[email protected]","$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("[email protected]","alternateGraphicRepresentation[].$append.script.id")
copy_field("[email protected]","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)
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990141342350206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 3 additions & 0 deletions src/test/resources/alma-fix/990202474680206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"label" : "Japanisch (Kanji, Hiragana und Katakana)"
},
"record" : {
"otherTitleInformation" : [ "思想問題と教育" ],
"title" : "小原国芳選集, 3: 全人教育論",
"edition" : [ "第4刷" ],
"contribution" : [ {
Expand All @@ -27,6 +28,7 @@
"label" : "Katakana"
},
"record" : {
"otherTitleInformation" : [ "シソウ モンダイ ト キョウイク" ],
"title" : "3: ゼンジン キョウイクロン"
}
} ],
Expand All @@ -35,6 +37,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",
Expand Down
Loading