Skip to content

Commit

Permalink
Use initial cataloguing date instead of alma indexing date #2114
Browse files Browse the repository at this point in the history
MNG only states the data whenthe record was indexed in alma not initially catalogued. When migrating from ALEPH to ALMA the information from MARC 002 (fromer dateCreated) was mapped to MARC 008/00-05. This commit reintroduce the initital cataluging date again and uses the alma indexing date only as fallback.
  • Loading branch information
TobiasNx committed Dec 19, 2024
1 parent 3b464f4 commit 0f3c702
Show file tree
Hide file tree
Showing 148 changed files with 165 additions and 155 deletions.
26 changes: 18 additions & 8 deletions src/main/resources/alma/fix/describedBy.fix
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,32 @@ add_field("describedBy.resultOf.instrument.label","Software lobid-resources")
copy_field("almaMmsId","describedBy.resultOf.object.id")
prepend("describedBy.resultOf.object.id","https://lobid.org/marcxml/")

# MNG is a ALMA-specific element
# MNG is a ALMA-specific element (MNG .b only states the indexing date into ALMA, while 008 is the initial cataloguing date.)

copy_field("008","@initialCataloguingDate")
substring("@initialCataloguingDate","0","6")
if any_match("@initialCataloguingDate","^[0-4].*")
prepend("@initialCataloguingDate","20")
elsif any_match("@initialCataloguingDate","\\d*")
prepend("@initialCataloguingDate","19")
else
copy_field("MNG .b","@initialCataloguingDate")
end
copy_field("@initialCataloguingDate","describedBy.resultOf.object.dateCreated")

copy_field("MNG .b","describedBy.resultOf.object.dateCreated")
copy_field("MNG .d","describedBy.resultOf.object.dateModified")
replace_all("describedBy.resultOf.object.dateCreated","-","")
replace_all("describedBy.resultOf.object.dateCreated"," .*","")
replace_all("describedBy.resultOf.object.dateCreated","c|©|\\s?|,|.|:|;|/|=","")
replace_all("describedBy.resultOf.object.dateModified","-","")
replace_all("describedBy.resultOf.object.dateModified"," .*","")
replace_all("describedBy.resultOf.object.dateModified","c|©|\\s?|,|.|:|;|/|=","")
unless any_match("describedBy.resultOf.object.dateCreated","\\d{8}|\\d{4}")
remove_field("describedBy.resultOf.object.dateCreated")
end
unless any_match("describedBy.resultOf.object.dateModified","\\d{8}|\\d{4}")
remove_field("describedBy.resultOf.object.dateModified")
end
#unless any_match("describedBy.resultOf.object.dateCreated","\\d{8}|\\d{4}")
# remove_field("describedBy.resultOf.object.dateCreated")
#end
#unless any_match("describedBy.resultOf.object.dateModified","\\d{8}|\\d{4}")
# remove_field("describedBy.resultOf.object.dateModified")
#end
replace_all("describedBy.resultOf.object.dateCreated","^(\\d{4})(\\d{2})(\\d{2})$","$1-$2-$3")
replace_all("describedBy.resultOf.object.dateModified","^(\\d{4})(\\d{2})(\\d{2})$","$1-$2-$3")
replace_all("describedBy.resultOf.object.dateCreated","^(\\d{4})$","$1-01-01")
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990001412590206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990001412590206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "2000-01-11",
"dateModified" : "2023-02-10",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990001412590206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990011470300206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990011470300206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1988-06-22",
"dateModified" : "2023-08-22",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990011470300206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990014830510206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990014830510206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-05-10",
"dateModified" : "2023-08-10",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990014830510206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990016782920206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990016782920206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1992-08-28",
"dateModified" : "2021-04-07",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990016782920206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990021367710206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990021367710206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "1999-07-12",
"dateModified" : "2023-04-02",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990021367710206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990021974470206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990021974470206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1996-06-04",
"dateModified" : "2023-04-02",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990021974470206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990026405480206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990026405480206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1995-12-08",
"dateModified" : "2023-04-03",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990026405480206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990030574430206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990030574430206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1998-01-05",
"dateModified" : "2023-02-09",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990030574430206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990033263300206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990033263300206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1998-04-29",
"dateModified" : "2021-04-07",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990033263300206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990035016180206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990035016180206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "1998-07-16",
"dateModified" : "2023-04-03",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990035016180206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990041403870206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990041403870206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-03-02",
"dateModified" : "2021-04-07",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990041403870206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990050000600206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990050000600206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "1998-11-16",
"dateModified" : "2023-05-30",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990050000600206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990051552280206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990051552280206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-02-22",
"dateModified" : "2022-02-15",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990051552280206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990051708340206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990051708340206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-03-11",
"dateModified" : "2021-04-07",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990051708340206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990052965140206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990052965140206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "2000-01-17",
"dateModified" : "2022-11-08",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990052965140206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990053976760206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990053976760206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-11-18",
"dateModified" : "2023-04-22",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990053976760206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990054089950206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990054089950206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-11-19",
"dateModified" : "2024-04-28",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990054089950206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990054215550206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990054215550206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "1999-11-18",
"dateModified" : "2023-08-01",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990054215550206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990054301770206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990054301770206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-11-18",
"dateModified" : "2023-08-07",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990054301770206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990054345550206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990054345550206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-11-20",
"dateModified" : "2023-05-15",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990054345550206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990055981810206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990055981810206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "1999-11-21",
"dateModified" : "2023-05-30",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990055981810206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990058434730206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990058434730206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-02-28",
"dateModified" : "2022-09-13",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990058434730206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990058567920206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990058567920206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "1993-12-25",
"dateModified" : "2023-04-03",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990058567920206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990059571560206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990059571560206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1998-06-15",
"dateModified" : "2023-04-03",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990059571560206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990063549080206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990063549080206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "1997-09-12",
"dateModified" : "2023-04-24",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990063549080206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990065341720206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990065341720206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "1993-09-30",
"dateModified" : "2023-04-24",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990065341720206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990075429930206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990075429930206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1998-10-24",
"dateModified" : "2022-03-14",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990075429930206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990075538650206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990075538650206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1988-10-06",
"dateModified" : "2023-04-02",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990075538650206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990103770440206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990103770440206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-11-19",
"dateModified" : "2023-08-08",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990103770440206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990103899140206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990103899140206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "1999-11-20",
"dateModified" : "2023-04-23",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990103899140206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990104908070206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990104908070206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-11-20",
"dateModified" : "2023-05-15",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990104908070206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990108740950206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990108740950206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-11-22",
"dateModified" : "2023-04-26",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990108740950206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990108873860206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990108873860206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-11-16",
"dateModified" : "2023-04-23",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990108873860206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990108874370206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990108874370206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-11-16",
"dateModified" : "2023-04-23",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990108874370206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990109712970206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990109712970206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "2000-01-03",
"dateModified" : "2023-05-31",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990109712970206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990110509950206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990110509950206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "1994-08-29",
"dateModified" : "2023-03-26",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990110509950206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990110714900206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990110714900206441",
"dateCreated" : "2021-04-06",
"dateCreated" : "1995-09-29",
"dateModified" : "2023-08-20",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990110714900206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990110881770206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990110881770206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1996-08-14",
"dateModified" : "2023-04-24",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990110881770206441 im Exportformat MARC21 XML",
Expand Down
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990112067120206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"object" : {
"id" : "https://lobid.org/marcxml/990112067120206441",
"dateCreated" : "2021-04-05",
"dateCreated" : "1999-12-01",
"dateModified" : "2023-04-24",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 990112067120206441 im Exportformat MARC21 XML",
Expand Down
Loading

0 comments on commit 0f3c702

Please sign in to comment.