@natlibfi/marc-record-validators-melinda 11.3.6 → 11.3.7

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 (100) hide show
  1. package/dist/punctuation2.js +42 -10
  2. package/dist/punctuation2.js.map +1 -1
  3. package/dist/urn.js +15 -6
  4. package/dist/urn.js.map +1 -1
  5. package/dist/urn.spec.js +45 -276
  6. package/dist/urn.spec.js.map +1 -1
  7. package/package.json +10 -10
  8. package/src/punctuation2.js +27 -10
  9. package/src/urn.js +17 -3
  10. package/src/urn.spec.js +49 -264
  11. package/test-fixtures/cyrillux/f09/expectedResult.json +4 -4
  12. package/test-fixtures/punctuation2/787/expectedResult.json +14 -0
  13. package/test-fixtures/punctuation2/787/metadata.json +5 -0
  14. package/test-fixtures/punctuation2/787/record.json +13 -0
  15. package/test-fixtures/sort-fields/05/input.json +11 -10
  16. package/test-fixtures/sort-fields/05/result.json +10 -10
  17. package/test-fixtures/strip-punctuation/787/expectedResult.json +14 -0
  18. package/test-fixtures/strip-punctuation/787/metadata.json +5 -0
  19. package/test-fixtures/strip-punctuation/787/record.json +13 -0
  20. package/test-fixtures/urn/f01/input.json +15 -0
  21. package/test-fixtures/urn/f01/metadata.json +6 -0
  22. package/test-fixtures/urn/f01/result.json +16 -0
  23. package/test-fixtures/urn/f02/input.json +11 -0
  24. package/test-fixtures/urn/f02/metadata.json +7 -0
  25. package/test-fixtures/urn/f02/result.json +15 -0
  26. package/test-fixtures/urn/f03/input.json +8 -0
  27. package/test-fixtures/urn/f03/metadata.json +7 -0
  28. package/test-fixtures/urn/f03/result.json +12 -0
  29. package/test-fixtures/urn/f04/input.json +9 -0
  30. package/test-fixtures/urn/f04/metadata.json +7 -0
  31. package/test-fixtures/urn/f04/result.json +13 -0
  32. package/test-fixtures/urn/f05/input.json +9 -0
  33. package/test-fixtures/urn/f05/metadata.json +9 -0
  34. package/test-fixtures/urn/f05/result.json +13 -0
  35. package/test-fixtures/urn/f06/input.json +17 -0
  36. package/test-fixtures/urn/f06/metadata.json +6 -0
  37. package/test-fixtures/urn/f06/result.json +18 -0
  38. package/test-fixtures/urn/f07/input.json +17 -0
  39. package/test-fixtures/urn/f07/metadata.json +6 -0
  40. package/test-fixtures/urn/f07/result.json +18 -0
  41. package/test-fixtures/urn/f08/input.json +11 -0
  42. package/test-fixtures/urn/f08/metadata.json +6 -0
  43. package/test-fixtures/urn/f08/result.json +17 -0
  44. package/test-fixtures/urn/f09/input.json +7 -0
  45. package/test-fixtures/urn/f09/metadata.json +7 -0
  46. package/test-fixtures/urn/f09/result.json +8 -0
  47. package/test-fixtures/urn/f10/input.json +7 -0
  48. package/test-fixtures/urn/f10/metadata.json +7 -0
  49. package/test-fixtures/urn/f10/result.json +8 -0
  50. package/test-fixtures/urn/f11/input.json +7 -0
  51. package/test-fixtures/urn/f11/metadata.json +7 -0
  52. package/test-fixtures/urn/f11/result.json +8 -0
  53. package/test-fixtures/urn/f12/input.json +8 -0
  54. package/test-fixtures/urn/f12/metadata.json +6 -0
  55. package/test-fixtures/urn/f12/result.json +14 -0
  56. package/test-fixtures/urn/f13/input.json +14 -0
  57. package/test-fixtures/urn/f13/metadata.json +6 -0
  58. package/test-fixtures/urn/f13/result.json +20 -0
  59. package/test-fixtures/urn/f14/input.json +14 -0
  60. package/test-fixtures/urn/f14/metadata.json +6 -0
  61. package/test-fixtures/urn/f14/result.json +20 -0
  62. package/test-fixtures/urn/f15/input.json +11 -0
  63. package/test-fixtures/urn/f15/metadata.json +7 -0
  64. package/test-fixtures/urn/f15/result.json +17 -0
  65. package/test-fixtures/urn/v01/input.json +14 -0
  66. package/test-fixtures/urn/v01/metadata.json +6 -0
  67. package/test-fixtures/urn/v01/result.json +3 -0
  68. package/test-fixtures/urn/v02/input.json +18 -0
  69. package/test-fixtures/urn/v02/metadata.json +6 -0
  70. package/test-fixtures/urn/v02/result.json +3 -0
  71. package/test-fixtures/urn/v03/input.json +18 -0
  72. package/test-fixtures/urn/v03/metadata.json +6 -0
  73. package/test-fixtures/urn/v03/result.json +3 -0
  74. package/test-fixtures/urn/v04/input.json +18 -0
  75. package/test-fixtures/urn/v04/metadata.json +6 -0
  76. package/test-fixtures/urn/v04/result.json +3 -0
  77. package/test-fixtures/urn/v05/input.json +18 -0
  78. package/test-fixtures/urn/v05/metadata.json +6 -0
  79. package/test-fixtures/urn/v05/result.json +3 -0
  80. package/test-fixtures/urn/v06/input.json +16 -0
  81. package/test-fixtures/urn/v06/metadata.json +6 -0
  82. package/test-fixtures/urn/v06/result.json +3 -0
  83. package/test-fixtures/urn/v07/input.json +16 -0
  84. package/test-fixtures/urn/v07/metadata.json +6 -0
  85. package/test-fixtures/urn/v07/result.json +3 -0
  86. package/test-fixtures/urn/v08/input.json +15 -0
  87. package/test-fixtures/urn/v08/metadata.json +6 -0
  88. package/test-fixtures/urn/v08/result.json +3 -0
  89. package/test-fixtures/urn/v09/input.json +13 -0
  90. package/test-fixtures/urn/v09/metadata.json +6 -0
  91. package/test-fixtures/urn/v09/result.json +3 -0
  92. package/test-fixtures/urn/v10/input.json +13 -0
  93. package/test-fixtures/urn/v10/metadata.json +6 -0
  94. package/test-fixtures/urn/v10/result.json +3 -0
  95. package/test-fixtures/urn/v11/input.json +21 -0
  96. package/test-fixtures/urn/v11/metadata.json +6 -0
  97. package/test-fixtures/urn/v11/result.json +3 -0
  98. package/test-fixtures/urn/v12/input.json +12 -0
  99. package/test-fixtures/urn/v12/metadata.json +6 -0
  100. package/test-fixtures/urn/v12/result.json +3 -0
package/src/urn.spec.js CHANGED
@@ -1,267 +1,52 @@
1
1
  import {expect} from 'chai';
2
2
  import {MarcRecord} from '@natlibfi/marc-record';
3
- import validatorFactory from '../src/urn';
4
-
5
- describe('urn', async () => {
6
- // Fields
7
- const f337 = {
8
- tag: '337',
9
- ind1: ' ',
10
- ind2: ' ',
11
- subfields: [
12
- {code: 'b', value: 'c'},
13
- {code: '2', value: 'rdamedia'}
14
- ]
15
- };
16
-
17
- const f337nonElectronic = {
18
- tag: '337',
19
- ind1: ' ',
20
- ind2: ' ',
21
- subfields: [
22
- {code: 'b', value: 'n'},
23
- {code: '2', value: 'rdamedia'}
24
- ]
25
- };
26
-
27
- const ldf856 = {
28
- tag: '856',
29
- ind1: '4',
30
- ind2: '0',
31
- subfields: [
32
- {code: 'u', value: 'http://urn.fi/URN:ISBN:978-951-9155-47-0'},
33
- {code: 'z', value: 'Käytettävissä vapaakappaletyöasemilla'},
34
- {code: '5', value: 'FI-Vapaa'}
35
- ]
36
- };
37
-
38
- const ldf856old = {
39
- tag: '856',
40
- ind1: '4',
41
- ind2: '0',
42
- subfields: [
43
- {code: 'u', value: 'http://urn.fi/URN:ISBN:978-951-9155-47-0'},
44
- {code: 'z', value: 'Käytettävissä vapaakappalekirjastoissa'},
45
- {code: '5', value: 'FI-Vapaa'}
46
- ]
47
- };
48
-
49
- const ldf856Https = {
50
- tag: '856',
51
- ind1: '4',
52
- ind2: '0',
53
- subfields: [
54
- {code: 'u', value: 'https://urn.fi/URN:ISBN:978-951-9155-47-0'},
55
- {code: 'z', value: 'Käytettävissä vapaakappaletyöasemilla'},
56
- {code: '5', value: 'FI-Vapaa'}
57
- ]
58
- };
59
-
60
- const ldf856partial = {
61
- tag: '856',
62
- ind1: '4',
63
- ind2: '0',
64
- subfields: [
65
- {code: 'u', value: 'http://urn.fi/URN:ISBN:978-951-9155-47-0'},
66
- {code: '5', value: 'FI-Vapaa'}
67
- ]
68
- };
69
-
70
- const f856URN = {
71
- tag: '856',
72
- ind1: '4',
73
- ind2: '0',
74
- subfields: [{code: 'u', value: 'http://urn.fi/URN:ISBN:978-951-9155-47-0'}]
75
- };
76
-
77
- const f856URNHttps = {
78
- tag: '856',
79
- ind1: '4',
80
- ind2: '0',
81
- subfields: [{code: 'u', value: 'https://urn.fi/URN:ISBN:978-951-9155-47-0'}]
82
- };
83
-
84
- const f856URNnotResource = {
85
- tag: '856',
86
- ind1: '4',
87
- ind2: '1',
88
- subfields: [{code: 'u', value: 'http://urn.fi/URN:ISBN:978-951-9155-47-0'}]
89
- };
90
-
91
-
92
- const f856URL = {
93
- tag: '856',
94
- ind1: '4',
95
- ind2: '0',
96
- subfields: [{code: 'u', value: 'http://foo.bar/'}]
97
- };
98
-
99
- const f020 = {
100
- tag: '020',
101
- ind1: ' ',
102
- ind2: ' ',
103
- subfields: [{code: 'a', value: '978-951-9155-47-0'}]
104
- };
105
-
106
- const f020second = {
107
- tag: '020',
108
- ind1: ' ',
109
- ind2: ' ',
110
- subfields: [{code: 'a', value: '9789519155470'}]
111
- };
112
-
113
-
114
- it('Creates a validator', async () => {
115
- const validator = await validatorFactory();
116
-
117
- expect(validator)
118
- .to.be.an('object')
119
- .that.has.any.keys('description', 'validate');
120
-
121
- expect(validator.description).to.be.a('string');
122
- expect(validator.validate).to.be.a('function');
123
- });
124
-
125
- // Tests
126
- const test = async isLegalDeposit => {
127
- const validator = await validatorFactory(isLegalDeposit);
128
- return {
129
- validate: async (valid, ...recfields) => {
130
- const result = await validator.validate(new MarcRecord({fields: recfields}));
131
- expect(result).to.eql({valid});
132
- },
133
-
134
- fix: async (recfields, resfields) => {
135
- const record = new MarcRecord({fields: recfields});
136
- await validator.fix(record);
137
- expect(record.fields).to.eql(resfields);
138
- }
139
- };
140
- };
141
-
142
- /// Non-legal and legal deposit
143
- const nonld = await test(false);
144
- const ld = await test(true);
145
-
146
- describe('#validate', () => {
147
- // Validate non-electoronic
148
- it('Finds the record valid; non-electronic record', async () => {
149
- await nonld.validate(true, f337nonElectronic);
150
- });
151
-
152
- // Validate non-legal deposit
153
- it('Finds the record valid; 856 with urn, and is non-legal deposit', async () => {
154
- await nonld.validate(true, f337, f856URN);
155
- });
156
-
157
- // we should recognize that 856 with second indicator 1 is not describing the resource itself
158
- it.skip('Finds the record invalid; 856 ind2: 1 with urn, and is non-legal deposit', async () => {
159
- await nonld.validate(false, f337, f856URNnotResource);
160
- });
161
-
162
- // should we require urn if we're not handling a legal deposit
163
- it('Finds the record invalid; 856 without urn, and is non-legal deposit', async () => {
164
- await nonld.validate(false, f337, f856URL);
165
- });
166
-
167
-
168
- // should we require urn if we're not handling a legal deposit
169
- it('Finds the record invalid; Missing 856, and is non-legal deposit', async () => {
170
- await nonld.validate(false, f337, f020);
171
- });
172
-
173
- // Validate legal deposit
174
- it('Finds the record invalid; 856 with urn, and is legal deposit', async () => {
175
- await ld.validate(false, f020, f337, f856URN);
176
- });
177
-
178
- it('Finds the record invalid; 856 without urn, and is legal deposit', async () => {
179
- await ld.validate(false, f020, f337, f856URL);
180
- });
181
-
182
- it('Finds the record invalid; Missing 856, and is legal deposit', async () => {
183
- await ld.validate(false, f337, f020);
184
- });
185
-
186
- it('Finds the record valid; 856 with URN and legal deposit subfields, and is legal deposit', async () => {
187
- await ld.validate(true, f337, f020, ldf856);
188
- });
189
-
190
- it('Finds the record invalid; old phrase is used in $z', async () => {
191
- await ld.validate(false, f337, f020, ldf856old);
192
- });
193
-
194
- it('Finds the record valid; 856 with URN and legal deposit subfields and other f856s, and is legal deposit', async () => {
195
- await ld.validate(true, f337, f020, ldf856partial, ldf856, f856URL);
196
- });
197
-
198
- it('Finds the record invalid; 856 with URN and partial legal deposit subfields, and is legal deposit', async () => {
199
- await ld.validate(false, f337, f020, ldf856partial);
200
- });
201
-
202
-
203
- });
204
-
205
- describe('#fix', () => {
206
- // Fix non-legal deposit
207
- it('856 with urn, and is non-legal deposit; Nothing to add', async () => {
208
- await nonld.fix([f020, f856URL, f856URN], [f020, f856URL, f856URN]);
209
- });
210
-
211
- // should we actually add non-resolvable urns?
212
- it('856 without urn, and is non-legal deposit; Adds 856 with urn (https)', async () => {
213
- await nonld.fix([f020, f856URL], [f020, f856URL, f856URNHttps]);
214
- });
215
-
216
- // should we actually add non-resolvable urns?
217
- it('Missing 856, and is non-legal deposit; Adds 856 with urn (https)', async () => {
218
- await nonld.fix([f020], [f020, f856URNHttps]);
219
- });
220
-
221
- // should we actually add non-resolvable urns?
222
- it('Missing 856, and is non-legal deposit, two 020 fields; Adds 856 with urn from second 020 (https)', async () => {
223
- await nonld.fix([f020second, f020], [f020second, f020, f856URNHttps]);
224
- });
225
-
226
- // should we actually add non resovable urns?
227
- // we should think about how to choose the isbn to use in case of several ISBNs
228
- it.skip('Missing 856, and is non-legal deposit, two 020 fields; Adds 856 with urn from first 020 (https)', async () => {
229
- await nonld.fix([f020, f020second], [f020, f020second, f856URNHttps]);
230
- });
231
-
232
-
233
- // Fix legal deposit
234
- it('856 with urn and legal deposit fields, and is legal deposit; Nothing to add', async () => {
235
- await ld.fix([f020, f856URL, ldf856], [f020, f856URL, ldf856]);
236
- });
237
-
238
- it('856 with urn and legal deposit fields, and is legal deposit but phrase is old; change phrase to new', async () => {
239
- await ld.fix([f020, f856URL, ldf856old], [f020, f856URL, ldf856]);
240
- });
241
-
242
- it('856 without urn, and is legal deposit; Adds 856 with urn (https) and legal deposit fields', async () => {
243
- await ld.fix([f020, f856URL], [f020, f856URL, ldf856Https]);
244
- });
245
-
246
- // we should test generating the URN in case of no ISBN
247
-
248
- // we should test creating Melinda-temp field
249
-
250
- // We shouldn't lock the open URN for legal deposit use
251
- it('Missing 856, and is legal deposit; Adds 856 with urn (https) and legal deposit fields', async () => {
252
- await ld.fix([f020], [f020, ldf856Https]);
253
- });
254
-
255
- // We should actually do this instead of locking the original non-legal deposit URN for legal deposit use
256
- it.skip('856 with urn, and is legal deposit; Adds another f856 with URN and legal deposit fields', async () => {
257
- await ld.fix([f020, f856URL, f856URN], [f020, f856URL, f856URN, ldf856Https]);
258
- });
259
-
260
- // We should actually add a new urn in case of a non-resource URN
261
- it.skip('856 with non-resource-urn, and is legal deposit; Adds another f856 with URN and legal deposit fields', async () => {
262
- await ld.fix([f020, f856URL, f856URNnotResource], [f020, f856URL, f856URNnotResource, ldf856Https]);
263
- });
264
-
265
-
266
- });
3
+ import validatorFactory from './urn';
4
+ import {READERS} from '@natlibfi/fixura';
5
+ import generateTests from '@natlibfi/fixugen';
6
+ import createDebugLogger from 'debug';
7
+
8
+ generateTests({
9
+ callback,
10
+ path: [__dirname, '..', 'test-fixtures', 'urn'],
11
+ useMetadataFile: true,
12
+ recurse: false,
13
+ fixura: {
14
+ reader: READERS.JSON
15
+ },
16
+ mocha: {
17
+ before: () => testValidatorFactory()
18
+ }
267
19
  });
20
+ const debug = createDebugLogger('@natlibfi/marc-record-validators-melinda/urn:test');
21
+
22
+ async function testValidatorFactory() {
23
+ const validator = await validatorFactory();
24
+
25
+ expect(validator)
26
+ .to.be.an('object')
27
+ .that.has.any.keys('description', 'validate');
28
+
29
+ expect(validator.description).to.be.a('string');
30
+ expect(validator.validate).to.be.a('function');
31
+ }
32
+
33
+ async function callback({getFixture, enabled = true, fix = true, isLegalDeposit = false}) {
34
+ if (enabled === false) {
35
+ debug('TEST SKIPPED!');
36
+ return;
37
+ }
38
+
39
+ const validator = await validatorFactory(isLegalDeposit);
40
+ const record = new MarcRecord(getFixture('input.json'));
41
+ const expectedResult = getFixture('result.json');
42
+ // console.log(expectedResult); // eslint-disable-line
43
+
44
+ if (!fix) {
45
+ const result = await validator.validate(record);
46
+ expect(result).to.eql(expectedResult);
47
+ return;
48
+ }
49
+
50
+ await validator.fix(record);
51
+ expect(record).to.eql(expectedResult);
52
+ }
@@ -107,14 +107,14 @@
107
107
  { "code": "q", "value": "FI-NL" },
108
108
  { "code": "5", "value": "MELINDA" }
109
109
  ]},
110
- { "tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
111
- { "code": "c", "value": "(ANDL100008)5557598" },
112
- { "code": "b", "value": "piki" }
113
- ]},
114
110
  { "tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
115
111
  { "code": "c", "value": "2587473" },
116
112
  { "code": "b", "value": "helme" }
117
113
  ]},
114
+ { "tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
115
+ { "code": "c", "value": "(ANDL100008)5557598" },
116
+ { "code": "b", "value": "piki" }
117
+ ]},
118
118
  { "tag": "LOW", "ind1": " ", "ind2": " ", "subfields": [
119
119
  { "code": "a", "value": "PIKI" }
120
120
  ]},
@@ -0,0 +1,14 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "01331cam a22003494i 4500",
4
+ "fields": [
5
+ { "tag": "001", "value": "000000001" },
6
+ { "tag": "787", "ind1": "0", "ind2": "8", "subfields": [
7
+ { "code": "i", "value": "Arvosteltu teos:" },
8
+ { "code": "a", "value": "Joku halvatun tekijä." },
9
+ { "code": "t", "value": "Nimeke." },
10
+ { "code": "z", "value": "1234567890" },
11
+ { "code": "w", "value": "(FI-MELINDA)012345678"}
12
+ ]}
13
+ ]
14
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description":"Add punctuation from 787",
3
+ "fix": true,
4
+ "only": false
5
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ { "tag": "001", "value": "000000001" },
5
+ { "tag": "787", "ind1": "0", "ind2": "8", "subfields": [
6
+ { "code": "i", "value": "Arvosteltu teos" },
7
+ { "code": "a", "value": "Joku halvatun tekijä" },
8
+ { "code": "t", "value": "Nimeke" },
9
+ { "code": "z", "value": "1234567890" },
10
+ { "code": "w", "value": "(FI-MELINDA)012345678"}
11
+ ]}
12
+ ]
13
+ }
@@ -3,24 +3,25 @@
3
3
  "fields":
4
4
  [
5
5
  {"tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
6
- {"code": "c", "value": "hanna"},
7
- {"code": "b", "value": "30"}
6
+ {"code": "c", "value": "30"},
7
+ {"code": "b", "value": "hanna"}
8
8
  ]},
9
9
  {"tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
10
- {"code": "c", "value": "alli"},
11
- {"code": "b", "value": "4"}
10
+ {"code": "c", "value": "4"},
11
+ {"code": "b", "value": "alli"}
12
12
  ]},
13
13
  {"tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
14
- {"code": "c", "value": "helka"},
15
- {"code": "b", "value": "4"}
14
+ {"code": "c", "value": "4"},
15
+ {"code": "b", "value": "helka"}
16
16
  ]},
17
17
  {"tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
18
- {"code": "c", "value": "wilma"},
19
- {"code": "b", "value": "666"}
18
+ {"code": "c", "value": "666"},
19
+ {"code": "b", "value": "wilma"}
20
20
  ]},
21
21
  {"tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
22
- {"code": "c", "value": "taist"},
23
- {"code": "b", "value": "999999999"}
22
+ {"code": "c", "value": "999999999"},
23
+ {"code": "b", "value": "taist"}
24
+
24
25
  ]},
25
26
  {"tag": "LOW", "subfields": [{"code": "a", "value": "TEST"}]}
26
27
  ]
@@ -3,24 +3,24 @@
3
3
  "fields":
4
4
  [
5
5
  {"tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
6
- {"code": "c", "value": "alli"},
7
- {"code": "b", "value": "4"}
6
+ {"code": "c", "value": "4"},
7
+ {"code": "b", "value": "alli"}
8
8
  ]},
9
9
  {"tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
10
- {"code": "c", "value": "hanna"},
11
- {"code": "b", "value": "30"}
10
+ {"code": "c", "value": "30"},
11
+ {"code": "b", "value": "hanna"}
12
12
  ]},
13
13
  {"tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
14
- {"code": "c", "value": "helka"},
15
- {"code": "b", "value": "4"}
14
+ {"code": "c", "value": "4"},
15
+ {"code": "b", "value": "helka"}
16
16
  ]},
17
17
  {"tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
18
- {"code": "c", "value": "taist"},
19
- {"code": "b", "value": "999999999"}
18
+ {"code": "c", "value": "999999999"},
19
+ {"code": "b", "value": "taist"}
20
20
  ]},
21
21
  {"tag": "SID", "ind1": " ", "ind2": " ", "subfields": [
22
- {"code": "c", "value": "wilma"},
23
- {"code": "b", "value": "666"}
22
+ {"code": "c", "value": "666"},
23
+ {"code": "b", "value": "wilma"}
24
24
  ]},
25
25
  {"tag": "LOW", "ind1": " ", "ind2": " ", "subfields": [{"code": "a", "value": "TEST"}]}
26
26
  ],
@@ -0,0 +1,14 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "01331cam a22003494i 4500",
4
+ "fields": [
5
+ { "tag": "001", "value": "000000001" },
6
+ { "tag": "787", "ind1": "0", "ind2": "8", "subfields": [
7
+ { "code": "i", "value": "Arvosteltu teos" },
8
+ { "code": "a", "value": "Joku halvatun tekijä" },
9
+ { "code": "t", "value": "Nimeke" },
10
+ { "code": "z", "value": "1234567890" },
11
+ { "code": "w", "value": "(FI-MELINDA)012345678"}
12
+ ]}
13
+ ]
14
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "description":"Remove punctuation from 787",
3
+ "fix": true,
4
+ "only": false
5
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ { "tag": "001", "value": "000000001" },
5
+ { "tag": "787", "ind1": "0", "ind2": "8", "subfields": [
6
+ { "code": "i", "value": "Arvosteltu teos:" },
7
+ { "code": "a", "value": "Joku halvatun tekijä." },
8
+ { "code": "t", "value": "Nimeke." },
9
+ { "code": "z", "value": "1234567890. -" },
10
+ { "code": "w", "value": "(FI-MELINDA)012345678"}
11
+ ]}
12
+ ]
13
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ { "tag": "001", "value": "000000001" },
5
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "978-951-9155-47-0"} ]},
6
+ { "tag": "337", "ind1": " ", "ind2": " ", "subfields": [ {"code": "b", "value": "c"}, {"code": "2", "value": "rdamedia"} ] },
7
+ { "tag": "856", "ind1": "4", "ind2": "0", "subfields": [
8
+ {"code": "u", "value": "http://foo.bar/"}
9
+ ]},
10
+ { "tag": "856", "ind1": "4", "ind2": "0", "subfields": [
11
+ {"code": "u", "value": "http://urn.fi/URN:ISBN:978-951-9155-47-0"},
12
+ {"code": "z", "value": "Käytettävissä vapaakappaletyöasemilla"}
13
+ ]}
14
+ ]
15
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "description": "F01. 856 with urn, and is non-legal deposit; Nothing to add",
3
+ "fix": true,
4
+ "only": false,
5
+ "isLegalDeposit": false
6
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "01331cam a22003494i 4500",
4
+ "fields": [
5
+ { "tag": "001", "value": "000000001" },
6
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "978-951-9155-47-0"} ]},
7
+ { "tag": "337", "ind1": " ", "ind2": " ", "subfields": [ {"code": "b", "value": "c"}, {"code": "2", "value": "rdamedia"} ] },
8
+ { "tag": "856", "ind1": "4", "ind2": "0", "subfields": [
9
+ {"code": "u", "value": "http://foo.bar/"}
10
+ ]},
11
+ { "tag": "856", "ind1": "4", "ind2": "0", "subfields": [
12
+ {"code": "u", "value": "http://urn.fi/URN:ISBN:978-951-9155-47-0"},
13
+ {"code": "z", "value": "Käytettävissä vapaakappaletyöasemilla"}
14
+ ]}
15
+ ]
16
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ { "tag": "001", "value": "000000001" },
5
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "978-951-9155-47-0"} ]},
6
+ { "tag": "337", "ind1": " ", "ind2": " ", "subfields": [ {"code": "b", "value": "c"}, {"code": "2", "value": "rdamedia"} ] },
7
+ { "tag": "856", "ind1": "4", "ind2": "0", "subfields": [
8
+ {"code": "u", "value": "http://foo.bar/"}
9
+ ]}
10
+ ]
11
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "description": "F02. 856 without urn, and is non-legal deposit; Adds 856 with urn (https)",
3
+ "comment": "should we actually add non-resolvable urns?",
4
+ "fix": true,
5
+ "only": false,
6
+ "isLegalDeposit": false
7
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "01331cam a22003494i 4500",
4
+ "fields": [
5
+ { "tag": "001", "value": "000000001" },
6
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "978-951-9155-47-0"} ]},
7
+ { "tag": "337", "ind1": " ", "ind2": " ", "subfields": [ {"code": "b", "value": "c"}, {"code": "2", "value": "rdamedia"} ] },
8
+ { "tag": "856", "ind1": "4", "ind2": "0", "subfields": [
9
+ {"code": "u", "value": "http://foo.bar/"}
10
+ ]},
11
+ { "tag": "856", "ind1": "4", "ind2": "0", "subfields": [
12
+ {"code": "u", "value": "https://urn.fi/URN:ISBN:978-951-9155-47-0"}
13
+ ]}
14
+ ]
15
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ { "tag": "001", "value": "000000001" },
5
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "978-951-9155-47-0"} ]},
6
+ { "tag": "337", "ind1": " ", "ind2": " ", "subfields": [ {"code": "b", "value": "c"}, {"code": "2", "value": "rdamedia"} ] }
7
+ ]
8
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "description": "F03. Missing 856, and is non-legal deposit; Adds 856 with urn (https)",
3
+ "comment": "should we actually add non-resolvable urns?",
4
+ "fix": true,
5
+ "only": false,
6
+ "isLegalDeposit": false
7
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "01331cam a22003494i 4500",
4
+ "fields": [
5
+ { "tag": "001", "value": "000000001" },
6
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "978-951-9155-47-0"} ]},
7
+ { "tag": "337", "ind1": " ", "ind2": " ", "subfields": [ {"code": "b", "value": "c"}, {"code": "2", "value": "rdamedia"} ] },
8
+ { "tag": "856", "ind1": "4", "ind2": "0", "subfields": [
9
+ {"code": "u", "value": "https://urn.fi/URN:ISBN:978-951-9155-47-0"}
10
+ ]}
11
+ ]
12
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ { "tag": "001", "value": "000000001" },
5
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "9789519155470"} ]},
6
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "978-951-9155-47-0"} ]},
7
+ { "tag": "337", "ind1": " ", "ind2": " ", "subfields": [ {"code": "b", "value": "c"}, {"code": "2", "value": "rdamedia"} ] }
8
+ ]
9
+ }
@@ -0,0 +1,7 @@
1
+ {
2
+ "description": "F04. Missing 856, and is non-legal deposit, two 020 fields; Adds 856 with urn from second 020 (https)",
3
+ "comment": "should we actually add non-resolvable urns?",
4
+ "fix": true,
5
+ "only": false,
6
+ "isLegalDeposit": false
7
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "_validationOptions": {},
3
+ "leader": "01331cam a22003494i 4500",
4
+ "fields": [
5
+ { "tag": "001", "value": "000000001" },
6
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "9789519155470"} ]},
7
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "978-951-9155-47-0"} ]},
8
+ { "tag": "337", "ind1": " ", "ind2": " ", "subfields": [ {"code": "b", "value": "c"}, {"code": "2", "value": "rdamedia"} ] },
9
+ { "tag": "856", "ind1": "4", "ind2": "0", "subfields": [
10
+ {"code": "u", "value": "https://urn.fi/URN:ISBN:978-951-9155-47-0"}
11
+ ]}
12
+ ]
13
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "leader": "01331cam a22003494i 4500",
3
+ "fields": [
4
+ { "tag": "001", "value": "000000001" },
5
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "978-951-9155-47-0"} ]},
6
+ { "tag": "020", "ind1": " ", "ind2": " ", "subfields": [ {"code": "a", "value": "9789519155470"} ]},
7
+ { "tag": "337", "ind1": " ", "ind2": " ", "subfields": [ {"code": "b", "value": "c"}, {"code": "2", "value": "rdamedia"} ] }
8
+ ]
9
+ }