Skip to content

Commit

Permalink
Merge #1896 from branch '1806-manufacture' of https://github.com/hbz/…
Browse files Browse the repository at this point in the history
  • Loading branch information
dr0i committed Sep 22, 2023
2 parents 1c9c561 + ba7fa43 commit b1676a3
Show file tree
Hide file tree
Showing 8 changed files with 765 additions and 42 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.manufacturedBy[]")
copy_field("$i.b", "manufacture[].$last.manufacturedBy[].$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.manufacturedBy[]")
copy_field("$880.b", "$AGR.record.manufacture[].$last.manufacturedBy[].$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
257 changes: 257 additions & 0 deletions src/test/resources/alma-fix/990183958380206441.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,257 @@
{
"@context" : "http://lobid.org/resources/context.jsonld",
"almaMmsId" : "990183958380206441",
"hbzId" : "HT016692738",
"deprecatedUri" : "http://lobid.org/resources/HT016692738#!",
"isbn" : [ "3980031357", "9783980031356" ],
"oclcNumber" : [ "706989442" ],
"title" : "Rösenbeck",
"otherTitleInformation" : [ "Orts- und Landesgeschichte am Beispiel eines Bredelarer Klosterdorfes" ],
"manufacture" : [ {
"startDate" : "2010",
"type" : [ "Event" ],
"location" : [ "Marsberg" ],
"manufacturedBy" : [ "Boxberger" ]
} ],
"describedBy" : {
"id" : "http://lobid.org/resources/990183958380206441",
"label" : "Webseite der hbz-Ressource 990183958380206441",
"type" : [ "BibliographicDescription" ],
"inDataset" : {
"id" : "http://lobid.org/resources/dataset#!",
"label" : "lobid-resources – Der hbz-Verbundkatalog als Linked Open Data"
},
"resultOf" : {
"type" : [ "CreateAction" ],
"endTime" : "0000-00-00T00:00:00",
"instrument" : {
"id" : "https://github.com/hbz/lobid-resources",
"type" : [ "SoftwareApplication" ],
"label" : "Software lobid-resources"
},
"object" : {
"id" : "https://lobid.org/marcxml/990183958380206441",
"dateCreated" : "2021-04-05",
"dateModified" : "2023-05-30",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990183958380206441 im Exportformat MARC21 XML",
"inDataset" : {
"id" : "https://datahub.io/dataset/hbz_unioncatalog",
"label" : "hbz_unioncatalog"
},
"sourceOrganization" : {
"id" : "http://lobid.org/organisations/DE-6#!",
"label" : "Universitäts- und Landesbibliothek Münster, Zentralbibliothek"
},
"provider" : {
"id" : "http://lobid.org/organisations/DE-101#!",
"label" : "Deutsche Nationalbibliothek"
},
"modifiedBy" : [ {
"id" : "http://lobid.org/organisations/DE-6#!",
"label" : "Universitäts- und Landesbibliothek Münster, Zentralbibliothek"
}, {
"id" : "http://lobid.org/organisations/DE-605#!",
"label" : "hbz - Hochschulbibliothekszentrum des Landes Nordrhein-Westfalen"
} ]
}
},
"license" : [ {
"id" : "http://creativecommons.org/publicdomain/zero/1.0",
"label" : "Creative Commons-Lizenz CC0 1.0 Universal"
} ]
},
"sameAs" : [ {
"id" : "http://hub.culturegraph.org/resource/HBZ-HT016692738",
"label" : "Culturegraph Ressource"
}, {
"id" : "http://worldcat.org/oclc/706989442",
"label" : "OCLC Ressource"
}, {
"id" : "http://nwbib.de/990183958380206441#!",
"label" : "NWBib-Ressource"
} ],
"tableOfContents" : [ {
"label" : "Inhaltsverzeichnis",
"id" : "http://digitale-objekte.hbz-nrw.de/storage2/2019/08/02/file_154/8623447.pdf"
} ],
"inCollection" : [ {
"id" : "http://lobid.org/organisations/DE-655#!",
"label" : "hbz - Hochschulbibliothekszentrum des Landes Nordrhein-Westfalen, Netzwerkzone",
"type" : [ "Collection" ]
}, {
"id" : "http://lobid.org/resources/HT014176012#!",
"label" : "Nordrhein-Westfälische Bibliographie (NWBib)",
"type" : [ "Collection" ]
} ],
"language" : [ {
"id" : "http://id.loc.gov/vocabulary/iso639-2/ger",
"label" : "Deutsch"
} ],
"extent" : "188 S. : Ill., graph. Darst., Kt.",
"subject" : [ {
"id" : "https://nwbib.de/subjects#N102000",
"label" : "Landesbeschreibungen",
"notation" : "102000",
"type" : [ "Concept" ],
"source" : {
"id" : "https://nwbib.de/subjects",
"label" : "Sachsystematik der Nordrhein-Westfälischen Bibliographie"
}
}, {
"id" : "https://nwbib.de/subjects#N240000",
"label" : "Geschichte",
"notation" : "240000",
"type" : [ "Concept" ],
"source" : {
"id" : "https://nwbib.de/subjects",
"label" : "Sachsystematik der Nordrhein-Westfälischen Bibliographie"
}
}, {
"type" : [ "ComplexSubject" ],
"label" : "Brilon-Rösenbeck | Heimatkunde",
"componentList" : [ {
"type" : [ "PlaceOrGeographicName" ],
"label" : "Brilon-Rösenbeck",
"source" : {
"label" : "Gemeinsame Normdatei (GND)",
"id" : "https://d-nb.info/gnd/7749153-1"
},
"id" : "https://d-nb.info/gnd/7733018-3",
"gndIdentifier" : "7733018-3"
}, {
"type" : [ "SubjectHeading" ],
"label" : "Heimatkunde",
"source" : {
"label" : "Gemeinsame Normdatei (GND)",
"id" : "https://d-nb.info/gnd/7749153-1"
},
"id" : "https://d-nb.info/gnd/4127794-6",
"gndIdentifier" : "4127794-6",
"altLabel" : [ "Heimatforschung", "Heimatgeschichte" ]
} ]
}, {
"type" : [ "ComplexSubject" ],
"label" : "Brilon-Rösenbeck | Geschichte",
"componentList" : [ {
"type" : [ "PlaceOrGeographicName" ],
"label" : "Brilon-Rösenbeck",
"source" : {
"label" : "Gemeinsame Normdatei (GND)",
"id" : "https://d-nb.info/gnd/7749153-1"
},
"id" : "https://d-nb.info/gnd/7733018-3",
"gndIdentifier" : "7733018-3"
}, {
"label" : "Geschichte"
} ]
} ],
"spatial" : [ {
"id" : "https://nwbib.de/spatial#Q1773509",
"label" : "Rösenbeck",
"type" : [ "Concept" ],
"source" : {
"id" : "https://nwbib.de/spatial",
"label" : "Raumsystematik der Nordrhein-Westfälischen Bibliographie"
},
"focus" : {
"id" : "http://www.wikidata.org/entity/Q1773509",
"label" : "Rösenbeck",
"type" : [ "http://www.wikidata.org/entity/Q253019" ],
"geo" : {
"lat" : "51.4083",
"lon" : "8.68528"
}
}
} ],
"subjectslabels" : [ "Brilon-Rösenbeck", "Heimatkunde", "Geschichte" ],
"hasItem" : [ {
"label" : "lobid Bestandsressource",
"type" : [ "Item", "PhysicalObject" ],
"callNumber" : "DE900+RO718 T641",
"serialNumber" : "148/4347150+01",
"currentLibrary" : "UB_BI",
"currentLocation" : "14G_Mono",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-361#!",
"isil" : "DE-361",
"label" : "Universitätsbibliothek Bielefeld"
},
"id" : "http://lobid.org/items/990183958380206441:DE-361:23292294010006442#!"
}, {
"label" : "lobid Bestandsressource",
"type" : [ "Item", "PhysicalObject" ],
"callNumber" : "2D 8155",
"serialNumber" : "6-00113726-8",
"currentLibrary" : "ZB",
"currentLocation" : "ZB_GMAGL",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-6#!",
"isil" : "DE-6",
"label" : "Universitäts- und Landesbibliothek Münster, Zentralbibliothek"
},
"id" : "http://lobid.org/items/990183958380206441:DE-6:23619354250006449#!"
}, {
"label" : "lobid Bestandsressource",
"type" : [ "Item", "PhysicalObject" ],
"callNumber" : "O 1725",
"serialNumber" : "Z193-024182",
"currentLibrary" : "ALKU",
"currentLocation" : "ALKU_BIB",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-6-139a#!",
"isil" : "DE-6-139a",
"label" : "Kommission Alltagskulturforschung für Westfalen (KAF), Bibliothek"
},
"id" : "http://lobid.org/items/990183958380206441:DE-6-139a:23619354230006449#!"
}, {
"label" : "lobid Bestandsressource",
"type" : [ "Item", "PhysicalObject" ],
"callNumber" : "LUHB1738",
"serialNumber" : "LUHB1738",
"currentLibrary" : "P0001",
"currentLocation" : "31",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-466#!",
"isil" : "DE-466",
"label" : "Universitätsbibliothek Paderborn"
},
"id" : "http://lobid.org/items/990183958380206441:DE-466:23150297370006463#!"
}, {
"label" : "lobid Bestandsressource",
"type" : [ "Item", "PhysikalischerTitel" ],
"currentLibrary" : "P0001",
"currentLocation" : "UNASSIGNED",
"heldBy" : {
"id" : "http://lobid.org/organisations/DE-466#!",
"isil" : "DE-466",
"label" : "Universitätsbibliothek Paderborn"
},
"id" : "http://lobid.org/items/990183958380206441:DE-466:22150297360006463#!"
} ],
"medium" : [ {
"label" : "Print",
"id" : "http://rdaregistry.info/termList/RDAproductionMethod/1010"
} ],
"bibliographicLevel" : {
"label" : "Monograph/Item",
"id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item"
},
"type" : [ "BibliographicResource", "Book" ],
"responsibilityStatement" : [ "Hans Dieter Tönsmeyer" ],
"contribution" : [ {
"agent" : {
"gndIdentifier" : "111982227",
"id" : "https://d-nb.info/gnd/111982227",
"label" : "Tönsmeyer, Hans Dieter",
"type" : [ "Person" ],
"altLabel" : [ "Tönsmeyer, Hans-Dieter", "Tönsmeyer, Hans-D.", "Tönsmeyer, Hans D." ]
},
"role" : {
"id" : "http://id.loc.gov/vocabulary/relators/aut",
"label" : "Autor/in"
},
"type" : [ "Contribution" ]
} ],
"id" : "http://lobid.org/resources/990183958380206441#!"
}
Loading

0 comments on commit b1676a3

Please sign in to comment.