Skip to content

Commit

Permalink
Tweak to-lobid transformation for volumes (RPB-239)
Browse files Browse the repository at this point in the history
Diverges from original Allegro transformation, disabled code but
left commented, in case we need to re-run from Allegro data
  • Loading branch information
fsteeg committed Jan 28, 2025
1 parent a0e7569 commit ed415fc
Showing 1 changed file with 19 additions and 16 deletions.
35 changes: 19 additions & 16 deletions conf/rpb-titel-to-lobid.fix
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,18 @@ end
if any_equal("type", "Band")
set_field("type[].$append", "Book")
call_macro("move_here", field: "isPartOf[]")
copy_field("isPartOf[].label", "superordinateLabel")
unless exists("superordinateLabel")
copy_field("isPartOf[].value", "superordinateLabel")
end
set_array("isPartOf[]")
set_array("isPartOf[].$append.type[]", "IsPartOfRelation")
set_array("isPartOf[].$last.hasSuperordinate[]")
# Set up superordinate ID: use the volume ID, remove the numbering part:
copy_field("volumeIn.value", "isPartOf[].$last.hasSuperordinate[].$append.id")
copy_field("superordinateLabel", "isPartOf[].$last.hasSuperordinate[].$last.label")
copy_field("volumeIn.numbering", "isPartOf[].$last.numbering")
# enable for Allegro import:
# copy_field("isPartOf[].label", "superordinateLabel")
# unless exists("superordinateLabel")
# copy_field("isPartOf[].value", "superordinateLabel")
# end
# set_array("isPartOf[]")
# set_array("isPartOf[].$append.type[]", "IsPartOfRelation")
# set_array("isPartOf[].$last.hasSuperordinate[]")
# # Set up superordinate ID: use the volume ID, remove the numbering part:
# copy_field("volumeIn.value", "isPartOf[].$last.hasSuperordinate[].$append.id")
# copy_field("superordinateLabel", "isPartOf[].$last.hasSuperordinate[].$last.label")
# copy_field("volumeIn.numbering", "isPartOf[].$last.numbering")
end

# ------- rpbId -------
Expand Down Expand Up @@ -154,19 +155,21 @@ uniq("note[]")

#-------- "isPartOf" -------
if exists("inSeries[]")
set_array("isPartOf[]")
unless exists("isPartOf[]")
set_array("isPartOf[]")
end
move_field("inSeries[].*", "isPartOf[].$append")
end
if exists("volumeIn")
unless any_equal("type", "Band") # not for Allegro
#unless any_equal("type", "Band") # enable for Allegro import
unless exists("isPartOf[]")
set_array("isPartOf[]")
end
move_field("volumeIn", "isPartOf[].$append")
end
#end
end
if exists("isPartOf[]")
unless any_equal("type", "Band") # also sets isPartOf
#unless any_equal("type", "Band") # enable for Allegro import
set_array("temp")
do list (path:"isPartOf[]", "var": "$i")
set_array("temp.$append.type[]", "IsPartOfRelation")
Expand Down Expand Up @@ -194,7 +197,7 @@ if exists("isPartOf[]")
end
end
move_field("temp", "isPartOf[]")
end
#end
end

# ------- "medium" -------
Expand Down

0 comments on commit ed415fc

Please sign in to comment.