-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
209 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,127 +1,12 @@ | ||
add_array("hasItem[]") | ||
add_array("@ITM-H") # Helper element for creating Holding from HOL ("PhysikalischerTitel") | ||
do list(path:"ITM ", "var": "$i") | ||
call_macro("suppressedLocation", targetField: "$i", libraryCodeSubfield: "w", locationCodeSubfield: "x") | ||
unless exists("$i.suppressedLocation") # Test if location is suppressed with mapping provided by the libraries. | ||
do list(path:"924??", "var": "$i") | ||
if any_equal("$i.b", "DE-36") | ||
add_hash( "hasItem[].$append") | ||
add_field("hasItem[].$last.label", "lobid Bestandsressource") | ||
add_array("hasItem[].$last.type[]", "Item","PhysicalObject") | ||
if exists("$i.z") # Temporary call number subfield | ||
copy_field("$i.z", "hasItem[].$last.callNumber") | ||
elsif exists("$i.n") # Item call number subfield | ||
copy_field("$i.n", "hasItem[].$last.callNumber") | ||
else # $c = Call number subfield | ||
copy_field("$i.c", "hasItem[].$last.callNumber") | ||
end | ||
copy_field("$i.H", "@ITM-H.$append") | ||
copy_field("$i.b", "hasItem[].$last.serialNumber") | ||
copy_field("$i.w","hasItem[].$last.currentLibrary") | ||
copy_field("$i.x","hasItem[].$last.currentLocation") | ||
call_macro("holdingLibrary+opacLink", mmsIdField:"$i.a",libraryCodeField:"$i.w") | ||
end | ||
end | ||
|
||
add_array("@HOL-M_POR-M") # Helper element for creating Holding from MBD ("NurTitel") | ||
do list(path: "HOL ", "var": "$i") | ||
copy_field("$i.M","@HOL-M_POR-M.$append") | ||
unless in("$i.8", "@ITM-H") # Checks if there is no corresponding ITM-Field | ||
do list(path:"H52??", "var": "$H52") | ||
if in("$i.8", "$H52.8") | ||
if exists("$H52.b") | ||
call_macro("suppressedLocation", targetField: "$H52", libraryCodeSubfield: "b", locationCodeSubfield: "c") | ||
unless exists("$H52.suppressedLocation") # Test if location is suppressed with mapping provided by the libraries. | ||
add_hash( "hasItem[].$append") | ||
add_field("hasItem[].$last.label", "lobid Bestandsressource") | ||
add_array("hasItem[].$last.type[]", "Item","PhysikalischerTitel") | ||
if exists("$H52.b.1") | ||
copy_field("$H52.b.1","hasItem[].$last.currentLibrary") | ||
else | ||
copy_field("$H52.b","hasItem[].$last.currentLibrary") | ||
end | ||
copy_field("$H52.c","hasItem[].$last.currentLocation") | ||
copy_field("$H52.h", "hasItem[].$last.callNumber") | ||
if exists("$H52.b.1") | ||
call_macro("holdingLibrary+opacLink", mmsIdField:"$i.8",libraryCodeField:"$H52.b.1") | ||
else | ||
call_macro("holdingLibrary+opacLink", mmsIdField:"$i.8",libraryCodeField:"$H52.b") | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
||
do list(path:"POR ", "var": "$i") | ||
copy_field("$i.M","@HOL-M_POR-M.$append") | ||
# entity for every POR .a without POR .A | ||
unless any_match("$i.a",".*6441$") # filter out hbz | ||
add_hash( "hasItem[].$append") | ||
add_array("hasItem[].$last.type[]", "Item", "DigitalDocument") | ||
add_field("hasItem[].$last.label", "Electronic Portfolio") | ||
copy_field("$i.D", "$i.@electronicLocator") | ||
replace_all("$i.@electronicLocator","https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK","") | ||
paste("hasItem[].$last.electronicLocator", "~https://eu04.alma.exlibrisgroup.com/view/uresolver/","$i.M","$i.@electronicLocator", join_char: "") | ||
copy_field("$i.d", "$i.@sublocation") | ||
replace_all("$i.@sublocation","https://hbz-network.userservices.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK","") | ||
paste("hasItem[].$last.sublocation", "~https://hbz-network.userservices.exlibrisgroup.com/view/uresolver/","$i.M","$i.@sublocation", join_char: "") | ||
call_macro("holdingLibrary+opacLink", mmsIdField:"$i.a",libraryCodeField:"$i.g") | ||
end | ||
# entity for every POR .A | ||
if exists ("$i.A") | ||
copy_field("$i.D", "$i.@electronicLocator") | ||
replace_all("$i.@electronicLocator","https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK","") | ||
copy_field("$i.d", "$i.@sublocation") | ||
replace_all("$i.@sublocation","https://hbz-network.userservices.exlibrisgroup.com/view/uresolver/49HBZ_NETWORK","") | ||
do list(path:"$i.A", "var": "$j") | ||
add_hash( "hasItem[].$append") | ||
add_array("hasItem[].$last.type[]", "Item", "DigitalDocument") | ||
add_field("hasItem[].$last.label", "Electronic Portfolio") | ||
paste("hasItem[].$last.electronicLocator", "~https://eu04.alma.exlibrisgroup.com/view/uresolver/","$j","$i.@electronicLocator", join_char: "") | ||
paste("hasItem[].$last.sublocation", "~https://hbz-network.userservices.exlibrisgroup.com/view/uresolver/","$j","$i.@sublocation", join_char: "") | ||
copy_field("$j", "$i.@iz") | ||
lookup("$i.@iz", "alma-iz-code-to-isil") | ||
call_macro("opacLink", field:"@iz") | ||
copy_field("$i.@iz","hasItem[].$last.heldBy.isil") | ||
paste("hasItem[].$last.heldBy.id", "~http://lobid.org/organisations/", "hasItem[].$last.heldBy.isil", "~#!", join_char:"") | ||
copy_field("hasItem[].$last.heldBy.id", "hasItem[].$last.heldBy.label") | ||
add_array("hasItem[].$last.inCollection[]") | ||
paste("hasItem[].$last.inCollection[].$append.id", "~http://lobid.org/organisations/", "$i.@iz", "~#!", join_char:"") | ||
copy_field("hasItem[].$last.inCollection[].$last.id", "hasItem[].$last.inCollection[].$last.label") | ||
# item id is constructed "http://lobid.org/items/[almaMmsId of the record]:[isil of the Owner]:[almaMmsId of the holding]#!" | ||
paste("hasItem[].$last.id", "~http://lobid.org/items/","almaMmsId", "~:", "hasItem[].$last.heldBy.isil","~:", "$i.a","~#!", join_char: "") | ||
end | ||
end | ||
end | ||
|
||
do list(path: "MBD ", "var": "$i") | ||
unless any_match("$i.M","49HBZ_NETWORK") | ||
unless in("$i.M", "@HOL-M_POR-M") # Checks if there is no corresponding HOL or POR-Field | ||
add_hash( "hasItem[].$append") | ||
add_field("hasItem[].$last.label", "lobid Bestandsressource") | ||
add_array("hasItem[].$last.type[]", "Item","NurTitel") | ||
copy_field("$i.i", "$i.@iz") | ||
replace_all("$i.@iz",".*(\\d{4})$","$1") | ||
lookup("$i.@iz", "alma-institution-code-to-isil") | ||
call_macro("opacLink", field:"@iz") | ||
copy_field("$i.@iz","hasItem[].$last.heldBy.isil") | ||
paste("hasItem[].$last.heldBy.id", "~http://lobid.org/organisations/", "hasItem[].$last.heldBy.isil", "~#!", join_char:"") | ||
copy_field("hasItem[].$last.heldBy.id", "hasItem[].$last.heldBy.label") | ||
add_array("hasItem[].$last.inCollection[]") | ||
paste("hasItem[].$last.inCollection[].$append.id", "~http://lobid.org/organisations/", "$i.@iz", "~#!", join_char:"") | ||
copy_field("hasItem[].$last.inCollection[].$last.id", "hasItem[].$last.inCollection[].$last.label") | ||
# item id is constructed "http://lobid.org/items/[almaMmsId of the record]:[isil of the Owner]:[almaMmsId of the holding]#!" | ||
paste("hasItem[].$last.id", "~http://lobid.org/items/","almaMmsId", "~:", "hasItem[].$last.heldBy.isil","~:", "$i.i", "~#!", join_char: "") | ||
end | ||
end | ||
end | ||
|
||
lookup("hasItem[].*.heldBy.label", "lobidOrgLabels",delete:"true") | ||
lookup("hasItem[].*.inCollection[].*.label", "lobidOrgLabels",delete:"true") | ||
|
||
do list(path: "hasItem[]","var":"$i") | ||
if any_match("$i.inCollection[].*.id","http:\\/\\/lobid.org\\/organisations\\/7816..") | ||
add_field("$i.inCollection[].1.id","http://lobid.org/organisations/BRIDGE_FIZ-7816#!") | ||
add_field("$i.inCollection[].1.label","Bibliotheken ohne zentrale Katalogisierung (IZ Bridge)") | ||
copy_field("$i.g", "hasItem[].$last.callNumber") | ||
add_field("hasItem[].$append.heldBy.id","http://lobid.org/organisations/DE-36#!") | ||
add_field("hasItem[].$last.heldBy.label","Wissenschaftliche Stadtbibliothek Mainz") | ||
paste("holding.id","~http://lobid.org/items/", "~WASMUSSHIERHIN:DE-36:","$i.g","~#!",join_char:"") # Checken ob 001 als Item Id genutzt werden soll. | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.