@natlibfi/marc-record-validators-melinda 12.0.0-alpha.9 → 12.0.1-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (292) hide show
  1. package/dist/access-rights.test.js +1 -1
  2. package/dist/access-rights.test.js.map +1 -1
  3. package/dist/addMissingField337.test.js +1 -1
  4. package/dist/addMissingField337.test.js.map +1 -1
  5. package/dist/addMissingField338.test.js +1 -1
  6. package/dist/addMissingField338.test.js.map +1 -1
  7. package/dist/cyrillux-usemarcon-replacement.test.js +4 -7
  8. package/dist/cyrillux-usemarcon-replacement.test.js.map +2 -2
  9. package/dist/cyrillux.test.js +1 -1
  10. package/dist/cyrillux.test.js.map +1 -1
  11. package/dist/disambiguateSeriesStatements.test.js +1 -7
  12. package/dist/disambiguateSeriesStatements.test.js.map +2 -2
  13. package/dist/double-commas.test.js +1 -1
  14. package/dist/double-commas.test.js.map +1 -1
  15. package/dist/drop-terms.js +122 -0
  16. package/dist/drop-terms.js.map +7 -0
  17. package/dist/drop-terms.test.js +56 -0
  18. package/dist/drop-terms.test.js.map +7 -0
  19. package/dist/empty-fields.test.js +1 -1
  20. package/dist/empty-fields.test.js.map +1 -1
  21. package/dist/ending-punctuation.test.js +39 -19
  22. package/dist/ending-punctuation.test.js.map +2 -2
  23. package/dist/field-008-18-34-character-groups.test.js +2 -8
  24. package/dist/field-008-18-34-character-groups.test.js.map +2 -2
  25. package/dist/field-505-separators.test.js +1 -7
  26. package/dist/field-505-separators.test.js.map +2 -2
  27. package/dist/field-521-fix.test.js +1 -7
  28. package/dist/field-521-fix.test.js.map +2 -2
  29. package/dist/field-exclusion.test.js +11 -8
  30. package/dist/field-exclusion.test.js.map +2 -2
  31. package/dist/field-structure.test.js +1 -1
  32. package/dist/field-structure.test.js.map +1 -1
  33. package/dist/fields-present.test.js +1 -1
  34. package/dist/fields-present.test.js.map +1 -1
  35. package/dist/fix-33X.test.js +1 -1
  36. package/dist/fix-33X.test.js.map +1 -1
  37. package/dist/fix-country-codes.test.js +1 -7
  38. package/dist/fix-country-codes.test.js.map +2 -2
  39. package/dist/fix-sami-041.js +87 -0
  40. package/dist/fix-sami-041.js.map +7 -0
  41. package/dist/fix-sami-041.test.js +40 -0
  42. package/dist/fix-sami-041.test.js.map +7 -0
  43. package/dist/fixRelatorTerms.test.js +2 -8
  44. package/dist/fixRelatorTerms.test.js.map +2 -2
  45. package/dist/fixed-fields.test.js +29 -18
  46. package/dist/fixed-fields.test.js.map +2 -2
  47. package/dist/identical-fields.test.js +1 -1
  48. package/dist/identical-fields.test.js.map +1 -1
  49. package/dist/index.js +7 -1
  50. package/dist/index.js.map +2 -2
  51. package/dist/indicator-fixes.js +10 -0
  52. package/dist/indicator-fixes.js.map +2 -2
  53. package/dist/indicator-fixes.test.js +1 -7
  54. package/dist/indicator-fixes.test.js.map +2 -2
  55. package/dist/isbn-issn.js +1 -1
  56. package/dist/isbn-issn.js.map +2 -2
  57. package/dist/isbn-issn.test.js +9 -6
  58. package/dist/isbn-issn.test.js.map +2 -2
  59. package/dist/item-language.test.js +1 -1
  60. package/dist/item-language.test.js.map +2 -2
  61. package/dist/merge-fields.test.js +2 -7
  62. package/dist/merge-fields.test.js.map +2 -2
  63. package/dist/mergeField500Lisapainokset.test.js +1 -7
  64. package/dist/mergeField500Lisapainokset.test.js.map +2 -2
  65. package/dist/mergeRelatorTermFields.test.js +1 -7
  66. package/dist/mergeRelatorTermFields.test.js.map +2 -2
  67. package/dist/multiple-subfield-0.test.js +1 -7
  68. package/dist/multiple-subfield-0.test.js.map +2 -2
  69. package/dist/normalize-dashes.test.js +1 -7
  70. package/dist/normalize-dashes.test.js.map +2 -2
  71. package/dist/normalize-identifiers.test.js +1 -7
  72. package/dist/normalize-identifiers.test.js.map +2 -2
  73. package/dist/normalize-qualifying-information.test.js +1 -7
  74. package/dist/normalize-qualifying-information.test.js.map +2 -2
  75. package/dist/normalize-utf8-diacritics.test.js +1 -7
  76. package/dist/normalize-utf8-diacritics.test.js.map +2 -2
  77. package/dist/normalizeFieldForComparison.js +24 -0
  78. package/dist/normalizeFieldForComparison.js.map +2 -2
  79. package/dist/punctuation.test.js +1 -7
  80. package/dist/punctuation.test.js.map +2 -2
  81. package/dist/punctuation2.test.js +2 -8
  82. package/dist/punctuation2.test.js.map +2 -2
  83. package/dist/reindexSubfield6OccurenceNumbers.test.js +1 -7
  84. package/dist/reindexSubfield6OccurenceNumbers.test.js.map +2 -2
  85. package/dist/remove-041-zxx.js +56 -0
  86. package/dist/remove-041-zxx.js.map +7 -0
  87. package/dist/remove-041-zxx.test.js +40 -0
  88. package/dist/remove-041-zxx.test.js.map +7 -0
  89. package/dist/removeDuplicateDataFields.test.js +2 -8
  90. package/dist/removeDuplicateDataFields.test.js.map +2 -2
  91. package/dist/removeInferiorDataFields.js +1 -9
  92. package/dist/removeInferiorDataFields.js.map +2 -2
  93. package/dist/removeInferiorDataFields.test.js +1 -7
  94. package/dist/removeInferiorDataFields.test.js.map +2 -2
  95. package/dist/resolvable-ext-references-melinda.test.js +1 -1
  96. package/dist/resolvable-ext-references-melinda.test.js.map +2 -2
  97. package/dist/resolveOrphanedSubfield6s.js +1 -3
  98. package/dist/resolveOrphanedSubfield6s.js.map +2 -2
  99. package/dist/resolveOrphanedSubfield6s.test.js +1 -7
  100. package/dist/resolveOrphanedSubfield6s.test.js.map +2 -2
  101. package/dist/sanitize-vocabulary-source-codes.test.js +1 -7
  102. package/dist/sanitize-vocabulary-source-codes.test.js.map +2 -2
  103. package/dist/sort-tags.test.js +1 -1
  104. package/dist/sort-tags.test.js.map +1 -1
  105. package/dist/sortFields.js +16 -1
  106. package/dist/sortFields.js.map +2 -2
  107. package/dist/sortFields.test.js +1 -7
  108. package/dist/sortFields.test.js.map +2 -2
  109. package/dist/sortRelatorTerms.test.js +1 -7
  110. package/dist/sortRelatorTerms.test.js.map +2 -2
  111. package/dist/sortSubfields.js +3 -1
  112. package/dist/sortSubfields.js.map +2 -2
  113. package/dist/sortSubfields.test.js +1 -7
  114. package/dist/sortSubfields.test.js.map +2 -2
  115. package/dist/stripPunctuation.js +7 -4
  116. package/dist/stripPunctuation.js.map +2 -2
  117. package/dist/stripPunctuation.test.js +1 -7
  118. package/dist/stripPunctuation.test.js.map +2 -2
  119. package/dist/subfield-exclusion.test.js +1 -1
  120. package/dist/subfield-exclusion.test.js.map +1 -1
  121. package/dist/subfield6Utils.js +1 -13
  122. package/dist/subfield6Utils.js.map +2 -2
  123. package/dist/subfieldValueNormalizations.test.js +1 -7
  124. package/dist/subfieldValueNormalizations.test.js.map +2 -2
  125. package/dist/sync-007-and-300.test.js +1 -7
  126. package/dist/sync-007-and-300.test.js.map +2 -2
  127. package/dist/sync-language.js +103 -0
  128. package/dist/sync-language.js.map +7 -0
  129. package/dist/sync-language.test.js +40 -0
  130. package/dist/sync-language.test.js.map +7 -0
  131. package/dist/translate-terms.js +121 -85
  132. package/dist/translate-terms.js.map +3 -3
  133. package/dist/translate-terms.test.js +5 -8
  134. package/dist/translate-terms.test.js.map +2 -2
  135. package/dist/unicode-decomposition.test.js +1 -1
  136. package/dist/unicode-decomposition.test.js.map +1 -1
  137. package/dist/update-field-540.test.js +2 -8
  138. package/dist/update-field-540.test.js.map +2 -2
  139. package/dist/urn.test.js +2 -8
  140. package/dist/urn.test.js.map +2 -2
  141. package/package.json +18 -16
  142. package/src/access-rights.test.js +1 -1
  143. package/src/addMissingField337.test.js +1 -1
  144. package/src/addMissingField338.test.js +1 -1
  145. package/src/cyrillux-usemarcon-replacement.test.js +4 -9
  146. package/src/cyrillux.test.js +1 -1
  147. package/src/disambiguateSeriesStatements.test.js +3 -8
  148. package/src/double-commas.test.js +1 -1
  149. package/src/drop-terms.js +162 -0
  150. package/src/drop-terms.test.js +81 -0
  151. package/src/empty-fields.test.js +1 -1
  152. package/src/ending-punctuation.test.js +28 -20
  153. package/src/field-008-18-34-character-groups.test.js +4 -9
  154. package/src/field-505-separators.test.js +3 -8
  155. package/src/field-521-fix.test.js +3 -8
  156. package/src/field-exclusion.test.js +10 -8
  157. package/src/field-structure.test.js +1 -1
  158. package/src/fields-present.test.js +1 -1
  159. package/src/fix-33X.test.js +1 -1
  160. package/src/fix-country-codes.test.js +3 -8
  161. package/src/fix-sami-041.js +113 -0
  162. package/src/fix-sami-041.test.js +52 -0
  163. package/src/fixRelatorTerms.test.js +4 -9
  164. package/src/fixed-fields.test.js +24 -18
  165. package/src/identical-fields.test.js +1 -1
  166. package/src/index.js +8 -1
  167. package/src/indicator-fixes.js +12 -0
  168. package/src/indicator-fixes.test.js +3 -8
  169. package/src/isbn-issn.js +1 -1
  170. package/src/isbn-issn.test.js +8 -6
  171. package/src/item-language.test.js +2 -2
  172. package/src/merge-fields.test.js +3 -8
  173. package/src/mergeField500Lisapainokset.test.js +3 -8
  174. package/src/mergeRelatorTermFields.test.js +3 -8
  175. package/src/multiple-subfield-0.test.js +3 -8
  176. package/src/normalize-dashes.test.js +3 -8
  177. package/src/normalize-identifiers.test.js +3 -8
  178. package/src/normalize-qualifying-information.test.js +3 -8
  179. package/src/normalize-utf8-diacritics.test.js +3 -8
  180. package/src/normalizeFieldForComparison.js +26 -0
  181. package/src/punctuation.test.js +3 -8
  182. package/src/punctuation2.test.js +4 -9
  183. package/src/reindexSubfield6OccurenceNumbers.test.js +3 -8
  184. package/src/remove-041-zxx.js +85 -0
  185. package/src/remove-041-zxx.test.js +52 -0
  186. package/src/removeDuplicateDataFields.test.js +4 -9
  187. package/src/removeInferiorDataFields.js +7 -7
  188. package/src/removeInferiorDataFields.test.js +3 -8
  189. package/src/resolvable-ext-references-melinda.test.js +5 -5
  190. package/src/resolveOrphanedSubfield6s.js +3 -3
  191. package/src/resolveOrphanedSubfield6s.test.js +3 -8
  192. package/src/sanitize-vocabulary-source-codes.test.js +3 -8
  193. package/src/sort-tags.test.js +1 -1
  194. package/src/sortFields.js +20 -1
  195. package/src/sortFields.test.js +3 -8
  196. package/src/sortRelatorTerms.test.js +3 -8
  197. package/src/sortSubfields.js +3 -1
  198. package/src/sortSubfields.test.js +3 -8
  199. package/src/stripPunctuation.js +9 -6
  200. package/src/stripPunctuation.test.js +3 -8
  201. package/src/subfield-exclusion.test.js +1 -1
  202. package/src/subfield6Utils.js +13 -13
  203. package/src/subfieldValueNormalizations.test.js +3 -8
  204. package/src/sync-007-and-300.test.js +3 -8
  205. package/src/sync-language.js +148 -0
  206. package/src/sync-language.test.js +52 -0
  207. package/src/translate-terms.js +158 -103
  208. package/src/translate-terms.test.js +12 -16
  209. package/src/unicode-decomposition.test.js +1 -1
  210. package/src/update-field-540.test.js +4 -9
  211. package/src/urn.test.js +4 -9
  212. package/test-fixtures/drop-terms/01/expectedResult.json +31 -0
  213. package/test-fixtures/drop-terms/01/metadata.json +6 -0
  214. package/test-fixtures/drop-terms/01/record.json +35 -0
  215. package/test-fixtures/drop-terms/02/expectedResult.json +7 -0
  216. package/test-fixtures/drop-terms/02/metadata.json +6 -0
  217. package/test-fixtures/drop-terms/02/record.json +40 -0
  218. package/test-fixtures/drop-terms/03/expectedResult.json +6 -0
  219. package/test-fixtures/drop-terms/03/metadata.json +18 -0
  220. package/test-fixtures/drop-terms/03/record.json +39 -0
  221. package/test-fixtures/drop-terms/04/expectedResult.json +6 -0
  222. package/test-fixtures/drop-terms/04/metadata.json +19 -0
  223. package/test-fixtures/drop-terms/04/record.json +24 -0
  224. package/test-fixtures/fix-language-codes/02/metadata.json +1 -1
  225. package/test-fixtures/fix-sami-041/01/expectedResult.json +6 -0
  226. package/test-fixtures/fix-sami-041/01/metadata.json +4 -0
  227. package/test-fixtures/fix-sami-041/01/record.json +13 -0
  228. package/test-fixtures/fix-sami-041/02/expectedResult.json +10 -0
  229. package/test-fixtures/fix-sami-041/02/metadata.json +4 -0
  230. package/test-fixtures/fix-sami-041/02/record.json +8 -0
  231. package/test-fixtures/fix-sami-041/03/expectedResult.json +5 -0
  232. package/test-fixtures/fix-sami-041/03/metadata.json +5 -0
  233. package/test-fixtures/fix-sami-041/03/record.json +8 -0
  234. package/test-fixtures/fix-sami-041/04/expectedResult.json +7 -0
  235. package/test-fixtures/fix-sami-041/04/metadata.json +4 -0
  236. package/test-fixtures/fix-sami-041/04/record.json +10 -0
  237. package/test-fixtures/fix-sami-041/05/expectedResult.json +10 -0
  238. package/test-fixtures/fix-sami-041/05/metadata.json +6 -0
  239. package/test-fixtures/fix-sami-041/05/record.json +8 -0
  240. package/test-fixtures/indicator-fixes/11/expectedResult.json +10 -0
  241. package/test-fixtures/indicator-fixes/11/metadata.json +4 -0
  242. package/test-fixtures/indicator-fixes/11/record.json +10 -0
  243. package/test-fixtures/merge-fields/f05/metadata.json +1 -1
  244. package/test-fixtures/remove-041-zxx/01/expectedResult.json +5 -0
  245. package/test-fixtures/remove-041-zxx/01/metadata.json +5 -0
  246. package/test-fixtures/remove-041-zxx/01/record.json +10 -0
  247. package/test-fixtures/remove-041-zxx/02/expectedResult.json +7 -0
  248. package/test-fixtures/remove-041-zxx/02/metadata.json +5 -0
  249. package/test-fixtures/remove-041-zxx/02/record.json +9 -0
  250. package/test-fixtures/remove-041-zxx/11/expectedResult.json +10 -0
  251. package/test-fixtures/remove-041-zxx/11/metadata.json +5 -0
  252. package/test-fixtures/remove-041-zxx/11/record.json +9 -0
  253. package/test-fixtures/remove-041-zxx/12/expectedResult.json +10 -0
  254. package/test-fixtures/remove-041-zxx/12/metadata.json +5 -0
  255. package/test-fixtures/remove-041-zxx/12/record.json +9 -0
  256. package/test-fixtures/sort-fields/15/input.json +9 -0
  257. package/test-fixtures/sort-fields/15/metadata.json +5 -0
  258. package/test-fixtures/sort-fields/15/result.json +10 -0
  259. package/test-fixtures/sync-language/01/expectedResult.json +5 -0
  260. package/test-fixtures/sync-language/01/metadata.json +5 -0
  261. package/test-fixtures/sync-language/01/record.json +7 -0
  262. package/test-fixtures/sync-language/02/expectedResult.json +6 -0
  263. package/test-fixtures/sync-language/02/metadata.json +5 -0
  264. package/test-fixtures/sync-language/02/record.json +10 -0
  265. package/test-fixtures/sync-language/03/expectedResult.json +6 -0
  266. package/test-fixtures/sync-language/03/metadata.json +5 -0
  267. package/test-fixtures/sync-language/03/record.json +6 -0
  268. package/test-fixtures/sync-language/10/expectedResult.json +10 -0
  269. package/test-fixtures/sync-language/10/metadata.json +5 -0
  270. package/test-fixtures/sync-language/10/record.json +8 -0
  271. package/test-fixtures/sync-language/11/expectedResult.json +10 -0
  272. package/test-fixtures/sync-language/11/metadata.json +5 -0
  273. package/test-fixtures/sync-language/11/record.json +7 -0
  274. package/test-fixtures/sync-language/12/expectedResult.json +9 -0
  275. package/test-fixtures/sync-language/12/metadata.json +6 -0
  276. package/test-fixtures/sync-language/12/record.json +6 -0
  277. package/test-fixtures/sync-language/13/expectedResult.json +10 -0
  278. package/test-fixtures/sync-language/13/metadata.json +5 -0
  279. package/test-fixtures/sync-language/13/record.json +8 -0
  280. package/test-fixtures/sync-language/14/expectedResult.json +9 -0
  281. package/test-fixtures/sync-language/14/metadata.json +5 -0
  282. package/test-fixtures/sync-language/14/record.json +7 -0
  283. package/test-fixtures/sync-language/15/expectedResult.json +9 -0
  284. package/test-fixtures/sync-language/15/metadata.json +5 -0
  285. package/test-fixtures/sync-language/15/record.json +7 -0
  286. package/test-fixtures/translate-terms/05/expectedResult.json +12 -0
  287. package/test-fixtures/translate-terms/05/metadata.json +7 -0
  288. package/test-fixtures/translate-terms/05/record.json +11 -0
  289. package/test-fixtures/translate-terms/06/expectedResult.json +12 -0
  290. package/test-fixtures/translate-terms/06/metadata.json +7 -0
  291. package/test-fixtures/translate-terms/06/record.json +11 -0
  292. package/test-fixtures/translate-terms-data.js +23 -0
@@ -0,0 +1,6 @@
1
+ {
2
+ "message": [
3
+ "Remove '650 #7 ‡a ravurit ‡2 yso/fin ‡0 http://www.yso.fi/onto/yso/p500'"
4
+ ],
5
+ "valid": false
6
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "description": "04: Drop altLabel 'ravurit'. However, keeps totally wrong 'ravurit2' and 0-less 'ravurit3'",
3
+ "comment": "Uses a very unlikely config, used mainly for tests",
4
+ "fix": false,
5
+ "skip": false,
6
+ "only": true,
7
+
8
+ "config": {
9
+ "constraints": [
10
+
11
+ {"tag": "650", "lex": "yso/fin"},
12
+ {"tag": "650", "lex": "yso/swe"}
13
+ ],
14
+ "keep invalid url": true,
15
+ "keep invalid label": true,
16
+ "remove altLabel": true,
17
+ "remove 0-less": false
18
+ }
19
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "",
4
+ "fields": [
5
+ { "tag": "001", "value": "test1"},
6
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
7
+ { "code": "a", "value": "ravurit2" },
8
+ { "code": "2", "value": "yso/fin" },
9
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p13299" }
10
+ ]
11
+ },
12
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
13
+ { "code": "a", "value": "ravurit" },
14
+ { "code": "2", "value": "yso/fin" },
15
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p500" }
16
+ ]
17
+ },
18
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
19
+ { "code": "a", "value": "ravurit3" },
20
+ { "code": "2", "value": "yso/fin" }
21
+ ]
22
+ }
23
+ ]
24
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "description": "Validate 008/15-17: azu -> xxu",
2
+ "description": "Validate: fix needed both in 008/35-37 and 041$a",
3
3
  "fix": false,
4
4
  "only": false
5
5
  }
@@ -0,0 +1,6 @@
1
+ {
2
+ "message": [
3
+ "'041 ## ‡a sme' => '041 ## ‡a smi ‡a sme'"
4
+ ],
5
+ "valid": false
6
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "description": "Validate sami 041: fails, since plenty to do",
3
+ "fix": false
4
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "fields": [
3
+ {
4
+ "tag": "005",
5
+ "value": "20220202020202.0"
6
+ },
7
+ { "tag": "041", "ind1": " ", "ind2": " ",
8
+ "subfields": [
9
+ { "code": "a", "value": "sme" }
10
+ ]
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "",
4
+ "fields": [
5
+ { "tag": "008", "value": "01234567890123456789012345678901234smi89" },
6
+ { "tag": "041", "ind1": " ", "ind2": " ",
7
+ "subfields": [ { "code": "a", "value": "smi" }, { "code": "a", "value": "sma" }, { "code": "h", "value": "sma" } ]
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "description": "Fix field 041",
3
+ "fix": true
4
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "fields": [
3
+ { "tag": "008", "value": "01234567890123456789012345678901234sma89" },
4
+ { "tag": "041", "ind1": " ", "ind2": " ",
5
+ "subfields": [ { "code": "a", "value": "sma" }, { "code": "h", "value": "sma" } ]
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "message": [],
3
+ "valid": true
4
+ }
5
+
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "Validate sami 041: success, since nothing to do",
3
+ "fix": false,
4
+ "only": false
5
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "",
4
+ "fields": [
5
+ { "tag": "041", "ind1": " ", "ind2": " ", "subfields": [ { "code": "a", "value": "eng" } ]},
6
+ { "tag": "041", "ind1": "1", "ind2": "7", "subfields": [ { "code": "a", "value": "smi" }, {"code": "2", "value": "iso-639-3"} ]}
7
+ ]
8
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "message": [
3
+ "'01234567890123456789012345678901234sma89' => '01234567890123456789012345678901234smi89'",
4
+ "'041 ## ‡a sme' => '041 ## ‡a smi ‡a sme'"
5
+ ],
6
+ "valid": false
7
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "description": "Validate sami 041: fails, same as test 01, but with field 008 added",
3
+ "fix": false
4
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "fields": [
3
+ { "tag": "008", "value": "01234567890123456789012345678901234sma89" },
4
+ { "tag": "041", "ind1": " ", "ind2": " ",
5
+ "subfields": [
6
+ { "code": "a", "value": "sme" }
7
+ ]
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "",
4
+ "fields": [
5
+ { "tag": "008", "value": "01234567890123456789012345678901234swe89" },
6
+ { "tag": "041", "ind1": " ", "ind2": " ",
7
+ "subfields": [ { "code": "a", "value": "swe" }, { "code": "a", "value": "smi" }, { "code": "a", "value": "sme" }, { "code": "a", "value": "sma" }, { "code": "h", "value": "sma" } ]
8
+ }
9
+ ]
10
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "Fix field 041. Test that smi is added only once to for $a",
3
+ "comment #1": "There are two sami language codes, 'sme' and 'sma', 'smi' is added before the first of them.",
4
+ "comment #2": "Neither 'sme' nor 'sma' is the first language code for $a, thus 008/35-37 is not changed",
5
+ "fix": true
6
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "fields": [
3
+ { "tag": "008", "value": "01234567890123456789012345678901234swe89" },
4
+ { "tag": "041", "ind1": " ", "ind2": " ",
5
+ "subfields": [ { "code": "a", "value": "swe" }, { "code": "a", "value": "sme" }, { "code": "a", "value": "sma" }, { "code": "h", "value": "sma" } ]
6
+ }
7
+ ]
8
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "fields": [
4
+ { "tag": "005", "value": "20220202020202.0" },
5
+ { "tag": "041", "ind1": "1", "ind2": " ", "subfields": [ {"code": "a", "value": "fin"}, {"code": "h", "value": "eng"}]},
6
+ { "tag": "041", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "fin"}]}
7
+
8
+ ],
9
+ "leader": ""
10
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "description": "11: Fix 041 ind1 is the field looks like a translation",
3
+ "fix": true
4
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "fields": [
4
+ { "tag": "005", "value": "20220202020202.0" },
5
+ { "tag": "041", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "fin"}, {"code": "h", "value": "eng"}]},
6
+ { "tag": "041", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "fin"}]}
7
+
8
+ ],
9
+ "leader": ""
10
+ }
@@ -2,5 +2,5 @@
2
2
  "description": "MELKEHITYS-3277: don't merge AI field",
3
3
  "fix": true,
4
4
  "tagPattern": "^(650|773)$",
5
- "only": true
5
+ "only": false
6
6
  }
@@ -0,0 +1,5 @@
1
+ {
2
+ "message" : [
3
+ ],
4
+ "valid": true
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "01: Validate field 041 language codes: no deletable 'zxx' values",
3
+ "fix": false,
4
+ "only": false
5
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "leader": "01234ci78901234567890123",
3
+ "fields" : [
4
+ { "tag": "005", "value": "20220202020202.0" },
5
+ { "tag": "008", "value": "860616s1985 fi |||||||||||||||||fin||"},
6
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "fin"}, {"code": "h", "value": "eng"}]},
7
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "zxx"}, {"code": "2", "value": "iso-666-6"}]},
8
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "swe"}, {"code": "0", "value": "zxx"}]}
9
+ ]
10
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "message" : [
3
+ "Modify '041 1# ‡a zxx ‡h spa ‡5 zxx' => '041 1# ‡h spa ‡5 zxx",
4
+ "Remove '041 1# ‡d zxx'"
5
+ ],
6
+ "valid": false
7
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "02: Validate 041: deletable $[a-z] zxx subfields",
3
+ "fix": false,
4
+ "only": false
5
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "leader": "01234ci78901234567890123",
3
+ "fields" : [
4
+ { "tag": "005", "value": "20220202020202.0" },
5
+ { "tag": "008", "value": "860616s1985 azu|||||||||||||||||swe||"},
6
+ { "tag": "041", "ind1": "1", "ind2": " ", "subfields": [ { "code": "a", "value": "zxx" }, { "code": "h", "value": "spa" }, {"code": "5", "value": "zxx"} ]},
7
+ { "tag": "041", "ind1": "1", "ind2": " ", "subfields": [ { "code": "d", "value": "zxx" }]}
8
+ ]
9
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "01234ci78901234567890123",
4
+ "fields" : [
5
+ { "tag": "005", "value": "20220202020202.0" },
6
+ { "tag": "008", "value": "860616s1985 fi |||||||||||||||||fin||"},
7
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "fin"}, {"code": "h", "value": "eng"}]},
8
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "zxx"}, {"code": "2", "value": "iso-666-6"}]}
9
+ ]
10
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "01 (fix): nothing to do as first 041 does not contain a 'zxx' and second 041 contains a $2",
3
+ "fix": true,
4
+ "only": false
5
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "leader": "01234ci78901234567890123",
3
+ "fields" : [
4
+ { "tag": "005", "value": "20220202020202.0" },
5
+ { "tag": "008", "value": "860616s1985 fi |||||||||||||||||fin||"},
6
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "fin"}, {"code": "h", "value": "eng"}]},
7
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "zxx"}, {"code": "2", "value": "iso-666-6"}]}
8
+ ]
9
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "01234ci78901234567890123",
4
+ "fields" : [
5
+ { "tag": "005", "value": "20220202020202.0" },
6
+ { "tag": "008", "value": "860616s1985 azu|||||||||||||||||swe||"},
7
+ { "tag": "041", "ind1": "1", "ind2": " ", "subfields": [ { "code": "h", "value": "spa" }, {"code": "5", "value": "zxx"} ]}
8
+ ]
9
+ }
10
+
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "12: Remove subfields with 'zxx' and delete field if needed",
3
+ "fix": true,
4
+ "only": false
5
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "leader": "01234ci78901234567890123",
3
+ "fields" : [
4
+ { "tag": "005", "value": "20220202020202.0" },
5
+ { "tag": "008", "value": "860616s1985 azu|||||||||||||||||swe||"},
6
+ { "tag": "041", "ind1": "1", "ind2": " ", "subfields": [ { "code": "a", "value": "zxx" }, { "code": "h", "value": "spa" }, {"code": "5", "value": "zxx"} ]},
7
+ { "tag": "041", "ind1": "1", "ind2": " ", "subfields": [ { "code": "d", "value": "zxx" }]}
8
+ ]
9
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "leader": "12345crm a22002417i 4500",
3
+ "fields":
4
+ [
5
+ {"tag": "041", "ind1": " ", "ind2": " ", "subfields": [{"code": "a", "value": "fin"}]},
6
+ {"tag": "041", "ind1": " ", "ind2": " ", "subfields": [{"code": "a", "value": "xyz"}, {"code": "2", "value": "iso-639-666"}]},
7
+ {"tag": "041", "ind1": " ", "ind2": " ", "subfields": [{"code": "a", "value": "swe"}]}
8
+ ]
9
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "MUU-839: sort 700 based on $e relator term and 880 based primarily on $6 tag (100 vs 700) and secondarily on occurrence number, ",
3
+ "skip": false,
4
+ "only": false
5
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "leader": "12345crm a22002417i 4500",
3
+ "fields":
4
+ [
5
+ {"tag": "041", "ind1": " ", "ind2": " ", "subfields": [{"code": "a", "value": "fin"}]},
6
+ {"tag": "041", "ind1": " ", "ind2": " ", "subfields": [{"code": "a", "value": "swe"}]},
7
+ {"tag": "041", "ind1": " ", "ind2": " ", "subfields": [{"code": "a", "value": "xyz"}, {"code": "2", "value": "iso-639-666"}]}
8
+ ],
9
+ "_validationOptions": {}
10
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "message" : [
3
+ ],
4
+ "valid": true
5
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "01: Validate language codes: nothing to do as 008/35-37 and 041$a are identical",
3
+ "fix": false,
4
+ "only": false
5
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "fields" : [
3
+ { "tag": "005", "value": "20220202020202.0" },
4
+ { "tag": "008", "value": "860616s1985 fi |||||||||||||||||fin||"},
5
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "fin"}, {"code": "h", "value": "eng"}]}
6
+ ]
7
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "message": [
3
+ "Modify '860616s1985 azu|||||||||||||||||swe||' to '860616s1985 azu|||||||||||||||||fin||'"
4
+ ],
5
+ "valid": false
6
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "Validate 008/35-37: 'swe' -> 'fin' (based on 041$a)",
3
+ "fix": false,
4
+ "only": false
5
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "fields" : [
3
+ { "tag": "005", "value": "20220202020202.0" },
4
+ { "tag": "008", "value": "860616s1985 azu|||||||||||||||||swe||"},
5
+ { "tag": "041", "ind1": "1", "ind2": " ", "subfields": [
6
+ { "code": "a", "value": "fin" },
7
+ { "code": "h", "value": "spa" }
8
+ ]}
9
+ ]
10
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "message": [
3
+ "Add '041 ## ‡a swe'"
4
+ ],
5
+ "valid": false
6
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "03: Validate (add missing 041 field)",
3
+ "fix": false,
4
+ "only": false
5
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "fields" : [
3
+ { "tag": "005", "value": "20220202020202.0" },
4
+ { "tag": "008", "value": "860616s1985 azu|||||||||||||||||swe||"}
5
+ ]
6
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "",
4
+ "fields" : [
5
+ { "tag": "005", "value": "20220202020202.0" },
6
+ { "tag": "008", "value": "860616s1985 fi |||||||||||||||||fin||"},
7
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "fin"}, {"code": "h", "value": "eng"}]},
8
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "nno"}, {"code": "h", "value": "nob"}, {"code": "2", "value": "ISO639-2"}]}
9
+ ]
10
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "Fix language codes: nothing to do",
3
+ "fix": true,
4
+ "only": false
5
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "fields" : [
3
+ { "tag": "005", "value": "20220202020202.0" },
4
+ { "tag": "008", "value": "860616s1985 fi |||||||||||||||||fin||"},
5
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "fin"}, {"code": "h", "value": "eng"}]},
6
+ { "tag": "041", "ind1": " ", "ind2": "0", "subfields": [{"code": "a", "value": "nno"}, {"code": "h", "value": "nob"}, {"code": "2", "value": "ISO639-2"}]}
7
+ ]
8
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "01234ci78901234567890123",
4
+ "fields" : [
5
+ { "tag": "005", "value": "20220202020202.0" },
6
+ { "tag": "008", "value": "860616s1985 tma|||||||||||||||||foo||"},
7
+ { "tag": "041", "ind1": " ", "ind2": " ", "subfields": [{"code": "d", "value": "foo"}]}
8
+ ]
9
+
10
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "11: Copy 008/35-37 to 041$d",
3
+ "fix": true,
4
+ "only": false
5
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "leader": "01234ci78901234567890123",
3
+ "fields" : [
4
+ { "tag": "005", "value": "20220202020202.0" },
5
+ { "tag": "008", "value": "860616s1985 tma|||||||||||||||||foo||"}
6
+ ]
7
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "fields" : [
4
+ { "tag": "005", "value": "20220202020202.0" },
5
+ { "tag": "008", "value": "860616s1985 tma|||||||||||||||||bar||"},
6
+ { "tag": "041", "ind1": " ", "ind2": " ", "subfields": [{"code": "a", "value": "bar"}]}
7
+ ]
8
+
9
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "12: Copy 008/35-37 to 041$a",
3
+ "comment": "No leader, 041 subfield selection defaults to '$a'",
4
+ "fix": true,
5
+ "only": false
6
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "fields" : [
3
+ { "tag": "005", "value": "20220202020202.0" },
4
+ { "tag": "008", "value": "860616s1985 tma|||||||||||||||||bar||"}
5
+ ]
6
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "",
4
+ "fields" : [
5
+ { "tag": "005", "value": "20220202020202.0" },
6
+ { "tag": "008", "value": "860616s1985 fi |||||||||||||||||swe||"},
7
+ { "tag": "041", "ind1": " ", "ind2": "7", "subfields": [{"code": "a", "value": "fin"}, {"code": "2", "value": "iso-639-3"}]},
8
+ { "tag": "041", "ind1": " ", "ind2": " ", "subfields": [{"code": "a", "value": "nno"}, {"code": "h", "value": "nob"}, {"code": "2", "value": "ISO639-2"}]}
9
+ ]
10
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "Fix language codes: nothing to do as first 041 has $2",
3
+ "fix": true,
4
+ "only": false
5
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "fields" : [
3
+ { "tag": "005", "value": "20220202020202.0" },
4
+ { "tag": "008", "value": "860616s1985 fi |||||||||||||||||swe||"},
5
+ { "tag": "041", "ind1": " ", "ind2": "7", "subfields": [{"code": "a", "value": "fin"}, {"code": "2", "value": "iso-639-3"}]},
6
+ { "tag": "041", "ind1": " ", "ind2": " ", "subfields": [{"code": "a", "value": "nno"}, {"code": "h", "value": "nob"}, {"code": "2", "value": "ISO639-2"}]}
7
+ ]
8
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "01234ci78901234567890123",
4
+ "fields" : [
5
+ { "tag": "005", "value": "20220202020202.0" },
6
+ { "tag": "008", "value": "860616s1985 tma||||||||||||||||||||||"}
7
+ ]
8
+
9
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "11: Don't copy 008/35-37 '|||' to 041$d",
3
+ "fix": true,
4
+ "only": false
5
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "leader": "01234ci78901234567890123",
3
+ "fields" : [
4
+ { "tag": "005", "value": "20220202020202.0" },
5
+ { "tag": "008", "value": "860616s1985 tma||||||||||||||||||||||"}
6
+ ]
7
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "01234ci78901234567890123",
4
+ "fields" : [
5
+ { "tag": "005", "value": "20220202020202.0" },
6
+ { "tag": "008", "value": "860616s1985 tma|||||||||||||||||zxx||"}
7
+ ]
8
+
9
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description": "11: Don't copy 008/35-37 'zxx' to 041$d",
3
+ "fix": true,
4
+ "only": false
5
+ }