Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add workaround if cataloguing dates in 008 that are too long #2118

Merged
merged 5 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions src/main/resources/alma/fix/describedBy.fix
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,18 @@ 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 .b only states the indexing date into ALMA, while 008 is the initial cataloguing date.)
# 008/00-05 has the initial cataloguing date. We test strictly if 008 only has 6 digits, sometimes records have 8 digits that are not valid.
# We use MNG info as fallback.
# MNG is a ALMA-specific element (MNG .b only states the indexing date into ALMA.)

copy_field("008","@initialCataloguingDate")
substring("@initialCataloguingDate","0","6")
if any_match("@initialCataloguingDate","^[0-4].*")
if any_match("008", "^\\d{6}\\D.*") # 008/00-05 is the correct form for the cataloguing date in MARC.
copy_field("008","@initialCataloguingDate")
substring("@initialCataloguingDate","0","6")
end

if any_match("@initialCataloguingDate","^[0-4]\\d*") # Complete dates after 2000
prepend("@initialCataloguingDate","20")
elsif any_match("@initialCataloguingDate","\\d*")
elsif any_match("@initialCataloguingDate","\\d*") # Complete dates before 2000
prepend("@initialCataloguingDate","19")
else
copy_field("MNG .b","@initialCataloguingDate")
Expand Down
176 changes: 176 additions & 0 deletions src/test/resources/alma-fix/99374515437806441.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,176 @@
{
"@context" : "http://lobid.org/resources/context.jsonld",
"id" : "http://lobid.org/resources/99374515437806441#!",
"type" : [ "BibliographicResource", "Bibliography", "Book" ],
"medium" : [ {
"label" : "Datenträger",
"id" : "http://rdaregistry.info/termList/RDAMediaType/1003"
}, {
"label" : "Online-Ressource",
"id" : "http://rdaregistry.info/termList/RDACarrierType/1018"
} ],
"title" : "Remote sensing of climate",
"almaMmsId" : "99374515437806441",
"isbn" : [ "9780443217302", "0443217300" ],
"publication" : [ {
"startDate" : "2024",
"type" : [ "PublicationEvent" ],
"location" : [ "Amsterdam", "Cambridge, MA" ],
"publishedBy" : [ "Elsevier" ]
} ],
"describedBy" : {
"id" : "http://lobid.org/resources/99374515437806441",
"label" : "Webseite der hbz-Ressource 99374515437806441",
"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/99374515437806441",
"dateCreated" : "2024-08-19",
"dateModified" : "2024-10-30",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 99374515437806441 im Exportformat MARC21 XML",
"inDataset" : {
"id" : "https://datahub.io/dataset/hbz_unioncatalog",
"label" : "hbz_unioncatalog"
},
"sourceOrganization" : {
"id" : "https://ebookcentral.proquest.com/",
"label" : "ebookcentral.proquest.com"
},
"provider" : {
"id" : "https://ebookcentral.proquest.com/",
"label" : "ebookcentral.proquest.com"
},
"modifiedBy" : [ {
"id" : "https://ebookcentral.proquest.com/",
"label" : "ebookcentral.proquest.com"
} ]
}
},
"license" : [ {
"id" : "http://creativecommons.org/publicdomain/zero/1.0",
"label" : "Creative Commons-Lizenz CC0 1.0 Universal"
} ]
},
"sameAs" : [ {
"id" : "https://hub.culturegraph.org/resource/(DE-605)99374515437806441",
"label" : "Culturegraph Ressource"
} ],
"related" : [ {
"note" : [ "Print version:" ],
"isbn" : [ "9780443217319", "0443217319" ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
"label" : "DigiBib hbz Verbundkatalog",
"type" : [ "Collection" ]
} ],
"extent" : "1 online resource (458 pages)",
"subject" : [ {
"type" : [ "Concept" ],
"source" : {
"label" : "Library of Congress Subject Headings",
"id" : "https://id.loc.gov/authorities/subjects.html"
},
"label" : "Climatology / Remote sensing."
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Dewey-Dezimalklassifikation",
"id" : "https://d-nb.info/gnd/4149423-4"
},
"label" : "551.6",
"notation" : "551.6"
} ],
"subjectslabels" : [ "Climatology / Remote sensing." ],
"hasItem" : [ {
"type" : [ "Item", "DigitalDocument" ],
"label" : "Electronic Portfolio",
"electronicLocator" : "https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_OWL/openurl?u.ignore_date_coverage=true&portfolio_pid=5353389590006468&Force_direct=true",
"sublocation" : "https://hbz-network.userservices.exlibrisgroup.com/view/uresolver/49HBZ_OWL/openurl?u.ignore_date_coverage=true&rft.mms_id=991004397752606468",
"heldBy" : {
"isil" : "DE-743",
"id" : "http://lobid.org/organisations/DE-743#!",
"label" : "Technische Hochschule Ostwestfalen-Lippe, Service Kommunikation Information Medien"
},
"seeAlso" : [ "https://th-owl.digibib.net/search/katalog/record/(DE-605)99374515437806441" ],
"inCollection" : [ {
"id" : "http://lobid.org/organisations/DE-743#!",
"label" : "Technische Hochschule Ostwestfalen-Lippe, Service Kommunikation Information Medien"
} ],
"id" : "http://lobid.org/items/99374515437806441:DE-743:5353389590006468#!"
}, {
"type" : [ "Item", "DigitalDocument" ],
"label" : "Electronic Portfolio",
"electronicLocator" : "https://eu04.alma.exlibrisgroup.com/view/uresolver/49HBZ_UBT/openurl?u.ignore_date_coverage=true&portfolio_pid=53379905320006470&Force_direct=true",
"sublocation" : "https://hbz-network.userservices.exlibrisgroup.com/view/uresolver/49HBZ_UBT/openurl?u.ignore_date_coverage=true&rft.mms_id=9928037879906470",
"heldBy" : {
"isil" : "DE-385",
"id" : "http://lobid.org/organisations/DE-385#!",
"label" : "Universitätsbibliothek Trier"
},
"seeAlso" : [ "https://tricat.uni-trier.de/permalink/49HBZ_UBT/1hikhph/alma99374515437806441" ],
"inCollection" : [ {
"id" : "http://lobid.org/organisations/DE-385#!",
"label" : "Universitätsbibliothek Trier"
} ],
"id" : "http://lobid.org/items/99374515437806441:DE-385:53379905320006470#!"
} ],
"bibliographicLevel" : {
"label" : "Monograph/Item",
"id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item"
},
"responsibilityStatement" : [ "edited by Timothy Dube [and three others]." ],
"contribution" : [ {
"agent" : {
"label" : "Dube, Timothy",
"type" : [ "Person" ]
},
"role" : {
"id" : "http://id.loc.gov/vocabulary/relators/edt",
"label" : "Herausgeber/in"
},
"type" : [ "Contribution" ]
}, {
"agent" : {
"label" : "Shekede, Munyaradzi Davis",
"type" : [ "Person" ]
},
"role" : {
"id" : "http://id.loc.gov/vocabulary/relators/ctb",
"label" : "Beitragende/r"
},
"type" : [ "Contribution" ]
}, {
"agent" : {
"label" : "Shoko, Cletah",
"type" : [ "Person" ]
},
"role" : {
"id" : "http://id.loc.gov/vocabulary/relators/ctb",
"label" : "Beitragende/r"
},
"type" : [ "Contribution" ]
}, {
"agent" : {
"label" : "Mushore, Terence",
"type" : [ "Person" ]
},
"role" : {
"id" : "http://id.loc.gov/vocabulary/relators/ctb",
"label" : "Beitragende/r"
},
"type" : [ "Contribution" ]
} ]
}
Loading
Loading