Skip to content

Commit

Permalink
Add holdings from 924 #225
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasNx committed Jan 17, 2025
1 parent 5fdfe75 commit 9fca285
Show file tree
Hide file tree
Showing 15 changed files with 209 additions and 121 deletions.
127 changes: 6 additions & 121 deletions conf/lobid-transformation/fix/item.fix
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
10 changes: 10 additions & 0 deletions conf/output/test-hebis-to-lobid-output-0.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
19 changes: 19 additions & 0 deletions conf/output/test-hebis-to-lobid-output-1.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
28 changes: 28 additions & 0 deletions conf/output/test-hebis-to-lobid-output-10.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
19 changes: 19 additions & 0 deletions conf/output/test-hebis-to-lobid-output-11.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions conf/output/test-hebis-to-lobid-output-12.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
19 changes: 19 additions & 0 deletions conf/output/test-hebis-to-lobid-output-13.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
19 changes: 19 additions & 0 deletions conf/output/test-hebis-to-lobid-output-2.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions conf/output/test-hebis-to-lobid-output-3.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions conf/output/test-hebis-to-lobid-output-4.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions conf/output/test-hebis-to-lobid-output-5.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
10 changes: 10 additions & 0 deletions conf/output/test-hebis-to-lobid-output-6.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Loading

0 comments on commit 9fca285

Please sign in to comment.