Skip to content

Commit

Permalink
Add manufacture as property #1806
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Sep 21, 2023
1 parent 1c9c561 commit 77c9b96
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/resources/alma/alma.fix
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ retain(
"language[]",
"langNote[]",
"license[]",
"manufacture[]",
"medium[]",
"natureOfContent[]",
"note[]",
Expand Down
54 changes: 54 additions & 0 deletions src/main/resources/alma/fix/macros.fix
Original file line number Diff line number Diff line change
Expand Up @@ -378,4 +378,58 @@ do put_macro("publication")
end
end
end
end

do put_macro("manufacture")
do list(path:"$[field]", "var":"$i")
add_field("manufacture[].$append.test","")
do list(path: "$i.c", "var":"$j")
replace_all("$j", "\\[|\\]|ca. |c ", "")
unless exists("manufacture[].$last.startDate")
if any_match("$j",".*?([01]\\d{3}|20\\d{2}).*")
paste("manufacture[].$last.startDate", "$j")
end
end
unless exists("manufacture[].$last.endDate")
if any_match("$j",".*-[ ]?([01]\\d{3}|20\\d{2})$")
paste("manufacture[].$last.endDate", "$j")
end
end
end
set_array("manufacture[].$last.type[]","Event")
set_array("manufacture[].$last.location[]")
copy_field("$i.a", "manufacture[].$last.location[].$append")
set_array("manufacture[].$last.publishedBy[]")
copy_field("$i.b", "manufacture[].$last.publishedBy[].$append")
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.manufacture[]")
set_array("$AGR.record.manufacture[]")
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.publishedBy[]")
copy_field("$880.b", "$AGR.record.manufacture[].$last.publishedBy[].$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.manufacture[]")
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")
end
end
end
end
end
end
7 changes: 7 additions & 0 deletions src/main/resources/alma/fix/titleRelatedFields.fix
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,13 @@ else
call_macro("publication",field:"260 [ 1]") # # - Not applicable/No information provided/Earliest
end

set_array("manufacture[]")
if exists("264[ 23]3")
call_macro("manufacture",field:"26433") # 3 - Current/Latest
call_macro("manufacture",field:"26423") # 2 - Intervening
call_macro("manufacture",field:"264 3") # # - Not applicable/No information provided/Earliest
end

# Only add additional publication info to the first publication-object since it is the latest.

if exists("publication[].$first")
Expand Down
5 changes: 5 additions & 0 deletions src/test/resources/alma-fix/990185619180206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@
"location" : [ "s.l." ],
"publishedBy" : [ "EMI Records" ]
} ],
"manufacture" : [ {
"startDate" : "1994",
"type" : [ "Event" ],
"location" : [ "EMI Records Ltd, p 1969" ]
} ],
"describedBy" : {
"id" : "http://lobid.org/resources/990185619180206441",
"label" : "Webseite der hbz-Ressource 990185619180206441",
Expand Down

0 comments on commit 77c9b96

Please sign in to comment.