@natlibfi/marc-record-validators-melinda 12.0.0 → 12.0.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 (229) hide show
  1. package/dist/disambiguateSeriesStatements.test.js +1 -7
  2. package/dist/disambiguateSeriesStatements.test.js.map +2 -2
  3. package/dist/drop-terms.js +122 -0
  4. package/dist/drop-terms.js.map +7 -0
  5. package/dist/drop-terms.test.js +56 -0
  6. package/dist/drop-terms.test.js.map +7 -0
  7. package/dist/field-008-18-34-character-groups.test.js +1 -7
  8. package/dist/field-008-18-34-character-groups.test.js.map +2 -2
  9. package/dist/field-505-separators.test.js +1 -7
  10. package/dist/field-505-separators.test.js.map +2 -2
  11. package/dist/field-521-fix.test.js +1 -7
  12. package/dist/field-521-fix.test.js.map +2 -2
  13. package/dist/fix-33X.test.js +1 -1
  14. package/dist/fix-33X.test.js.map +1 -1
  15. package/dist/fix-country-codes.test.js +1 -7
  16. package/dist/fix-country-codes.test.js.map +2 -2
  17. package/dist/fix-sami-041.js +87 -0
  18. package/dist/fix-sami-041.js.map +7 -0
  19. package/dist/fix-sami-041.test.js +40 -0
  20. package/dist/fix-sami-041.test.js.map +7 -0
  21. package/dist/fixRelatorTerms.test.js +1 -7
  22. package/dist/fixRelatorTerms.test.js.map +2 -2
  23. package/dist/index.js +7 -1
  24. package/dist/index.js.map +2 -2
  25. package/dist/indicator-fixes.js +10 -0
  26. package/dist/indicator-fixes.js.map +2 -2
  27. package/dist/indicator-fixes.test.js +1 -7
  28. package/dist/indicator-fixes.test.js.map +2 -2
  29. package/dist/merge-fields.test.js +2 -7
  30. package/dist/merge-fields.test.js.map +2 -2
  31. package/dist/mergeField500Lisapainokset.test.js +1 -7
  32. package/dist/mergeField500Lisapainokset.test.js.map +2 -2
  33. package/dist/mergeRelatorTermFields.test.js +1 -7
  34. package/dist/mergeRelatorTermFields.test.js.map +2 -2
  35. package/dist/multiple-subfield-0.test.js +1 -7
  36. package/dist/multiple-subfield-0.test.js.map +2 -2
  37. package/dist/normalize-dashes.test.js +1 -7
  38. package/dist/normalize-dashes.test.js.map +2 -2
  39. package/dist/normalize-identifiers.test.js +1 -7
  40. package/dist/normalize-identifiers.test.js.map +2 -2
  41. package/dist/normalize-qualifying-information.test.js +1 -7
  42. package/dist/normalize-qualifying-information.test.js.map +2 -2
  43. package/dist/normalize-utf8-diacritics.test.js +1 -7
  44. package/dist/normalize-utf8-diacritics.test.js.map +2 -2
  45. package/dist/punctuation.test.js +1 -7
  46. package/dist/punctuation.test.js.map +2 -2
  47. package/dist/punctuation2.test.js +1 -7
  48. package/dist/punctuation2.test.js.map +2 -2
  49. package/dist/reindexSubfield6OccurenceNumbers.test.js +1 -7
  50. package/dist/reindexSubfield6OccurenceNumbers.test.js.map +2 -2
  51. package/dist/remove-041-zxx.js +56 -0
  52. package/dist/remove-041-zxx.js.map +7 -0
  53. package/dist/remove-041-zxx.test.js +40 -0
  54. package/dist/remove-041-zxx.test.js.map +7 -0
  55. package/dist/removeDuplicateDataFields.test.js +1 -7
  56. package/dist/removeDuplicateDataFields.test.js.map +2 -2
  57. package/dist/removeInferiorDataFields.js +1 -9
  58. package/dist/removeInferiorDataFields.js.map +2 -2
  59. package/dist/removeInferiorDataFields.test.js +1 -7
  60. package/dist/removeInferiorDataFields.test.js.map +2 -2
  61. package/dist/resolveOrphanedSubfield6s.js +1 -3
  62. package/dist/resolveOrphanedSubfield6s.js.map +2 -2
  63. package/dist/resolveOrphanedSubfield6s.test.js +1 -7
  64. package/dist/resolveOrphanedSubfield6s.test.js.map +2 -2
  65. package/dist/sanitize-vocabulary-source-codes.test.js +1 -7
  66. package/dist/sanitize-vocabulary-source-codes.test.js.map +2 -2
  67. package/dist/sortFields.js +16 -1
  68. package/dist/sortFields.js.map +2 -2
  69. package/dist/sortFields.test.js +1 -7
  70. package/dist/sortFields.test.js.map +2 -2
  71. package/dist/sortRelatorTerms.test.js +1 -7
  72. package/dist/sortRelatorTerms.test.js.map +2 -2
  73. package/dist/sortSubfields.js +3 -1
  74. package/dist/sortSubfields.js.map +2 -2
  75. package/dist/sortSubfields.test.js +1 -7
  76. package/dist/sortSubfields.test.js.map +2 -2
  77. package/dist/stripPunctuation.js +7 -4
  78. package/dist/stripPunctuation.js.map +2 -2
  79. package/dist/stripPunctuation.test.js +1 -7
  80. package/dist/stripPunctuation.test.js.map +2 -2
  81. package/dist/subfield6Utils.js +1 -13
  82. package/dist/subfield6Utils.js.map +2 -2
  83. package/dist/subfieldValueNormalizations.test.js +1 -7
  84. package/dist/subfieldValueNormalizations.test.js.map +2 -2
  85. package/dist/sync-007-and-300.test.js +1 -7
  86. package/dist/sync-007-and-300.test.js.map +2 -2
  87. package/dist/sync-language.js +103 -0
  88. package/dist/sync-language.js.map +7 -0
  89. package/dist/sync-language.test.js +40 -0
  90. package/dist/sync-language.test.js.map +7 -0
  91. package/dist/translate-terms.js +121 -85
  92. package/dist/translate-terms.js.map +3 -3
  93. package/dist/translate-terms.test.js +5 -8
  94. package/dist/translate-terms.test.js.map +2 -2
  95. package/dist/update-field-540.test.js +1 -7
  96. package/dist/update-field-540.test.js.map +2 -2
  97. package/dist/urn.test.js +1 -7
  98. package/dist/urn.test.js.map +2 -2
  99. package/package.json +8 -6
  100. package/src/disambiguateSeriesStatements.test.js +3 -8
  101. package/src/drop-terms.js +162 -0
  102. package/src/drop-terms.test.js +81 -0
  103. package/src/field-008-18-34-character-groups.test.js +3 -8
  104. package/src/field-505-separators.test.js +3 -8
  105. package/src/field-521-fix.test.js +3 -8
  106. package/src/fix-33X.test.js +1 -1
  107. package/src/fix-country-codes.test.js +3 -8
  108. package/src/fix-sami-041.js +113 -0
  109. package/src/fix-sami-041.test.js +52 -0
  110. package/src/fixRelatorTerms.test.js +3 -8
  111. package/src/index.js +8 -1
  112. package/src/indicator-fixes.js +12 -0
  113. package/src/indicator-fixes.test.js +3 -8
  114. package/src/merge-fields.test.js +3 -8
  115. package/src/mergeField500Lisapainokset.test.js +3 -8
  116. package/src/mergeRelatorTermFields.test.js +3 -8
  117. package/src/multiple-subfield-0.test.js +3 -8
  118. package/src/normalize-dashes.test.js +3 -8
  119. package/src/normalize-identifiers.test.js +3 -8
  120. package/src/normalize-qualifying-information.test.js +3 -8
  121. package/src/normalize-utf8-diacritics.test.js +3 -8
  122. package/src/punctuation.test.js +3 -8
  123. package/src/punctuation2.test.js +3 -8
  124. package/src/reindexSubfield6OccurenceNumbers.test.js +3 -8
  125. package/src/remove-041-zxx.js +85 -0
  126. package/src/remove-041-zxx.test.js +52 -0
  127. package/src/removeDuplicateDataFields.test.js +3 -8
  128. package/src/removeInferiorDataFields.js +7 -7
  129. package/src/removeInferiorDataFields.test.js +3 -8
  130. package/src/resolveOrphanedSubfield6s.js +3 -3
  131. package/src/resolveOrphanedSubfield6s.test.js +3 -8
  132. package/src/sanitize-vocabulary-source-codes.test.js +3 -8
  133. package/src/sortFields.js +20 -1
  134. package/src/sortFields.test.js +3 -8
  135. package/src/sortRelatorTerms.test.js +3 -8
  136. package/src/sortSubfields.js +3 -1
  137. package/src/sortSubfields.test.js +3 -8
  138. package/src/stripPunctuation.js +9 -6
  139. package/src/stripPunctuation.test.js +3 -8
  140. package/src/subfield6Utils.js +13 -13
  141. package/src/subfieldValueNormalizations.test.js +3 -8
  142. package/src/sync-007-and-300.test.js +3 -8
  143. package/src/sync-language.js +148 -0
  144. package/src/sync-language.test.js +52 -0
  145. package/src/translate-terms.js +158 -103
  146. package/src/translate-terms.test.js +12 -16
  147. package/src/update-field-540.test.js +3 -8
  148. package/src/urn.test.js +3 -8
  149. package/test-fixtures/drop-terms/01/expectedResult.json +31 -0
  150. package/test-fixtures/drop-terms/01/metadata.json +6 -0
  151. package/test-fixtures/drop-terms/01/record.json +35 -0
  152. package/test-fixtures/drop-terms/02/expectedResult.json +7 -0
  153. package/test-fixtures/drop-terms/02/metadata.json +6 -0
  154. package/test-fixtures/drop-terms/02/record.json +40 -0
  155. package/test-fixtures/drop-terms/03/expectedResult.json +6 -0
  156. package/test-fixtures/drop-terms/03/metadata.json +18 -0
  157. package/test-fixtures/drop-terms/03/record.json +39 -0
  158. package/test-fixtures/drop-terms/04/expectedResult.json +6 -0
  159. package/test-fixtures/drop-terms/04/metadata.json +19 -0
  160. package/test-fixtures/drop-terms/04/record.json +24 -0
  161. package/test-fixtures/fix-language-codes/02/metadata.json +1 -1
  162. package/test-fixtures/fix-sami-041/01/expectedResult.json +6 -0
  163. package/test-fixtures/fix-sami-041/01/metadata.json +4 -0
  164. package/test-fixtures/fix-sami-041/01/record.json +13 -0
  165. package/test-fixtures/fix-sami-041/02/expectedResult.json +10 -0
  166. package/test-fixtures/fix-sami-041/02/metadata.json +4 -0
  167. package/test-fixtures/fix-sami-041/02/record.json +8 -0
  168. package/test-fixtures/fix-sami-041/03/expectedResult.json +5 -0
  169. package/test-fixtures/fix-sami-041/03/metadata.json +5 -0
  170. package/test-fixtures/fix-sami-041/03/record.json +8 -0
  171. package/test-fixtures/fix-sami-041/04/expectedResult.json +7 -0
  172. package/test-fixtures/fix-sami-041/04/metadata.json +4 -0
  173. package/test-fixtures/fix-sami-041/04/record.json +10 -0
  174. package/test-fixtures/fix-sami-041/05/expectedResult.json +10 -0
  175. package/test-fixtures/fix-sami-041/05/metadata.json +6 -0
  176. package/test-fixtures/fix-sami-041/05/record.json +8 -0
  177. package/test-fixtures/indicator-fixes/11/expectedResult.json +10 -0
  178. package/test-fixtures/indicator-fixes/11/metadata.json +4 -0
  179. package/test-fixtures/indicator-fixes/11/record.json +10 -0
  180. package/test-fixtures/merge-fields/f05/metadata.json +1 -1
  181. package/test-fixtures/remove-041-zxx/01/expectedResult.json +5 -0
  182. package/test-fixtures/remove-041-zxx/01/metadata.json +5 -0
  183. package/test-fixtures/remove-041-zxx/01/record.json +10 -0
  184. package/test-fixtures/remove-041-zxx/02/expectedResult.json +7 -0
  185. package/test-fixtures/remove-041-zxx/02/metadata.json +5 -0
  186. package/test-fixtures/remove-041-zxx/02/record.json +9 -0
  187. package/test-fixtures/remove-041-zxx/11/expectedResult.json +10 -0
  188. package/test-fixtures/remove-041-zxx/11/metadata.json +5 -0
  189. package/test-fixtures/remove-041-zxx/11/record.json +9 -0
  190. package/test-fixtures/remove-041-zxx/12/expectedResult.json +10 -0
  191. package/test-fixtures/remove-041-zxx/12/metadata.json +5 -0
  192. package/test-fixtures/remove-041-zxx/12/record.json +9 -0
  193. package/test-fixtures/sort-fields/15/input.json +9 -0
  194. package/test-fixtures/sort-fields/15/metadata.json +5 -0
  195. package/test-fixtures/sort-fields/15/result.json +10 -0
  196. package/test-fixtures/sync-language/01/expectedResult.json +5 -0
  197. package/test-fixtures/sync-language/01/metadata.json +5 -0
  198. package/test-fixtures/sync-language/01/record.json +7 -0
  199. package/test-fixtures/sync-language/02/expectedResult.json +6 -0
  200. package/test-fixtures/sync-language/02/metadata.json +5 -0
  201. package/test-fixtures/sync-language/02/record.json +10 -0
  202. package/test-fixtures/sync-language/03/expectedResult.json +6 -0
  203. package/test-fixtures/sync-language/03/metadata.json +5 -0
  204. package/test-fixtures/sync-language/03/record.json +6 -0
  205. package/test-fixtures/sync-language/10/expectedResult.json +10 -0
  206. package/test-fixtures/sync-language/10/metadata.json +5 -0
  207. package/test-fixtures/sync-language/10/record.json +8 -0
  208. package/test-fixtures/sync-language/11/expectedResult.json +10 -0
  209. package/test-fixtures/sync-language/11/metadata.json +5 -0
  210. package/test-fixtures/sync-language/11/record.json +7 -0
  211. package/test-fixtures/sync-language/12/expectedResult.json +9 -0
  212. package/test-fixtures/sync-language/12/metadata.json +6 -0
  213. package/test-fixtures/sync-language/12/record.json +6 -0
  214. package/test-fixtures/sync-language/13/expectedResult.json +10 -0
  215. package/test-fixtures/sync-language/13/metadata.json +5 -0
  216. package/test-fixtures/sync-language/13/record.json +8 -0
  217. package/test-fixtures/sync-language/14/expectedResult.json +9 -0
  218. package/test-fixtures/sync-language/14/metadata.json +5 -0
  219. package/test-fixtures/sync-language/14/record.json +7 -0
  220. package/test-fixtures/sync-language/15/expectedResult.json +9 -0
  221. package/test-fixtures/sync-language/15/metadata.json +5 -0
  222. package/test-fixtures/sync-language/15/record.json +7 -0
  223. package/test-fixtures/translate-terms/05/expectedResult.json +12 -0
  224. package/test-fixtures/translate-terms/05/metadata.json +7 -0
  225. package/test-fixtures/translate-terms/05/record.json +11 -0
  226. package/test-fixtures/translate-terms/06/expectedResult.json +12 -0
  227. package/test-fixtures/translate-terms/06/metadata.json +7 -0
  228. package/test-fixtures/translate-terms/06/record.json +11 -0
  229. package/test-fixtures/translate-terms-data.js +23 -0
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "01: Drop some bad terms",
3
+ "fix": true,
4
+ "only": false,
5
+ "skip": false
6
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "",
4
+ "fields": [
5
+ { "tag": "001", "value": "test1"},
6
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
7
+ { "code": "a", "value": "laiturit" },
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": "saiturit" },
14
+ { "code": "2", "value": "yso/fin" },
15
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p13299" }
16
+ ]
17
+ },
18
+
19
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
20
+ { "code": "a", "value": "marxismi" },
21
+ { "code": "2", "value": "yso/fin" },
22
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p444" }
23
+ ]},
24
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
25
+ { "code": "a", "value": "marxism" },
26
+ { "code": "2", "value": "yso/swe" },
27
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p444" }
28
+ ]},
29
+ { "tag": "651", "ind1": " ", "ind2": "7", "subfields": [
30
+ { "code": "a", "value": "Ivalo (Enare)" },
31
+ { "code": "2", "value": "yso/swe" },
32
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p111739" }
33
+ ]}
34
+ ]
35
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "message": [
3
+ "Remove '650 #7 ‡a saiturit ‡2 yso/fin ‡0 http://www.yso.fi/onto/yso/p13299'",
4
+ "Remove '651 #7 ‡a Inari ‡2 yso/swe ‡0 http://www.yso.fi/onto/yso/p111739'"
5
+ ],
6
+ "valid": false
7
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "02: Drop some bad terms (validation)",
3
+ "fix": false,
4
+ "skip": false,
5
+ "only": true
6
+ }
@@ -0,0 +1,40 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "",
4
+ "fields": [
5
+ { "tag": "001", "value": "test1"},
6
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
7
+ { "code": "a", "value": "laiturit" },
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": "saiturit" },
14
+ { "code": "2", "value": "yso/fin" },
15
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p13299" }
16
+ ]
17
+ },
18
+
19
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
20
+ { "code": "a", "value": "marxismi" },
21
+ { "code": "2", "value": "yso/fin" },
22
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p444" }
23
+ ]},
24
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
25
+ { "code": "a", "value": "marxism" },
26
+ { "code": "2", "value": "yso/swe" },
27
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p444" }
28
+ ]},
29
+ { "tag": "651", "ind1": " ", "ind2": "7", "subfields": [
30
+ { "code": "a", "value": "Ivalo (Enare)" },
31
+ { "code": "2", "value": "yso/swe" },
32
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p111739" }
33
+ ]},
34
+ { "tag": "651", "ind1": " ", "ind2": "7", "subfields": [
35
+ { "code": "a", "value": "Inari" },
36
+ { "code": "2", "value": "yso/swe" },
37
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p111739" }
38
+ ]}
39
+ ]
40
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "message": [
3
+ "Modify '650 #7 ‡a saiturit ‡2 yso/fin ‡0 http://www.yso.fi/onto/yso/p13299' => '650 #7 ‡a saiturit ‡2 yso/fin'"
4
+ ],
5
+ "valid": false
6
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "description": "03: Drop incorrect $0 from a bad term 'saiturit' (using non-default config, otherwise the whole field would be removed)",
3
+ "fix": false,
4
+ "skip": false,
5
+ "only": true,
6
+
7
+ "config": {
8
+ "constraints": [
9
+
10
+ {"tag": "650", "lex": "yso/fin"},
11
+ {"tag": "650", "lex": "yso/swe"}
12
+ ],
13
+ "keep invalid label": true,
14
+ "keep invalid url": false,
15
+ "remove 0-less": false
16
+ },
17
+ "comment": "True 'keep invalid label' means that field is not removed, however 'keep invalid url' will remove $0 from it"
18
+ }
@@ -0,0 +1,39 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "",
4
+ "fields": [
5
+ { "tag": "001", "value": "test1"},
6
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
7
+ { "code": "a", "value": "laiturit" },
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": "saiturit" },
14
+ { "code": "2", "value": "yso/fin" },
15
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p13299" }
16
+ ]
17
+ },
18
+
19
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
20
+ { "code": "a", "value": "poista 0-ton" },
21
+ { "code": "2", "value": "yso/fin" }
22
+ ]},
23
+ { "tag": "650", "ind1": " ", "ind2": "7", "subfields": [
24
+ { "code": "a", "value": "marxism" },
25
+ { "code": "2", "value": "yso/swe" },
26
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p444" }
27
+ ]},
28
+ { "tag": "651", "ind1": " ", "ind2": "7", "subfields": [
29
+ { "code": "a", "value": "Ivalo (Enare)" },
30
+ { "code": "2", "value": "yso/swe" },
31
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p111739" }
32
+ ]},
33
+ { "tag": "651", "ind1": " ", "ind2": "7", "subfields": [
34
+ { "code": "a", "value": "Inari" },
35
+ { "code": "2", "value": "yso/swe" },
36
+ { "code": "0", "value": "http://www.yso.fi/onto/yso/p111739" }
37
+ ]}
38
+ ]
39
+ }
@@ -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
+ }