Skip to content

Commit

Permalink
Merge pull request #2053 from hbz/1864-database
Browse files Browse the repository at this point in the history
1864-database
  • Loading branch information
TobiasNx authored Aug 15, 2024
2 parents 06589d1 + 38827e7 commit fa71b7f
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 11 deletions.
29 changes: 20 additions & 9 deletions src/main/resources/alma/fix/mediumAndType.fix
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.*")
Expand Down Expand Up @@ -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

Expand Down
6 changes: 6 additions & 0 deletions src/main/resources/labels/context-labels.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {}
}
]
2 changes: 1 addition & 1 deletion src/test/resources/alma-fix/990133067580206441.json
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion src/test/resources/schemas/type.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@
"Image",
"Map",
"Standard",
"MusicalRecording"
"MusicalRecording",
"Database"
]
}
}

0 comments on commit fa71b7f

Please sign in to comment.