diff --git a/src/main/resources/alma/fix/mediumAndType.fix b/src/main/resources/alma/fix/mediumAndType.fix index 0ed34b072..45581e1b5 100644 --- a/src/main/resources/alma/fix/mediumAndType.fix +++ b/src/main/resources/alma/fix/mediumAndType.fix @@ -51,6 +51,12 @@ end paste("@leaderTyp+008","@leaderTyp","008", join_char:"") +# Collects Portfolio resource types +set_array("@PORtype") +do list(path: "POR ","var":"$i") + copy_field("$i.f","@PORtype.$append") +end + # medium (Mappings based on old ALEPH-morph, Introx Mapping and 050 Mapping from Verbund) # https://service-wiki.hbz-nrw.de/display/VDBE/ALT+-+Mapping+MAB2+-+MARC+21+-++Segmente+0---%2C+001+-+088+-+Kurzform @@ -398,6 +404,17 @@ end # TODO: HT018860300 should also be tagged as Biography but it seems that 008 has no info for Biografie and is not transformed properly. +# type: "Database +if any_match("@leaderTyp+008", "(Continuing Resources)(.{21})d.*") # Pos21 # d - Updating database + add_field("type[].$append","Database") +elsif any_match("natureOfContent[].*.label", ".*[Da]tenbank.*") + add_field("type[].$append", "Database") +elsif any_equal("@PORtype","DATABASE") + add_field("type[].$append","Database") +elsif any_match("090 .g", "a") + add_field("type[].$append","Database") +end + # type: "EditedVolume" if any_match("natureOfContent[].*.label", ".*Aufsatzsammlung.*") @@ -571,15 +588,9 @@ elsif any_match("natureOfContent[].*.label", "(?i).*(Zeitschrift|Periodical).*") add_field("type[].$append", "Periodical") elsif any_equal("906", "JOURNAL") add_field("type[].$append","Periodical") -else - set_array("@PORtype") - do list(path: "POR ","var":"$i") - copy_field("$i.f","@PORtype.$append") - end - if any_equal("@PORtype","JOURNAL") - unless any_equal("@PORtype","BOOK") - add_field("type[].$append","Periodical") - end +elsif any_equal("@PORtype","JOURNAL") + unless any_equal("@PORtype","BOOK") + add_field("type[].$append","Periodical") end end diff --git a/src/main/resources/labels/context-labels.json b/src/main/resources/labels/context-labels.json index feccc176f..bf9eb055d 100644 --- a/src/main/resources/labels/context-labels.json +++ b/src/main/resources/labels/context-labels.json @@ -1012,5 +1012,11 @@ "name": "Thesis", "multilangLabel": {}, "uri": "http://purl.org/ontology/bibo/Thesis" + }, + { + "name": "Database", + "uri": "http://vivoweb.org/ontology/core#Database", + "label": "Datenbank", + "multilangLabel": {} } ] diff --git a/src/test/resources/alma-fix/990133067580206441.json b/src/test/resources/alma-fix/990133067580206441.json index f4f44ef8f..7167528b0 100644 --- a/src/test/resources/alma-fix/990133067580206441.json +++ b/src/test/resources/alma-fix/990133067580206441.json @@ -1,7 +1,7 @@ { "@context" : "http://lobid.org/resources/context.jsonld", "id" : "http://lobid.org/resources/990133067580206441#!", - "type" : [ "BibliographicResource", "Bibliography", "Periodical" ], + "type" : [ "BibliographicResource", "Bibliography", "Database", "Periodical" ], "medium" : [ { "label" : "Datenträger", "id" : "http://rdaregistry.info/termList/RDAMediaType/1003" diff --git a/src/test/resources/schemas/type.json b/src/test/resources/schemas/type.json index 012b33c6c..3183e5562 100644 --- a/src/test/resources/schemas/type.json +++ b/src/test/resources/schemas/type.json @@ -41,7 +41,8 @@ "Image", "Map", "Standard", - "MusicalRecording" + "MusicalRecording", + "Database" ] } }