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

2124-validateDateCreated #2125

Merged
merged 5 commits into from
Jan 16, 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
4 changes: 2 additions & 2 deletions src/main/resources/alma/fix/describedBy.fix
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ if any_match("008", "^\\d{6}\\D.*") # 008/00-05 is the correct form for the cata
substring("@initialCataloguingDate","0","6")
end

if any_match("@initialCataloguingDate","^[0-4]\\d*") # Complete dates after 2000
if any_match("@initialCataloguingDate","^[0-4]\\d(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])") # Assume dates from 2000-01-01 to 2049-12-31 ( e.g. matching 491231)
prepend("@initialCataloguingDate","20")
elsif any_match("@initialCataloguingDate","\\d*") # Complete dates before 2000
elsif any_match("@initialCataloguingDate","\\d{2}(0[1-9]|1[012])(0[1-9]|[12][0-9]|3[01])") # Assume dates from 1900-01-01 to 1999-12-31 ( e.g. matching 991231)
prepend("@initialCataloguingDate","19")
else
copy_field("MNG .b","@initialCataloguingDate")
Expand Down
259 changes: 259 additions & 0 deletions src/test/resources/alma-fix/99373737680006441.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,259 @@
{
"@context" : "http://lobid.org/resources/context.jsonld",
"id" : "http://lobid.org/resources/99373737680006441#!",
"type" : [ "BibliographicResource", "Book" ],
"medium" : [ {
"label" : "Print",
"id" : "http://rdaregistry.info/termList/RDAproductionMethod/1010"
} ],
"title" : "Mineralöl und Erdgas 1977",
"almaMmsId" : "99373737680006441",
"hbzId" : "HT030673176",
"deprecatedUri" : "http://lobid.org/resources/HT030673176#!",
"publication" : [ {
"startDate" : "1978",
"type" : [ "PublicationEvent" ],
"location" : [ "Hamburg" ],
"publishedBy" : [ "Deutsche Shell AG" ]
} ],
"describedBy" : {
"id" : "http://lobid.org/resources/99373737680006441",
"label" : "Webseite der hbz-Ressource 99373737680006441",
"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/99373737680006441",
"dateCreated" : "2024-02-28",
"dateModified" : "2024-03-07",
"type" : [ "DataFeedItem" ],
"label" : "hbz-Ressource 99373737680006441 im Exportformat MARC21 XML",
"inDataset" : {
"id" : "https://datahub.io/dataset/hbz_unioncatalog",
"label" : "hbz_unioncatalog"
},
"sourceOrganization" : {
"id" : "http://lobid.org/organisations/DE-38#!",
"label" : "Universitäts- und Stadtbibliothek Köln, Hauptabteilung"
},
"provider" : {
"id" : "http://lobid.org/organisations/DE-38#!",
"label" : "Universitäts- und Stadtbibliothek Köln, Hauptabteilung"
},
"modifiedBy" : [ {
"id" : "http://lobid.org/organisations/DE-38#!",
"label" : "Universitäts- und Stadtbibliothek Köln, Hauptabteilung"
} ]
}
},
"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)99373737680006441",
"label" : "Culturegraph Ressource"
} ],
"isPartOf" : [ {
"type" : [ "IsPartOfRelation" ],
"hasSuperordinate" : [ {
"label" : "Shell Briefing Service"
} ]
} ],
"inCollection" : [ {
"id" : "https://nrw.digibib.net/search/hbzvk/",
"label" : "DigiBib hbz Verbundkatalog",
"type" : [ "Collection" ]
}, {
"id" : "http://lobid.org/organisations/DE-655#!",
"label" : "hbz - Hochschulbibliothekszentrum des Landes Nordrhein-Westfalen, Netzwerkzone",
"type" : [ "Collection" ]
} ],
"language" : [ {
"id" : "http://id.loc.gov/vocabulary/iso639-2/ger",
"label" : "Deutsch"
} ],
"extent" : "8 Seiten : Illustrationen",
"subject" : [ {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Shell"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Erdöl"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Mineralöl"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Rohöl"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Erdgas"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Statistik"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Ölförderung"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Erdölförderung"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Erdgasförderung"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Gasförderung"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Energiestatistik"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Tanker"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Öltanker"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Flüssiggastanker"
}, {
"type" : [ "Concept" ],
"source" : {
"label" : "Freie Verschlagwortung",
"id" : "https://www.wikidata.org/wiki/Q47524318"
},
"label" : "Öltransport"
} ],
"subjectslabels" : [ "Shell", "Erdöl", "Mineralöl", "Rohöl", "Erdgas", "Statistik", "Ölförderung", "Erdölförderung", "Erdgasförderung", "Gasförderung", "Energiestatistik", "Tanker", "Öltanker", "Flüssiggastanker", "Öltransport" ],
"hasItem" : [ {
"label" : "lobid Bestandsressource",
"type" : [ "Item", "PhysicalObject" ],
"callNumber" : "119/EN-11-17(1978)",
"serialNumber" : "119T0000182",
"currentLibrary" : "38-119",
"currentLocation" : "38-119-BIB",
"heldBy" : {
"isil" : "DE-38-119",
"id" : "http://lobid.org/organisations/DE-38-119#!",
"label" : "Energiewirtschaftliches Institut an der Universtät zu Köln, Bibliothek"
},
"seeAlso" : [ "https://katalog.ub.uni-koeln.de/portal/search.html?num=20&page=1&l=de&srt=year_desc&tab=books&hbzid=99373737680006441&fdb=uni" ],
"inCollection" : [ {
"id" : "http://lobid.org/organisations/DE-38#!",
"label" : "Universitäts- und Stadtbibliothek Köln, Hauptabteilung"
} ],
"id" : "http://lobid.org/items/99373737680006441:DE-38-119:23358788720006476#!"
} ],
"bibliographicLevel" : {
"label" : "Monograph/Item",
"id" : "https://www.loc.gov/marc/bibliographic/bdleader.html#Monograph_Item"
},
"responsibilityStatement" : [ "Shell Austria AG, Wien, Abteilung PR ; Shell Switzerland, Zürich, Abteilung ER ; Deutsche Shell AG, Hamburg, Abteilung Information und Presse" ],
"contribution" : [ {
"agent" : {
"gndIdentifier" : "1198947047",
"id" : "https://d-nb.info/gnd/1198947047",
"label" : "Deutsche Shell-Aktiengesellschaft. Abteilung Information und Presse",
"type" : [ "CorporateBody" ],
"altLabel" : [ "Deutsche Shell-Aktiengesellschaft. Abt. Information und Presse", "Abteilung Information und Presse (Deutsche Shell-Aktiengesellschaft)", "Abt. Information und Presse (Deutsche Shell-Aktiengesellschaft)" ]
},
"role" : {
"id" : "http://id.loc.gov/vocabulary/relators/isb",
"label" : "Herausgeber/in"
},
"type" : [ "Contribution" ]
}, {
"agent" : {
"gndIdentifier" : "119895342X",
"id" : "https://d-nb.info/gnd/119895342X",
"label" : "Shell Austria Aktiengesellschaft. Abteilung PR",
"type" : [ "CorporateBody" ],
"altLabel" : [ "Shell Austria Aktiengesellschaft. Abteilung Public Relations", "Abteilung PR (Shell Austria Aktiengesellschaft)", "Abteilung Public Relations (Shell Austria Aktiengesellschaft)" ]
},
"role" : {
"id" : "http://id.loc.gov/vocabulary/relators/isb",
"label" : "Herausgeber/in"
},
"type" : [ "Contribution" ]
}, {
"agent" : {
"gndIdentifier" : "1196636184",
"id" : "https://d-nb.info/gnd/1196636184",
"label" : "Shell (Switzerland). Abteilung ER (Firma)",
"type" : [ "CorporateBody" ],
"altLabel" : [ "Shell (Switzerland). Abteilung External Relations (Firma)", "Abteilung ER (Shell (Switzerland), Firma)", "Abteilung External Relations (Shell (Switzerland), Firma)" ]
},
"role" : {
"id" : "http://id.loc.gov/vocabulary/relators/isb",
"label" : "Herausgeber/in"
},
"type" : [ "Contribution" ]
} ]
}
Loading
Loading