Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sol committed Oct 20, 2023
2 parents a6d1aa0 + f798719 commit 33c69bd
Show file tree
Hide file tree
Showing 24 changed files with 103 additions and 167 deletions.
2 changes: 1 addition & 1 deletion src/main/resources/alma/alma.fix
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ do list(path:"880??","var":"$i")
copy_field("$i.6","$i.linkageTest")
replace_all("$i.linkageTest","\\d{3}(-\\d{2}).*","880$1")
copy_field("$i.6","$i.@script.id")
copy_field("$i.6","$i.@script.label")
copy_field("$i.6","$i.@script.label")
replace_all("$i.@script.id","(\\d{3}-\\d{2})/(.*)","https://unicode.org/iso15924/iso15924.txt#$2")
replace_all("$i.@script.label","(\\d{3}-\\d{2})/(.*)","$2")
lookup("$i.@script.label","ISO15924-to-script")
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/alma/fix/contribution.fix
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ do list(path:"100[01] ", "var":"$i")
end
end
# name
call_macro("gndPersonCombinedLabel",field:"$i")
call_macro("gndPersonCombinedLabel",field:"$i")
copy_field("$i.@combinedLabel","contribution[].$last.agent.label")
# type
set_array("contribution[].$last.agent.type[]","Person")
Expand Down Expand Up @@ -105,7 +105,7 @@ do list(path:"700[01] ", "var":"$i")
end
end
# name
call_macro("gndPersonCombinedLabel",field:"$i")
call_macro("gndPersonCombinedLabel",field:"$i")
copy_field("$i.@combinedLabel","contribution[].$last.agent.label")
# type
set_array("contribution[].$last.agent.type[]","Person")
Expand Down Expand Up @@ -263,7 +263,7 @@ do list(path:"111[012] |711[012] ", "var":"$i")
end
# name
call_macro("gndEventCombinedLabel",field:"$i")
copy_field("$i.@combinedLabel", "contribution[].$last.agent.label")
copy_field("$i.@combinedLabel", "contribution[].$last.agent.label")
# type
set_array("contribution[].$last.agent.type[]","ConferenceOrEvent")
# role
Expand Down Expand Up @@ -339,7 +339,7 @@ do list (path: "contribution[]", "var": "$i")
set_array("$i.agent.altLabel[]")
do list(path:"GPN??", "var": "$z")
if in ("$i.agent.@gndIdn", "$z.B") # Person labels have no character between $a (Name) and $b (Number).
call_macro("gndPersonCombinedLabel",field:"$z")
call_macro("gndPersonCombinedLabel",field:"$z")
copy_field("$z.@combinedLabel", "$i.agent.altLabel[].$append")
end
end
Expand Down
96 changes: 48 additions & 48 deletions src/main/resources/alma/fix/macros.fix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ do put_macro("alternateGraphicRepresationArrayOfObjects")
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")
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]")
Expand All @@ -13,9 +13,9 @@ do put_macro("alternateGraphicRepresationArrayOfObjects")
copy_field("$880.a","$AGR.record.$[targetArray].$append$[targetField].label")
end
end
else
else
copy_field("$880.@script.id","alternateGraphicRepresentation[].$append.script.id")
copy_field("$880.@script.label","alternateGraphicRepresentation[].$last.script.label")
copy_field("$880.@script.label","alternateGraphicRepresentation[].$last.script.label")
set_array("alternateGraphicRepresentation[].$last.record.$[targetArray]")
copy_field("$880.a","alternateGraphicRepresentation[].$last.record.$[targetArray].$append$[targetField].label")
end
Expand All @@ -29,21 +29,21 @@ do put_macro("alternateGraphicRepresationIsPartOf")
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")
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.isPartOf[]")
set_array("$AGR.record.isPartOf[]")
end
set_array("$AGR.record.isPartOf[].$append.hasSuperordinate[]")
set_array("$AGR.record.isPartOf[].$append.hasSuperordinate[]")
copy_field("$880.a","$AGR.record.isPartOf[].$last.hasSuperordinate[].$append.label")
copy_field("$880.v", "$AGR.record.isPartOf[].$last.numbering")
end
end
else
else
copy_field("$880.@script.id","alternateGraphicRepresentation[].$append.script.id")
copy_field("$880.@script.label","alternateGraphicRepresentation[].$last.script.label")
set_array("alternateGraphicRepresentation[].$last.record.isPartOf[]")
set_array("alternateGraphicRepresentation[].$last.record.isPartOf[]")
set_array("alternateGraphicRepresentation[].$last.record.isPartOf[].$append.hasSuperordinate[]")
copy_field("$880.a","alternateGraphicRepresentation[].$last.record.isPartOf[].$last.hasSuperordinate[].$append.label")
copy_field("$880.v", "alternateGraphicRepresentation[].$last.record.isPartOf[].$last.numbering")
Expand All @@ -59,7 +59,7 @@ do put_macro("rolesFromSubfieldE")
unless is_array("$i.4")
move_field("$i.4","$i.@4")
set_array("$i.4")
move_field("$i.@4","$i.4.$append")
move_field("$i.@4","$i.4.$append")
end
do list(path:"$i.e","var":"$e")
if any_match("$e","(?i).*dars.*")
Expand Down Expand Up @@ -151,10 +151,10 @@ do put_macro("gndEventCombinedLabel")
copy_field("$[field].b","$[field].@combinedLabel.$append")
join_field("$[field].@combinedLabel", ". ") # This is the difference to gnd person
set_array("$[field].@combinedDetailsForEvents")
copy_field("$[field].n","$[field].@combinedDetailsForEvents.$append")
copy_field("$[field].n","$[field].@combinedDetailsForEvents.$append")
copy_field("$[field].g","$[field].@combinedDetailsForEvents.$append")
copy_field("$[field].d","$[field].@combinedDetailsForEvents.$append")
copy_field("$[field].c","$[field].@combinedDetailsForEvents.$append")
copy_field("$[field].c","$[field].@combinedDetailsForEvents.$append")
join_field("$[field].@combinedDetailsForEvents"," : ")
unless is_empty("$[field].@combinedDetailsForEvents.")
paste("$[field].@combinedLabel", "$[field].@combinedLabel", "~ (", "$[field].@combinedDetailsForEvents", "~)", join_char:"")
Expand Down Expand Up @@ -228,13 +228,13 @@ do put_macro("provenanceLinks")
elsif any_equal("$[field]", "BSZ")
replace_all("$[field]", "^.*$", "DE-576")
elsif any_equal("$[field]", "GBV")
replace_all("$[field]", "^.*$", "DE-601")
replace_all("$[field]", "^.*$", "DE-601")
elsif any_equal("$[field]", "KOBV")
replace_all("$[field]", "^.*$", "DE-602")
replace_all("$[field]", "^.*$", "DE-602")
elsif any_equal("$[field]", "HeBIS")
replace_all("$[field]", "^.*$", "DE-603")
replace_all("$[field]", "^.*$", "DE-603")
elsif any_equal("$[field]", "BVB")
replace_all("$[field]", "^.*$", "DE-604")
replace_all("$[field]", "^.*$", "DE-604")
elsif any_match("$[field]","^292$")
replace_all("$[field]", "^292$", "DE-101b")
elsif any_match("$[field]","(.*)\\/NWBib$")
Expand All @@ -261,7 +261,7 @@ do put_macro("holdingLibrary+opacLink")
lookup("$i.@iz", "alma-institution-code-to-isil")
copy_field("$[libraryCodeField]","$i.@sublibraryIsil")
lookup("$i.@sublibraryIsil", "hbzowner2sigel",delete:"true")
lookup("$i.@sublibraryIsil", "sigel2isilMap",delete:"true")
lookup("$i.@sublibraryIsil", "sigel2isilMap",delete:"true")
# following fix checks for sublibrary codes and if they map to provided sublocation Isil
unless exists("$i.@sublibraryIsil")
paste("$i.@sublibraryIsil","$i.M","~+","$[libraryCodeField]",join_char:"")
Expand Down Expand Up @@ -298,27 +298,27 @@ do put_macro("opacLink")
copy_field("$i.$[field]", "$i.@opacAlmaMmsId")
lookup("$i.@opacAlmaMmsId","isil2opac_almaMmsId", delete:"true")
split_field("$i.@opacAlmaMmsId","\\{almaMmsId\\}")
if exists("issn[].1")
copy_field("$i.$[field]", "$i.@opacLinkIssn")
lookup("$i.@opacLinkIssn","isil2opac_issn", delete:"true")
split_field("$i.@opacLinkIssn","\\{issn\\}")
end
if exists("isbn[].1")
copy_field("$i.$[field]", "$i.@opacLinkIsbn")
lookup("$i.@opacLinkIsbn","isil2opac_isbn", delete:"true")
split_field("$i.@opacLinkZdbId","\\{isbn\\}")
end
# if exists("issn[].1")
# copy_field("$i.$[field]", "$i.@opacLinkIssn")
# lookup("$i.@opacLinkIssn","isil2opac_issn", delete:"true")
# split_field("$i.@opacLinkIssn","\\{issn\\}")
# end
# if exists("isbn[].1")
# copy_field("$i.$[field]", "$i.@opacLinkIsbn")
# lookup("$i.@opacLinkIsbn","isil2opac_isbn", delete:"true")
# split_field("$i.@opacLinkZdbId","\\{isbn\\}")
# end
set_array("hasItem[].$last.seeAlso[]")
if exists("$i.@opacLinkZdbId.1")
if exists("$i.@opacAlmaMmsId.1")
paste("hasItem[].$last.seeAlso[].$append","$i.@opacAlmaMmsId.1","almaMmsId","$i.@opacAlmaMmsId.2",join_char:"")
elsif exists("$i.@opacLinkZdbId.1")
paste("hasItem[].$last.seeAlso[].$append","$i.@opacLinkZdbId.1","zdbId","$i.@opacLinkZdbId.2",join_char:"")
elsif exists("$i.@opacLinkHbzId.1")
paste("hasItem[].$last.seeAlso[].$append","$i.@opacLinkHbzId.1","hbzId","$i.@opacLinkHbzId.2",join_char:"")
elsif exists("$i.@opacAlmaMmsId.1")
paste("hasItem[].$last.seeAlso[].$append","$i.@opacAlmaMmsId.1","almaMmsId","$i.@opacAlmaMmsId.2",join_char:"")
elsif exists("$i.@opacLinkIsbn.1")
paste("hasItem[].$last.seeAlso[].$append","$i.@opacLinkIsbn.1","isbn[].1","$i.@opacLinkIsbn.2",join_char:"")
elsif exists("$i.@opacLinkIssn.1")
paste("hasItem[].$last.seeAlso[].$append","$i.@opacLinkIssn.1","issn[].1","$i.@opacLinkIssn.2",join_char:"")
# elsif exists("$i.@opacLinkIsbn.1")
# paste("hasItem[].$last.seeAlso[].$append","$i.@opacLinkIsbn.1","isbn[].1","$i.@opacLinkIsbn.2",join_char:"")
# elsif exists("$i.@opacLinkIssn.1")
# paste("hasItem[].$last.seeAlso[].$append","$i.@opacLinkIssn.1","issn[].1","$i.@opacLinkIssn.2",join_char:"")
end
end

Expand All @@ -341,7 +341,7 @@ do put_macro("schlagwortfolge")
if any_equal("subject[].$last.componentList[].$last.type[]","p")
call_macro("gndPersonCombinedLabel",field:"$i")
elsif any_equal("subject[].$last.componentList[].$last.type[]","f")
call_macro("gndEventCombinedLabel",field:"$i")
call_macro("gndEventCombinedLabel",field:"$i")
else
call_macro("gndOtherCombinedLabel",field:"$i")
end
Expand Down Expand Up @@ -421,25 +421,25 @@ do put_macro("publication")
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")
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.publication[]")
set_array("$AGR.record.publication[]")
end
add_field ("$AGR.record.publication[].$append.dummi","")
set_array("$AGR.record.publication[].$last.location[]")
end
add_field ("$AGR.record.publication[].$append.dummi","")
set_array("$AGR.record.publication[].$last.location[]")
copy_field("$880.a", "$AGR.record.publication[].$last.location[].$append")
set_array("$AGR.record.publication[].$last.publishedBy[]")
copy_field("$880.b", "$AGR.record.publication[].$last.publishedBy[].$append")
end
end
else
else
copy_field("$880.@script.id","alternateGraphicRepresentation[].$append.script.id")
copy_field("$880.@script.label","alternateGraphicRepresentation[].$last.script.label")
set_array("alternateGraphicRepresentation[].$last.publication[]")
add_field ("alternateGraphicRepresentation[].$last.publication[].$append.dummi","")
set_array("alternateGraphicRepresentation[].$last.publication[].$last.location[]")
add_field ("alternateGraphicRepresentation[].$last.publication[].$append.dummi","")
set_array("alternateGraphicRepresentation[].$last.publication[].$last.location[]")
copy_field("$880.a", "alternateGraphicRepresentation[].$last.publication[].$last.location[].$append")
set_array("alternateGraphicRepresentation[].$last.publication[].$last.publishedBy[]")
copy_field("$880.b", "alternateGraphicRepresentation[].$last.publication[].$last.publishedBy[].$append")
Expand Down Expand Up @@ -475,25 +475,25 @@ do put_macro("manufacture")
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")
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.manufacture[]")
set_array("$AGR.record.manufacture[]")
end
add_field ("$AGR.record.manufacture[].$append.dummi","")
set_array("$AGR.record.manufacture[].$last.location[]")
end
add_field ("$AGR.record.manufacture[].$append.dummi","")
set_array("$AGR.record.manufacture[].$last.location[]")
copy_field("$880.a", "$AGR.record.manufacture[].$last.location[].$append")
set_array("$AGR.record.manufacture[].$last.manufacturedBy[]")
copy_field("$880.b", "$AGR.record.manufacture[].$last.manufacturedBy[].$append")
end
end
else
else
copy_field("$880.@script.id","alternateGraphicRepresentation[].$append.script.id")
copy_field("$880.@script.label","alternateGraphicRepresentation[].$last.script.label")
set_array("alternateGraphicRepresentation[].$last.manufacture[]")
add_field ("alternateGraphicRepresentation[].$last.manufacture[].$append.dummi","")
set_array("alternateGraphicRepresentation[].$last.manufacture[].$last.location[]")
add_field ("alternateGraphicRepresentation[].$last.manufacture[].$append.dummi","")
set_array("alternateGraphicRepresentation[].$last.manufacture[].$last.location[]")
copy_field("$880.a", "alternateGraphicRepresentation[].$last.manufacture[].$last.location[].$append")
set_array("alternateGraphicRepresentation[].$last.manufacture[].$last.publishedBy[]")
copy_field("$880.b", "alternateGraphicRepresentation[].$last.manufacture[].$last.publishedBy[].$append")
Expand All @@ -502,4 +502,4 @@ do put_macro("manufacture")
end
end
end
end
end
2 changes: 1 addition & 1 deletion src/main/resources/alma/fix/maps.fix
Original file line number Diff line number Diff line change
Expand Up @@ -766,4 +766,4 @@ put_map("ISO15924-to-script",
"Zxxx": "Nicht geschriebenes Dokument",
"Zyyy": "Schrift nicht identifiziert",
"Zzzz": "Kein Schriftcode vergeben"
)
)
2 changes: 1 addition & 1 deletion src/main/resources/alma/fix/mediumAndType.fix
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ elsif any_match("natureOfContent[].*.label", "(?i).*(Zeitschrift|Periodical).*")
add_field("type[].$append", "Periodical")
elsif any_equal("906", "JOURNAL")
add_field("type[].$append","Periodical")
else
else
set_array("@PORtype")
do list(path: "POR ","var":"$i")
copy_field("$i.f","@PORtype.$append")
Expand Down
8 changes: 4 additions & 4 deletions src/main/resources/alma/fix/otherFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ do list(path:"500 ","var":"$i")
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")
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[]")
Expand All @@ -109,16 +109,16 @@ do list(path:"500 ","var":"$i")
copy_field("$880.a","$AGR.record.note[].$append")
end
end
else
else
copy_field("$880.@script.id","alternateGraphicRepresentation[].$append.script.id")
copy_field("$880.@script.label","alternateGraphicRepresentation[].$last.script.label")
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
end
end


# 520 - Summary, Etc. (R) Subfield: $a (NR), $b (NR)
Expand Down
6 changes: 3 additions & 3 deletions src/main/resources/alma/fix/subjects.fix
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ set_array("subject[]")
# 600 - Subject Added Entry - Personal Name (R)
# 610 - Subject Added Entry-Corporate Name (R), Subfield: $a (NR)
# 611 - Subject Added Entry - Meeting Name (R)
# 630 - Subject Added Entry - Uniform Title (R)
# 648 - Subject Added Entry - Chronological Term (R)
# 630 - Subject Added Entry - Uniform Title (R)
# 648 - Subject Added Entry - Chronological Term (R)
# 650 - Subject Added Entry-Topical Term (R), Subfield: $a (NR)
# 651 - Subject Added Entry - Geographic Name (R)
# 653 - Index Term-Uncontrolled (R), !!! Subfield: $a (R) !!!!
Expand Down Expand Up @@ -405,7 +405,7 @@ do list (path: "subject[]", "var": "$i")
set_array("$j.altLabel[]")
do list(path:"GPN??", "var": "$z")
if in ("$j.@gndIdn", "$z.B") # Person labels have no character between $a (Name) and $b (Number).
call_macro("gndPersonCombinedLabel",field:"$z")
call_macro("gndPersonCombinedLabel",field:"$z")
copy_field("$z.@combinedLabel", "$j.altLabel[].$append")
end
end
Expand Down
Loading

0 comments on commit 33c69bd

Please sign in to comment.