Skip to content

Commit

Permalink
Combine title and title of subseries in alternateGraphicRepresentation
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Sep 6, 2023
1 parent fe35719 commit 2934727
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 7 deletions.
32 changes: 29 additions & 3 deletions src/main/resources/alma/fix/titleRelatedFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ do list(path:"245??","var":"$i")
if in ("[email protected]","alternateGraphicRepresentation[].*.script.id")
do list(path:"alternateGraphicRepresentation[]","var":"$AGR")
if in ("[email protected]","$AGR.script.id")
copy_field("$880.a","$AGR.record.title")
copy_field("$880.a","$AGR.record.@title")
copy_field("$880.n","$AGR.record.@titleOfSubSeries_n")
copy_field("$880.p","$AGR.record.@titleOfSubSeries_p")
unless exists("$AGR.record.otherTitleInformation[]")
set_array("$AGR.record.otherTitleInformation[]")
end
Expand All @@ -71,7 +73,9 @@ do list(path:"245??","var":"$i")
else
copy_field("[email protected]","alternateGraphicRepresentation[].$append.script.id")
copy_field("[email protected]","alternateGraphicRepresentation[].$last.script.label")
copy_field("$880.a","alternateGraphicRepresentation[].$last.record.title")
copy_field("$880.a","alternateGraphicRepresentation[].$last.record.@title")
copy_field("$880.n","alternateGraphicRepresentation[].$last.record.@titleOfSubSeries_n")
copy_field("$880.p","alternateGraphicRepresentation[].$last.record.@titleOfSubSeries_p")
set_array("alternateGraphicRepresentation[].$last.record.otherTitleInformation[]")
copy_field("$880.b","alternateGraphicRepresentation[].$last.record.otherTitleInformation[].$append")
set_array("alternateGraphicRepresentation[].$last.record.responsibilityStatement[]")
Expand All @@ -81,7 +85,29 @@ do list(path:"245??","var":"$i")
end
end
end
end
end

do list(path:"alternateGraphicRepresentation[]","var":"$AGR")
if exists("$AGR.record.@title")
if exists("$AGR.record.@titleOfSubSeries_n") # separate subvolume numbering and title with :
prepend("$AGR.record.@titleOfSubSeries_p", ": ")
end

paste("$AGR.record.@titleOfSubSeries", "$AGR.record.@titleOfSubSeries_n", "$AGR.record.@titleOfSubSeries_p", join_char: "")

if is_empty("$AGR.record.@titleOfSubSeries")
remove_field("$AGR.record.@titleOfSubSeries")
end

prepend("$AGR.record.@titleOfSubSeries",", ")

paste("$AGR.record.title","$AGR.record.@title", "$AGR.record.@titleOfSubSeries", join_char: "") # title consists of main title + if exists: subvolume numbering and subvolume title
remove_field("$AGR.record.@title")
remove_field("$AGR.record.@titleOfSubSeries")
remove_field("$AGR.record.@titleOfSubSeries_n")
remove_field("$AGR.record.@titleOfSubSeries_p")
end
end

# 246 - Varying Form of Title (R) - Subfields: $a (NR)

Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990182814750206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"label" : "Japanisch (Kanji, Hiragana und Katakana)"
},
"record" : {
"title" : "スライ",
"responsibilityStatement" : [ "吉本ばなな" ],
"title" : "スライ",
"edition" : [ "初版" ],
"publication" : [ {
"location" : [ "東京" ]
Expand Down
5 changes: 4 additions & 1 deletion src/test/resources/alma-fix/990202474680206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"label" : "Japanisch (Kanji, Hiragana und Katakana)"
},
"record" : {
"title" : "小原国芳選集",
"title" : "小原国芳選集, 全人教育論",
"edition" : [ "第4刷" ],
"contribution" : [ {
"agent" : {
Expand All @@ -18,6 +18,9 @@
"script" : {
"id" : "https://unicode.org/iso15924/iso15924.txt#Kana",
"label" : "Katakana"
},
"record" : {
"@titleOfSubSeries_p" : "ゼンジン キョウイクロン"
}
} ],
"almaMmsId" : "990202474680206441",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990367761810206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"label" : "Japanisch (Kanji, Hiragana und Katakana)"
},
"record" : {
"title" : "空から見た日本",
"responsibilityStatement" : [ "黒田清揚 ;佐々木敦朗 共著" ],
"title" : "空から見た日本",
"edition" : [ "初版" ],
"publication" : [ {
"location" : [ "大阪" ],
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/99371530278506441.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"label" : "Koreanisch (Hangul und Hanja)"
},
"record" : {
"title" : "존재자와 본질",
"responsibilityStatement" : [ "토마스 아퀴나스 지음 ; 박승찬 옮김" ],
"title" : "존재자와 본질",
"publication" : [ {
"location" : [ "서울" ],
"publishedBy" : [ "" ]
Expand Down

0 comments on commit 2934727

Please sign in to comment.