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

Enrich records with rvk from callNumber #2101

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft
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
18 changes: 18 additions & 0 deletions src/main/resources/alma/fix/item.fix
Original file line number Diff line number Diff line change
Expand Up @@ -125,3 +125,21 @@ do list(path: "hasItem[]","var":"$i")
add_field("$i.inCollection[].1.label","Bibliotheken ohne zentrale Katalogisierung (IZ Bridge)")
end
end

set_array("@callNumberRvk[]")
do list(path:"hasItem[]","var":"$i")
if any_match("$i.callNumber","([A-Z]{2} \\d{3,6})(\\.\\d*)?( [A-Z]\\d+)+([\\.\\d\\-\\(\\)+]*)?")
copy_field("$i.callNumber","@callNumberRvk[].$append")
end
end

replace_all("@callNumberRvk[].*","([A-Z][A-Z] \\d{3,6}) .*","$1")

do list(path:"@callNumberRvk[]","var":"$i")
copy_field("$i","subject[].$append.notation")
set_array("subject[].$last.type[]","Concept")
add_field("subject[].$last.source.label","RVK (Regensburger Verbundklassifikation)")
add_field("subject[].$last.source.id","https://d-nb.info/gnd/4449787-8")
end

uniq("subject[]")
7 changes: 7 additions & 0 deletions src/test/resources/alma-fix/990014830510206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,13 @@
"dateOfDeath" : "1977",
"altLabel" : [ "Chaplin, Charles S.", "Spencer Chaplin, Charles", "Chaplin, Charly", "Tsaplin, Tsarl Spenser", "Sa-plin, Sác-li", "Cāplin, Cārlī", "Čaplin, Č'arlz", "Chaplin, Charles Spencer", "Chaplin, Charles", "Čaplin, Čarl'z Spenser", "Spencer-Chaplin, Charles", "Чаплин, Чарльз", "Zhuobielin", "Sarlō", "Charlot", "Sac-lô" ]
} ]
}, {
"notation" : "AP 51081",
"type" : [ "Concept" ],
"source" : {
"label" : "RVK (Regensburger Verbundklassifikation)",
"id" : "https://d-nb.info/gnd/4449787-8"
}
} ],
"subjectslabels" : [ "Chaplin, Charlie" ],
"hasItem" : [ {
Expand Down
7 changes: 7 additions & 0 deletions src/test/resources/alma-fix/990058434730206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@
"dateOfDeath" : "0039",
"altLabel" : [ "Herodes Antipatros", "Herodes, Antipas" ]
} ]
}, {
"notation" : "BC 8740",
"type" : [ "Concept" ],
"source" : {
"label" : "RVK (Regensburger Verbundklassifikation)",
"id" : "https://d-nb.info/gnd/4449787-8"
}
} ],
"subjectslabels" : [ "Herodes <Judäa, König, I.>", "Makkabäer", "Herrschaftssystem", "Neues Testament / Zeithintergrund", "Herodes Antipas, Galiläa, Tetrarch" ],
"hasItem" : [ {
Expand Down
8 changes: 8 additions & 0 deletions src/test/resources/alma-fix/990075429930206441.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,14 @@
"label" : "Deutsch"
} ],
"extent" : "64 S.",
"subject" : [ {
"notation" : "BO 4075",
"type" : [ "Concept" ],
"source" : {
"label" : "RVK (Regensburger Verbundklassifikation)",
"id" : "https://d-nb.info/gnd/4449787-8"
}
} ],
"hasItem" : [ {
"label" : "lobid Bestandsressource",
"type" : [ "Item", "PhysicalObject" ],
Expand Down
Loading