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

Fix missing cats #157

Merged
merged 4 commits into from
Mar 19, 2024
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 package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"url": "[email protected]:natlibfi/melinda-marc-record-merge-reducers-js.git"
},
"license": "LGPL-3.0+",
"version": "2.2.0",
"version": "2.2.1-alpha.2",
"main": "./dist/index.js",
"engines": {
"node": ">=18"
Expand Down
7 changes: 3 additions & 4 deletions src/reducers/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"recordType": "source",
"comment": "MRA-763: remove many fields from a source prepublication if base record is good enough",
"fieldSpecification": {
"tagPattern": "^((?!LOW|SID|00[135678]|035|040|042|500|506|540|594|776|884|946|974).)*$",
"tagPattern": "^((?!CAT|LOW|SID|00[135678]|035|040|042|500|506|540|594|776|884|946|974).)*$",
"encodingLevel": ["8"]
},
"requireSourceField": {
Expand All @@ -34,7 +34,7 @@
"recordType": "source",
"comment": "MRA-763: remove many fields from a source prepublication if base record is good enough (Koneellisesti tuotettu tietue)",
"fieldSpecification": {
"tagPattern": "^((?!LOW|SID|00[135678]|035|040|042|500|506|540|594|776|884|946|974).)*$",
"tagPattern": "^((?!CAT|LOW|SID|00[135678]|035|040|042|500|506|540|594|776|884|946|974).)*$",
"encodingLevel": ["2", "8"]
},
"requireSourceField": {
Expand Down Expand Up @@ -158,7 +158,7 @@

],
"mergeConfiguration" :
{
{
"comment #1" : "Meaningless indicators (=indicators having but one legal value) are derived from melindaCustomMergeFields.",
"comment #2" : "Meaningless indicators and non-filing indicators never prevent merge. (Hard-coded in mergableIndicator.js)",
"comment #3" : "When merging, indicator preference defaults are defined in mergeIndicators.js. However, these can be overridden here.",
Expand Down Expand Up @@ -530,6 +530,5 @@
[

]


}
9 changes: 9 additions & 0 deletions test-fixtures/reducers/index/MRA-764_keep_CATs/base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"leader": "01331cam a22003494i 4500",
"fields": [
{ "tag": "001", "value": "123456" },
{ "tag": "300", "ind1": " ", "ind2": " ", "subfields": [
{ "code": "a", "value": "1 verkkoaineisto (7 h 36 min)" }
]}
]
}
23 changes: 23 additions & 0 deletions test-fixtures/reducers/index/MRA-764_keep_CATs/merged.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"leader": "01331cam a22003494i 4500",
"fields": [
{ "tag": "001", "value": "123456" },
{ "tag": "300", "ind1": " ", "ind2": " ", "subfields": [
{ "code": "a", "value": "1 verkkoaineisto (7 h 36 min)" }
]},
{ "tag": "500", "ind1": " ", "ind2": " ", "subfields": [ { "code": "a", "value": "Sen sijaan tämä kommentti mergeytyy." } ]},
{ "tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
{ "code": "c", "value": "123" },
{ "code": "b", "value": "owner" }
]},
{ "tag": "CAT", "ind1": " ", "ind2": " ", "subfields": [
{ "code": "a", "value": "CONV-ISBD" },
{ "code": "c", "value": "20120402" }
]},
{ "tag": "CAT", "ind1": " ", "ind2": " ", "subfields": [
{ "code": "a", "value": "CONV-RDA" },
{ "code": "l", "value": "FIN01" },
{ "code": "h", "value": "0839" }
]}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"description":"MRA-764: if the source record is a prepub, keep also CAT fields",
"skip": false,
"only": false
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"leader": "01331cam a22003498i 4500",
"fields": [
{ "tag": "001", "value": "123456" }
]
}
29 changes: 29 additions & 0 deletions test-fixtures/reducers/index/MRA-764_keep_CATs/source.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"leader": "01331cam a22003498i 4500",
"fields": [
{ "tag": "001", "value": "123456" },
{ "tag": "336", "ind1": " ", "ind2": " ", "subfields": [
{ "code": "a", "value": "teksti" },
{ "code": "b", "value": "txt" },
{ "code": "2", "value": "rdamedia" }
]},

{ "tag": "500", "ind1": " ", "ind2": " ", "subfields": [ { "code": "a", "value": "TARKISTETTU ENNAKKOTIETO ei mergeydy!" } ]},
{ "tag": "500", "ind1": " ", "ind2": " ", "subfields": [ { "code": "a", "value": "Sen sijaan tämä kommentti mergeytyy." } ]},
{ "tag": "502", "ind1": " ", "ind2": " ", "subfields": [ { "code": "a", "value": "Väitöskirja." } ]},
{ "tag": "LKR", "ind1": " ", "ind2": " ", "subfields": [ { "code": "a", "value": "sokeritoukka" } ]},
{ "tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
{ "code": "c", "value": "123" },
{ "code": "b", "value": "owner" }
]},
{ "tag": "CAT", "ind1": " ", "ind2": " ", "subfields": [
{ "code": "a", "value": "CONV-ISBD" },
{ "code": "c", "value": "20120402" }
]},
{ "tag": "CAT", "ind1": " ", "ind2": " ", "subfields": [
{ "code": "a", "value": "CONV-RDA" },
{ "code": "l", "value": "FIN01" },
{ "code": "h", "value": "0839" }
]}
]
}
Loading