diff --git a/conf/lobid-transformation/fix/item.fix b/conf/lobid-transformation/fix/item.fix index 2470339..2c56c9a 100644 --- a/conf/lobid-transformation/fix/item.fix +++ b/conf/lobid-transformation/fix/item.fix @@ -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 diff --git a/conf/output/test-hebis-to-lobid-output-0.json b/conf/output/test-hebis-to-lobid-output-0.json index f36e942..b4b94d2 100644 --- a/conf/output/test-hebis-to-lobid-output-0.json +++ b/conf/output/test-hebis-to-lobid-output-0.json @@ -72,6 +72,16 @@ "label" : "Festschrift", "id" : "https://d-nb.info/gnd/4016928-5" } ], + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "K 2023 Q 152" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-1.json b/conf/output/test-hebis-to-lobid-output-1.json index ca5f7b8..3e29cdd 100644 --- a/conf/output/test-hebis-to-lobid-output-1.json +++ b/conf/output/test-hebis-to-lobid-output-1.json @@ -73,6 +73,25 @@ "label" : "Deutsch" } ], "extent" : "1 gefaltetes Blatt ( 16 Seiten) : Illustrationen", + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "Mog m 7188" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + }, { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "Mog m 7188, 2. Ex." + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-10.json b/conf/output/test-hebis-to-lobid-output-10.json index 842bde6..633d764 100644 --- a/conf/output/test-hebis-to-lobid-output-10.json +++ b/conf/output/test-hebis-to-lobid-output-10.json @@ -99,6 +99,34 @@ "type" : [ "Concept" ] } ], "subjectslabels" : [ "Mainz" ], + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "Mog 1974" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + }, { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "Mog 1974, 2. Ex." + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + }, { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "Mog 3537" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-11.json b/conf/output/test-hebis-to-lobid-output-11.json index 3609110..bd868a0 100644 --- a/conf/output/test-hebis-to-lobid-output-11.json +++ b/conf/output/test-hebis-to-lobid-output-11.json @@ -99,6 +99,25 @@ "type" : [ "Concept" ] } ], "subjectslabels" : [ "Mainz" ], + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "Mog 1975" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + }, { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "Mog 2727" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-12.json b/conf/output/test-hebis-to-lobid-output-12.json index 07f9510..2492381 100644 --- a/conf/output/test-hebis-to-lobid-output-12.json +++ b/conf/output/test-hebis-to-lobid-output-12.json @@ -200,6 +200,16 @@ } } ], "subjectslabels" : [ "Tourismus", "Freizeitplanung", "Wanderweg", "Freizeit", "Hessen", "Rhein-Main-Gebiet" ], + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "2023/589" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-13.json b/conf/output/test-hebis-to-lobid-output-13.json index 6185b6d..7d4d79d 100644 --- a/conf/output/test-hebis-to-lobid-output-13.json +++ b/conf/output/test-hebis-to-lobid-output-13.json @@ -200,6 +200,25 @@ } } ], "subjectslabels" : [ "Katholische Kirche", "Jugendarbeit", "Lehrling", "Kirchliche Sozialarbeit", "Mainz", "Bundesfestung Mainz (Mainz)" ], + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "- Dek GOEB" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + }, { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "Mog 3175" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-2.json b/conf/output/test-hebis-to-lobid-output-2.json index 3decdfb..875dc96 100644 --- a/conf/output/test-hebis-to-lobid-output-2.json +++ b/conf/output/test-hebis-to-lobid-output-2.json @@ -70,6 +70,25 @@ "label" : "Deutsch" } ], "extent" : "24 Seiten : Illustrationen", + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "Mog m:4° /3602" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + }, { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "Mog m:4° /3602, 2. Ex." + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-3.json b/conf/output/test-hebis-to-lobid-output-3.json index 577c1d8..15155d5 100644 --- a/conf/output/test-hebis-to-lobid-output-3.json +++ b/conf/output/test-hebis-to-lobid-output-3.json @@ -76,6 +76,16 @@ "label" : "Ausstellungskatalog", "id" : "https://d-nb.info/gnd/4135467-9" } ], + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "K 2023 Q 140" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-4.json b/conf/output/test-hebis-to-lobid-output-4.json index f1d79dd..bb37e12 100644 --- a/conf/output/test-hebis-to-lobid-output-4.json +++ b/conf/output/test-hebis-to-lobid-output-4.json @@ -73,6 +73,16 @@ "label" : "Programmheft", "id" : "https://d-nb.info/gnd/4373950-7" } ], + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "K 2024/20" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-5.json b/conf/output/test-hebis-to-lobid-output-5.json index 925b665..7c8f76d 100644 --- a/conf/output/test-hebis-to-lobid-output-5.json +++ b/conf/output/test-hebis-to-lobid-output-5.json @@ -63,6 +63,16 @@ "label" : "Deutsch" } ], "extent" : "40 Seiten : Illustrationen", + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "K 2021/46" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-6.json b/conf/output/test-hebis-to-lobid-output-6.json index afa2a60..9a8052c 100644 --- a/conf/output/test-hebis-to-lobid-output-6.json +++ b/conf/output/test-hebis-to-lobid-output-6.json @@ -70,6 +70,16 @@ "label" : "Deutsch" } ], "extent" : "271 Seiten : Illustrationen", + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "2021/1406" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-7.json b/conf/output/test-hebis-to-lobid-output-7.json index 6185b6d..7d4d79d 100644 --- a/conf/output/test-hebis-to-lobid-output-7.json +++ b/conf/output/test-hebis-to-lobid-output-7.json @@ -200,6 +200,25 @@ } } ], "subjectslabels" : [ "Katholische Kirche", "Jugendarbeit", "Lehrling", "Kirchliche Sozialarbeit", "Mainz", "Bundesfestung Mainz (Mainz)" ], + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "- Dek GOEB" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + }, { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "Mog 3175" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-8.json b/conf/output/test-hebis-to-lobid-output-8.json index 56b3926..899c579 100644 --- a/conf/output/test-hebis-to-lobid-output-8.json +++ b/conf/output/test-hebis-to-lobid-output-8.json @@ -122,6 +122,16 @@ "notation" : "230", "version" : "sdnb" } ], + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "2021 Q 511" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item" diff --git a/conf/output/test-hebis-to-lobid-output-9.json b/conf/output/test-hebis-to-lobid-output-9.json index 0d24658..f576b8d 100644 --- a/conf/output/test-hebis-to-lobid-output-9.json +++ b/conf/output/test-hebis-to-lobid-output-9.json @@ -91,6 +91,16 @@ "gndIdentifier" : "4019445-0" } ], "subjectslabels" : [ "Gau-Algesheim" ], + "hasItem" : [ { + "label" : "lobid Bestandsressource", + "type" : [ "Item", "PhysicalObject" ], + "callNumber" : "2000/38" + }, { + "heldBy" : { + "id" : "http://lobid.org/organisations/DE-36#!", + "label" : "Wissenschaftliche Stadtbibliothek Mainz" + } + } ], "bibliographicLevel" : { "label" : "Monograph/Item", "id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item"