cocina-models 0.128.0 → 0.129.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e36b1b2a099fed16e2cc7c49b46479b80ce03f2ee65ef5a87ef49e9d74379ac6
4
- data.tar.gz: 878705f40ff9598207bcee6a2e8ff0c89f5dbcc8e9bc9fc5c755642c93c30440
3
+ metadata.gz: e825fe93a987da1a8c23ce57093eb0ee376229a605d4e7bb548e56cabb03fc86
4
+ data.tar.gz: 542a860bd40cd64f31232cd4dfd0b65e2b8ae53dddc1f86597a0b86951d0327a
5
5
  SHA512:
6
- metadata.gz: 9ea6f8363bb8a487a0670c8c062859ee1c16f618f6a12e5224ee0eb4ee30ebb6165a124c2d478f4e34250e9b3655a95b8d9f503e38f6afea4c130dfd9d4b3de8
7
- data.tar.gz: c0de7bb6610cfa67a118a4c847add1da3a4d395fb0b8325e9bd2020a88a9a8555afa04fabce3e860b21569e9741d38b5e89f0e64c47e32a7dec22165791b7261
6
+ metadata.gz: 0a31ff1218930150d45c3457bd8f7915934416fae3ba9b37abbbc7acfea177e38943b9493d00335933ae9d7cde8a02def61a37780d805762fd9ac0f65fb6a46c
7
+ data.tar.gz: bf0406a3f1d6267a40de10d1e747ac90bd9b57d75f11eeb33826b5161b7a7c46fcd84447f74e57b5b6e2e33c8313c7d493f5e0da682799a7bcf784bbc2c458e7
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocina-models (0.128.0)
4
+ cocina-models (0.129.0)
5
5
  activesupport
6
6
  cocina_display
7
7
  deprecation
@@ -37,7 +37,7 @@ GEM
37
37
  base64 (0.3.0)
38
38
  bigdecimal (4.1.2)
39
39
  builder (3.3.0)
40
- cocina_display (2.8.0)
40
+ cocina_display (2.9.0)
41
41
  activesupport (>= 7)
42
42
  edtf (~> 3.2)
43
43
  geo_coord (~> 0.2)
@@ -54,7 +54,6 @@ GEM
54
54
  deprecation (1.1.0)
55
55
  activesupport
56
56
  diff-lcs (1.6.2)
57
- docile (1.4.1)
58
57
  drb (2.2.3)
59
58
  dry-core (1.2.0)
60
59
  concurrent-ruby (~> 1.0)
@@ -101,10 +100,10 @@ GEM
101
100
  reline (>= 0.4.2)
102
101
  iso8601 (0.13.0)
103
102
  janeway-jsonpath (1.0.0)
104
- json (2.20.0)
105
- jsonschema_rs (0.46.10-arm64-darwin)
103
+ json (2.21.1)
104
+ jsonschema_rs (0.47.0-arm64-darwin)
106
105
  bigdecimal (>= 3.1, < 5)
107
- jsonschema_rs (0.46.10-x86_64-linux)
106
+ jsonschema_rs (0.47.0-x86_64-linux)
108
107
  bigdecimal (>= 3.1, < 5)
109
108
  language_server-protocol (3.17.0.6)
110
109
  lint_roller (1.1.0)
@@ -162,7 +161,7 @@ GEM
162
161
  rspec-support (3.13.7)
163
162
  rspec_junit_formatter (0.6.0)
164
163
  rspec-core (>= 2, < 4, != 2.12.0)
165
- rubocop (1.88.1)
164
+ rubocop (1.88.2)
166
165
  json (~> 2.3)
167
166
  language_server-protocol (~> 3.17.0.2)
168
167
  lint_roller (~> 1.1.0)
@@ -185,12 +184,7 @@ GEM
185
184
  rubocop (~> 1.86, >= 1.86.2)
186
185
  ruby-progressbar (1.13.0)
187
186
  securerandom (0.4.1)
188
- simplecov (0.22.0)
189
- docile (~> 1.1)
190
- simplecov-html (~> 0.11)
191
- simplecov_json_formatter (~> 0.1)
192
- simplecov-html (0.13.2)
193
- simplecov_json_formatter (0.1.4)
187
+ simplecov (1.0.0)
194
188
  super_diff (0.19.0)
195
189
  attr_extras (>= 6.2.4, < 8)
196
190
  diff-lcs (~> 1.5)
@@ -231,16 +225,15 @@ CHECKSUMS
231
225
  base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
232
226
  bigdecimal (4.1.2) sha256=53d217666027eab4280346fba98e7d5b66baaae1b9c3c1c0ffe89d48188a3fbd
233
227
  builder (3.3.0) sha256=497918d2f9dca528fdca4b88d84e4ef4387256d984b8154e9d5d3fe5a9c8835f
234
- bundler (4.0.15) sha256=a4ceb882fe94a0e0ac63cd0813932bbfd631a14e5ac0b7975189b19a4d28d9e7
235
- cocina-models (0.128.0)
236
- cocina_display (2.8.0) sha256=89722e8e204c07cfa38f3deacbd66d42f3db9c7b29fdc034973d847cf93c4995
228
+ bundler (4.0.16) sha256=d6ca5dd440c24f9abce9844cf44cc8e18c6a553de65a47efb4544137af92c47d
229
+ cocina-models (0.129.0)
230
+ cocina_display (2.9.0) sha256=00e97cf826dafd5c547ca87b58e55f1d3bfa68fa4ddcddbbe25b4d9d9ed05d8f
237
231
  concurrent-ruby (1.3.7) sha256=4412caec3a5ea2e5fdc52076724c071a81f2c0593d83b2ac8cbb8ca63b3151b0
238
232
  connection_pool (3.0.2) sha256=33fff5ba71a12d2aa26cb72b1db8bba2a1a01823559fb01d29eb74c286e62e0a
239
233
  csv (3.3.5) sha256=6e5134ac3383ef728b7f02725d9872934f523cb40b961479f69cf3afa6c8e73f
240
234
  debug (1.11.1) sha256=2e0b0ac6119f2207a6f8ac7d4a73ca8eb4e440f64da0a3136c30343146e952b6
241
235
  deprecation (1.1.0) sha256=01707cea9a6ed2d7270377457941f43394a345e6dd8048e1be6d18ff2f2a01e1
242
236
  diff-lcs (1.6.2) sha256=9ae0d2cba7d4df3075fe8cd8602a8604993efc0dfa934cff568969efb1909962
243
- docile (1.4.1) sha256=96159be799bfa73cdb721b840e9802126e4e03dfc26863db73647204c727f21e
244
237
  drb (2.2.3) sha256=0b00d6fdb50995fe4a45dea13663493c841112e4068656854646f418fda13373
245
238
  dry-core (1.2.0) sha256=0cc5a7da88df397f153947eeeae42e876e999c1e30900f3c536fb173854e96a1
246
239
  dry-inflector (1.3.1) sha256=7fb0c2bb04f67638f25c52e7ba39ab435d922a3a5c3cd196120f63accb682dcc
@@ -259,9 +252,9 @@ CHECKSUMS
259
252
  irb (1.18.0) sha256=de9454a0703a54704b9811a5ef31a60c86949fbf4013fcf244fabc7c775248e3
260
253
  iso8601 (0.13.0) sha256=298c2b15b7be5fa95a1372813d36a2257656cd8e906dfbc1f5cb409851425aa2
261
254
  janeway-jsonpath (1.0.0) sha256=c8293f009f2aea9487ddee3067ca735a1f758eb1c8834ff4fab3ffd06c56d0a3
262
- json (2.20.0) sha256=9362bc6e55a952b056abf9167cf053358181c904cb70cd6eee0808ea830fc32b
263
- jsonschema_rs (0.46.10-arm64-darwin) sha256=1bece46823184a8cbec55d7585f09de68cc2bc03772d8aa9c29deba23b490609
264
- jsonschema_rs (0.46.10-x86_64-linux) sha256=ef1f8a244e8e5b4a9e35ccd0b7f7aa9912a7e15b00f1170ba3f3cade0bdc627b
255
+ json (2.21.1) sha256=13a43df75d95641443f5702dff350f237164a9d811ff0f2c2800d4d980220583
256
+ jsonschema_rs (0.47.0-arm64-darwin) sha256=ab3aae9da5796999d2686dfacaa2b4c9a5510b9194b4e4b73a6aa8767a78ac8a
257
+ jsonschema_rs (0.47.0-x86_64-linux) sha256=5dfc5c14362cf5efee24242be23feb4342665f489b63e1eba4c256aac8c96047
265
258
  language_server-protocol (3.17.0.6) sha256=5ef2c0c138f8267e1bc631d3328347d354f96724b0af22f2c79516120443b7f0
266
259
  lint_roller (1.1.0) sha256=2c0c845b632a7d172cb849cc90c1bce937a28c5c8ccccb50dfd46a485003cc87
267
260
  logger (1.7.0) sha256=196edec7cc44b66cfb40f9755ce11b392f21f7967696af15d274dde7edff0203
@@ -290,15 +283,13 @@ CHECKSUMS
290
283
  rspec-mocks (3.13.8) sha256=086ad3d3d17533f4237643de0b5c42f04b66348c28bf6b9c2d3f4a3b01af1d47
291
284
  rspec-support (3.13.7) sha256=0640e5570872aafefd79867901deeeeb40b0c9875a36b983d85f54fb7381c47c
292
285
  rspec_junit_formatter (0.6.0) sha256=40dde674e6ae4e6cc0ff560da25497677e34fefd2338cc467a8972f602b62b15
293
- rubocop (1.88.1) sha256=726af773d6bc169ed3ff852f3ca020b7c58d39c34e7a8d879a8e0147cc994f26
286
+ rubocop (1.88.2) sha256=8def251c90cd955feb4daa3edc0ab56893250c4ce90ef81e6c80c03f9a939bbf
294
287
  rubocop-ast (1.50.0) sha256=b9ca88300da0803ee222ad20cdb30494c0a784eed06fdc35d254b06d662788db
295
288
  rubocop-rake (0.7.1) sha256=3797f2b6810c3e9df7376c26d5f44f3475eda59eb1adc38e6f62ecf027cbae4d
296
289
  rubocop-rspec (3.10.2) sha256=0b3e2ecc592cd10ecbf0095bb58d1e357905276e069643523cc19eb7495f65e2
297
290
  ruby-progressbar (1.13.0) sha256=80fc9c47a9b640d6834e0dc7b3c94c9df37f08cb072b7761e4a71e22cff29b33
298
291
  securerandom (0.4.1) sha256=cc5193d414a4341b6e225f0cb4446aceca8e50d5e1888743fac16987638ea0b1
299
- simplecov (0.22.0) sha256=fe2622c7834ff23b98066bb0a854284b2729a569ac659f82621fc22ef36213a5
300
- simplecov-html (0.13.2) sha256=bd0b8e54e7c2d7685927e8d6286466359b6f16b18cb0df47b508e8d73c777246
301
- simplecov_json_formatter (0.1.4) sha256=529418fbe8de1713ac2b2d612aa3daa56d316975d307244399fa4838c601b428
292
+ simplecov (1.0.0) sha256=bdc50b41fa4a8b3c860da4bf5d61ba4704479c51d08a8f53cbd56ae50778dca8
302
293
  super_diff (0.19.0) sha256=c35fc1c0daa223d67b203fe3fb49a6cfd67850a53920319565c3c654e03ec902
303
294
  thor (1.5.0) sha256=e3a9e55fe857e44859ce104a84675ab6e8cd59c650a49106a05f55f136425e73
304
295
  tsort (0.2.0) sha256=9650a793f6859a43b6641671278f79cfead60ac714148aabe4e3f0060480089f
@@ -309,4 +300,4 @@ CHECKSUMS
309
300
  zeitwerk (2.8.2) sha256=7212a61311083c604184b1ea2574b9aa05cd14f855a0841c06985cabe9181d12
310
301
 
311
302
  BUNDLED WITH
312
- 4.0.15
303
+ 4.0.16
@@ -0,0 +1,600 @@
1
+ # Form source codes from LC source lists
2
+ # Sources:
3
+ # - https://www.loc.gov/standards/sourcelist/genre-form.html
4
+ # - https://www.loc.gov/standards/sourcelist/subject.html
5
+ - aass
6
+ - aat
7
+ - aatnor
8
+ - abne
9
+ - aedoml
10
+ - afo
11
+ - afset
12
+ - agrifors
13
+ - agrovoc
14
+ - agrovocf
15
+ - agrovocs
16
+ - ahecc
17
+ - aiatsisl
18
+ - aiatsisp
19
+ - aiatsiss
20
+ - aktp
21
+ - albt
22
+ - alett
23
+ - allars
24
+ - amg
25
+ - anzsic
26
+ - anzsoc
27
+ - anzsrc
28
+ - apaist
29
+ - armarc
30
+ - ascdc
31
+ - asced
32
+ - ascl
33
+ - asft
34
+ - ashlnl
35
+ - asrcrfcd
36
+ - asrcseo
37
+ - asrctoa
38
+ - asth
39
+ - ated
40
+ - atg
41
+ - atla
42
+ - aucsh
43
+ - ausext
44
+ - bare
45
+ - barn
46
+ - barngf
47
+ - bdrc
48
+ - bella
49
+ - bellobv
50
+ - bet
51
+ - bgtchm
52
+ - bhammf
53
+ - bhashe
54
+ - bhb
55
+ - bib1814
56
+ - bibalex
57
+ - bibbi
58
+ - biccbmc
59
+ - bicssc
60
+ - bidex
61
+ - bisacmt
62
+ - bisacrt
63
+ - bisacsh
64
+ - bjornson
65
+ - blcpss
66
+ - blmlsh
67
+ - blnpn
68
+ - bokbas
69
+ - bt
70
+ - btr
71
+ - buscem
72
+ - buscxf
73
+ - cabt
74
+ - cash
75
+ - cbk
76
+ - cbktrf
77
+ - cccv
78
+ - cck
79
+ - cckthema
80
+ - ccsa
81
+ - cct
82
+ - ccte
83
+ - cctf
84
+ - cdcng
85
+ - ceeus
86
+ - cgndb
87
+ - cgpa
88
+ - chirosh
89
+ - cht
90
+ - ciesiniv
91
+ - cilla
92
+ - cjh
93
+ - coarrt
94
+ - collett
95
+ - conorsi
96
+ - conorsr
97
+ - csahssa
98
+ - csalsct
99
+ - csapa
100
+ - csh
101
+ - csht
102
+ - cstud
103
+ - cyac
104
+ - czenas
105
+ - czmesh
106
+ - dbcsh
107
+ - dbn
108
+ - dcs
109
+ - dct
110
+ - ddcri
111
+ - ddcrit
112
+ - ddcut
113
+ - dhb-jdg
114
+ - dicgenam
115
+ - dicgenes
116
+ - dicgentop
117
+ - dissao
118
+ - dit
119
+ - dltlt
120
+ - dltt
121
+ - doll
122
+ - drama
123
+ - dtict
124
+ - dugfr
125
+ - ebfem
126
+ - eclas
127
+ - eet
128
+ - eflch
129
+ - eks
130
+ - elsst
131
+ - embehu
132
+ - embiaecid
133
+ - embne
134
+ - embucm
135
+ - embus
136
+ - embuz
137
+ - emnmus
138
+ - ept
139
+ - erfemn
140
+ - ericd
141
+ - esar
142
+ - est
143
+ - estc
144
+ - etiras
145
+ - etuesh
146
+ - etuturkob
147
+ - eum
148
+ - eurovoc
149
+ - eurovocen
150
+ - eurovoces
151
+ - eurovocfr
152
+ - eurovocsl
153
+ - fast
154
+ - fbg
155
+ - fcb
156
+ - fes
157
+ - fgtpcm
158
+ - finmesh
159
+ - fire
160
+ - flgeo
161
+ - fmesh
162
+ - fnhl
163
+ - francis
164
+ - frst
165
+ - fssh
166
+ - ftamc
167
+ - galestne
168
+ - gatbeg
169
+ - gbd
170
+ - gccst
171
+ - gcipmedia
172
+ - gcipplatform
173
+ - gem
174
+ - gemet
175
+ - gemppg
176
+ - geni
177
+ - geonames
178
+ - geonet
179
+ - georeft
180
+ - gmd
181
+ - gmgpc
182
+ - gnd
183
+ - gnd-carrier
184
+ - gnd-content
185
+ - gnd-music
186
+ - gnis
187
+ - gpn
188
+ - gsafd
189
+ - gsso
190
+ - gst
191
+ - gtlm
192
+ - gtmm
193
+ - gtt
194
+ - gttg
195
+ - habibe
196
+ - habich
197
+ - habifr
198
+ - habiit
199
+ - hamsun
200
+ - hapi
201
+ - helecon
202
+ - henn
203
+ - hkcan
204
+ - hlasstg
205
+ - hoidokki
206
+ - homoit
207
+ - hrvmesh
208
+ - hrvmr
209
+ - huc
210
+ - humord
211
+ - ibsen
212
+ - ica
213
+ - iconauth
214
+ - icpsr
215
+ - idas
216
+ - idref
217
+ - idsbb
218
+ - idszbz
219
+ - idszbzes
220
+ - idszbzna
221
+ - idszbzzg
222
+ - idszbzzh
223
+ - idszbzzk
224
+ - iescs
225
+ - iest
226
+ - ilot
227
+ - ilpt
228
+ - inist
229
+ - inspect
230
+ - ipat
231
+ - ipsp
232
+ - iptcnc
233
+ - isbdcontent
234
+ - isbdmedia
235
+ - isis
236
+ - itglit
237
+ - itis
238
+ - itrt
239
+ - jhpb
240
+ - jhpk
241
+ - jlabsh
242
+ - juho
243
+ - jupo
244
+ - jurivoc
245
+ - kaa
246
+ - kaba
247
+ - kao
248
+ - kassu
249
+ - kauno
250
+ - kaunokki
251
+ - kdm
252
+ - khib
253
+ - kito
254
+ - kitu
255
+ - kkts
256
+ - koko
257
+ - kssbar
258
+ - kta
259
+ - kto
260
+ - ktpt
261
+ - ktta
262
+ - kubikat
263
+ - kula
264
+ - kulo
265
+ - kupu
266
+ - labloc
267
+ - lacnaf
268
+ - lapponica
269
+ - larpcal
270
+ - lcac
271
+ - lcdgt
272
+ - lcgft
273
+ - lcmpt
274
+ - lcsh
275
+ - lcshac
276
+ - lcstt
277
+ - lctgm
278
+ - leaubsh
279
+ - lemac
280
+ - lemb
281
+ - liito
282
+ - liv
283
+ - lnmmbr
284
+ - lobt
285
+ - local
286
+ - lst
287
+ - ltcsh
288
+ - lua
289
+ - maaq
290
+ - maknaz
291
+ - maotao
292
+ - mar
293
+ - marccarrier
294
+ - marccategory
295
+ - marcform
296
+ - marcgt
297
+ - marcsmd
298
+ - masa
299
+ - mech
300
+ - mero
301
+ - mesh
302
+ - meshscr
303
+ - migfg
304
+ - mim
305
+ - minecost
306
+ - mipfesd
307
+ - mmm
308
+ - mpirdes
309
+ - msc
310
+ - msh
311
+ - msupplcont
312
+ - mtirdes
313
+ - mts
314
+ - musa
315
+ - muso
316
+ - musvok-sf
317
+ - muzeukc
318
+ - muzeukn
319
+ - muzeukv
320
+ - muzvukci
321
+ - naf
322
+ - nal
323
+ - nalnaf
324
+ - nasat
325
+ - nbdbgf
326
+ - nbdbt
327
+ - nbiemnfag
328
+ - ncjt
329
+ - ncrbs
330
+ - ncrcarrier
331
+ - ncrcontent
332
+ - ncrcpc
333
+ - ncrfs
334
+ - ncrft
335
+ - ncrmat
336
+ - ncrmedia
337
+ - ncrpm
338
+ - ncrpo
339
+ - ncrrm
340
+ - ncrtr
341
+ - ncrvf
342
+ - ndlgft
343
+ - ndlsh
344
+ - neo
345
+ - netc
346
+ - ngl
347
+ - nicem
348
+ - nimacsc
349
+ - nimafc
350
+ - niodt
351
+ - nlgaf
352
+ - nlggf
353
+ - nlgkk
354
+ - nlgsh
355
+ - nli
356
+ - nlksh
357
+ - nlmnaf
358
+ - nmaict
359
+ - nmc
360
+ - no-ubo-mr
361
+ - nom
362
+ - noraf
363
+ - noram
364
+ - norbok
365
+ - normesh
366
+ - norvok
367
+ - noubojur
368
+ - noubomn
369
+ - nsbncf
370
+ - nskps
371
+ - nskzs
372
+ - nta
373
+ - ntc
374
+ - ntcpsc
375
+ - ntcsd
376
+ - ntids
377
+ - ntissc
378
+ - ntsf
379
+ - nzcoh
380
+ - nzggn
381
+ - nznb
382
+ - oabt
383
+ - odlt
384
+ - ogst
385
+ - olacvggt
386
+ - opat
387
+ - opms
388
+ - ordnok
389
+ - orgnr
390
+ - pana
391
+ - pascal
392
+ - peakbag
393
+ - pepp
394
+ - peri
395
+ - periodo
396
+ - pha
397
+ - pkk
398
+ - pldi
399
+ - pleiades
400
+ - pmbok
401
+ - pmcsg
402
+ - pmont
403
+ - pmt
404
+ - poha
405
+ - poliscit
406
+ - popinte
407
+ - pplt
408
+ - ppluk
409
+ - precis
410
+ - prnpdi
411
+ - proqsc
412
+ - proysen
413
+ - prvt
414
+ - psh
415
+ - psychit
416
+ - puho
417
+ - qlit
418
+ - qlsp
419
+ - qnaf
420
+ - qnlsh
421
+ - qrma
422
+ - qrmak
423
+ - qtglit
424
+ - quiding
425
+ - radfg
426
+ - ram
427
+ - rasuqam
428
+ - rbbin
429
+ - rbgenr
430
+ - rbmscv
431
+ - rbpap
432
+ - rbpri
433
+ - rbprov
434
+ - rbpub
435
+ - rbtyp
436
+ - rda
437
+ - rdaar
438
+ - rdabf
439
+ - rdabs
440
+ - rdacarrier
441
+ - rdacc
442
+ - rdaco
443
+ - rdacontent
444
+ - rdacpc
445
+ - rdact
446
+ - rdaep
447
+ - rdafmn
448
+ - rdafnm
449
+ - rdafr
450
+ - rdafs
451
+ - rdaft
452
+ - rdagen
453
+ - rdagrp
454
+ - rdagw
455
+ - rdaill
456
+ - rdalay
457
+ - rdamat
458
+ - rdamedia
459
+ - rdami
460
+ - rdamt
461
+ - rdapf
462
+ - rdapm
463
+ - rdapo
464
+ - rdare
465
+ - rdarm
466
+ - rdarr
467
+ - rdasco
468
+ - rdaspc
469
+ - rdatb
470
+ - rdatc
471
+ - rdatr
472
+ - rdavf
473
+ - renib
474
+ - reo
475
+ - rero
476
+ - rerovoc
477
+ - reveal
478
+ - rma
479
+ - root
480
+ - rpe
481
+ - rswk
482
+ - rswkaf
483
+ - rugeo
484
+ - rurkp
485
+ - rvm
486
+ - rvmfast
487
+ - rvmgd
488
+ - rvmgf
489
+ - samisk
490
+ - sanb
491
+ - sao
492
+ - saogf
493
+ - sbaa
494
+ - sbiao
495
+ - sbt
496
+ - scbi
497
+ - scgdst
498
+ - scisshl
499
+ - scot
500
+ - sears
501
+ - sesca
502
+ - sfit
503
+ - sgc
504
+ - sgce
505
+ - sgp
506
+ - shbe
507
+ - she
508
+ - shsples
509
+ - sigle
510
+ - sipri
511
+ - sk
512
+ - skbb
513
+ - skish
514
+ - skon
515
+ - slem
516
+ - slm
517
+ - smda
518
+ - snt
519
+ - socio
520
+ - solstad
521
+ - sosa
522
+ - soto
523
+ - spines
524
+ - ssg
525
+ - stcv
526
+ - sthus
527
+ - stw
528
+ - swd
529
+ - swemesh
530
+ - taika
531
+ - tasmas
532
+ - taxhs
533
+ - tbjvp
534
+ - tef
535
+ - tekord
536
+ - tept
537
+ - tero
538
+ - tesa
539
+ - tesbhaecid
540
+ - test
541
+ - tgfbne
542
+ - tgfc
543
+ - tgn
544
+ - tha
545
+ - thema
546
+ - thesoz
547
+ - thia
548
+ - thla
549
+ - tho
550
+ - thub
551
+ - tips
552
+ - tisa
553
+ - tlka
554
+ - tlsh
555
+ - tmdbm
556
+ - tmdbp
557
+ - tmdbtv
558
+ - tpro
559
+ - trfarn
560
+ - trfbmb
561
+ - trfdh
562
+ - trfgr
563
+ - trfoba
564
+ - trfzb
565
+ - trt
566
+ - trtsa
567
+ - tsaij
568
+ - tshd
569
+ - tsht
570
+ - tsr
571
+ - ttka
572
+ - ttll
573
+ - tucua
574
+ - udc
575
+ - ukslc
576
+ - ula
577
+ - ulan
578
+ - umitrist
579
+ - unbisn
580
+ - unbist
581
+ - unescot
582
+ - unicefirc
583
+ - usaidt
584
+ - usgst
585
+ - valo
586
+ - vcaadu
587
+ - vffyl
588
+ - vgmsgg
589
+ - vgmsng
590
+ - vmj
591
+ - waqaf
592
+ - watrest
593
+ - wgst
594
+ - wikidata
595
+ - worldcat
596
+ - wot
597
+ - wpicsh
598
+ - ysa
599
+ - yso
600
+ - zst
@@ -88,7 +88,7 @@ module Cocina
88
88
  uri: ValueURI.sniff(subject_node['valueURI'], notifier)
89
89
  }.tap do |attrs|
90
90
  source = {
91
- code: subject_node['authority'],
91
+ value: subject_node['authority'],
92
92
  uri: subject_node['authorityURI']
93
93
  }.compact
94
94
  attrs[:source] = source if source.present?
@@ -20,7 +20,7 @@ module Cocina
20
20
  attribute(:administrative, AdminPolicyAdministrative.default { AdminPolicyAdministrative.new })
21
21
  # Description that is included in a request to create a DRO. This is the same as a
22
22
  # Description, except excludes PURL.
23
- attribute? :description, RequestDescription.optional
23
+ attribute(:description, RequestDescription.default { RequestDescription.new })
24
24
  end
25
25
  end
26
26
  end
@@ -12,7 +12,18 @@ module Cocina
12
12
  Thread.current[:top_level_validate] = validate unless Thread.current.key?(:top_level_validate)
13
13
 
14
14
  Validators::Validator.validate(self, attributes) if Thread.current[:top_level_validate]
15
- super(attributes, safe, &)
15
+
16
+ # Tracks that any Validatable construction triggered by `super` below is nested inside this one, so
17
+ # JsonSchemaValidator can skip it: this object's own schema check above already covers.
18
+ # See JsonSchemaValidator#validate.
19
+ # In practice, this avoids doing schema validation on a DRO / AdminPolicy / Collection and
20
+ # its nested Description.
21
+ Thread.current[:cocina_construction_depth] = Thread.current[:cocina_construction_depth].to_i + 1
22
+ begin
23
+ super(attributes, safe, &)
24
+ ensure
25
+ Thread.current[:cocina_construction_depth] -= 1
26
+ end
16
27
  ensure
17
28
  Thread.current[:top_level_validate] = nil
18
29
  end
@@ -20,7 +31,14 @@ module Cocina
20
31
 
21
32
  def new(*args)
22
33
  validate = args.first.delete(:validate) if args.present?
23
- new_model = super
34
+
35
+ Thread.current[:cocina_construction_depth] = Thread.current[:cocina_construction_depth].to_i + 1
36
+ begin
37
+ new_model = super
38
+ ensure
39
+ Thread.current[:cocina_construction_depth] -= 1
40
+ end
41
+
24
42
  Validators::Validator.validate(new_model.class, new_model) if validate || validate.nil?
25
43
  new_model
26
44
  end
@@ -11,6 +11,7 @@ module Cocina
11
11
  DescriptionRoleSourceCodeVisitorValidator,
12
12
  DescriptionNameSourceCodeVisitorValidator,
13
13
  DescriptionFormResourceTypeVisitorValidator,
14
+ DescriptionFormSourceCodeVisitorValidator,
14
15
  DescriptionLanguageCodeVisitorValidator,
15
16
  DescriptionSubjectSourceCodeVisitorValidator,
16
17
  DescriptionValuesVisitorValidator,
@@ -30,7 +31,7 @@ module Cocina
30
31
  def initialize(clazz, attributes, validators: VALIDATORS)
31
32
  @clazz = clazz
32
33
  @attributes = attributes
33
- @validators = validators.map(&:new)
34
+ @validators = meets_preconditions? ? validators.map(&:new) : []
34
35
  end
35
36
 
36
37
  def validate
@@ -18,7 +18,7 @@ module Cocina
18
18
  def initialize(clazz, attributes, validators: VALIDATORS)
19
19
  @clazz = clazz
20
20
  @attributes = attributes
21
- @validators = validators.map { |v| v.new(attributes) }
21
+ @validators = meets_preconditions? ? validators.map { |v| v.new(attributes) } : []
22
22
  end
23
23
 
24
24
  def validate
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ module Validators
6
+ # Validates form.source.code values against form_source_codes.yml.
7
+ class DescriptionFormSourceCodeVisitorValidator < BaseDescriptionVisitorValidator
8
+ def validate!
9
+ return if error_paths.empty?
10
+
11
+ raise ValidationError, "Unrecognized form source codes in description: #{error_paths.join(', ')}"
12
+ end
13
+
14
+ def visit_hash(hash:, path:)
15
+ return unless form_entry_path?(path)
16
+
17
+ source_code = hash.dig(:source, :code)
18
+ return unless source_code
19
+
20
+ error_paths << "#{path_to_s(path)}.source.code (#{source_code})" unless valid_codes.include?(source_code.downcase)
21
+ end
22
+
23
+ private
24
+
25
+ def error_paths
26
+ @error_paths ||= []
27
+ end
28
+
29
+ def form_entry_path?(path)
30
+ path.length >= 2 && path[-1].is_a?(Integer) && path[-2].to_s == 'form'
31
+ end
32
+
33
+ # rubocop:disable Style/ClassVars
34
+ def valid_codes
35
+ @@valid_codes ||= YAML.load_file(::File.expand_path('../../../../form_source_codes.yml', __dir__)).to_set(&:downcase)
36
+ end
37
+ # rubocop:enable Style/ClassVars
38
+ end
39
+ end
40
+ end
41
+ end
@@ -25,6 +25,11 @@ module Cocina
25
25
 
26
26
  # @see #validate
27
27
  def self.validate(...)
28
+ # Skip when nested inside another Validatable's construction: the enclosing object's own
29
+ # schema check already covers this, so re-evaluating it here would be
30
+ # redundant. See Validatable#new.
31
+ return if Thread.current[:cocina_construction_depth].to_i.positive?
32
+
28
33
  new(...).validate
29
34
  end
30
35
 
@@ -67,7 +72,7 @@ module Cocina
67
72
  evaluation = self.class.validator_for(method_name).evaluate(attributes.as_json)
68
73
  return if evaluation.valid?
69
74
 
70
- raise ValidationError, "When validating #{method_name}: " + filtered_error_messages(evaluation).join(', ')
75
+ raise ValidationError, "When validating #{method_name}: " + filtered_error_messages(evaluation).join('; ')
71
76
  end
72
77
 
73
78
  private
@@ -90,7 +95,7 @@ module Cocina
90
95
  denoised.flat_map { |d| format_detail(d) }.uniq
91
96
  end
92
97
 
93
- # Removes two categories of cascade noise produced by `unevaluatedProperties: false`:
98
+ # Removes three categories of cascade noise from errors:
94
99
  #
95
100
  # 1. falseSchema errors — every `unevaluatedProperties: false` on a sub-path emits
96
101
  # a "False schema does not allow …" entry for each matched value. These are
@@ -100,8 +105,28 @@ module Cocina
100
105
  # is a known model attribute — these arise because allOf/$ref composition means
101
106
  # the validator can't prove top-level properties were "evaluated", even though
102
107
  # they are valid model fields.
108
+ #
109
+ # 3. anyOf branch noise — when each branch requires a different property, all failing
110
+ # branches emit a separate "required" error at the same path. Collapse into one
111
+ # "needs to include at least one of: …" message.
103
112
  def denoise(details)
104
- details.reject { |d| false_schema_noise?(d) || root_unevaluated_noise?(d) }
113
+ filtered = details.reject { |detail| false_schema_noise?(detail) || root_unevaluated_noise?(detail) }
114
+ collapse_anyof_required(filtered)
115
+ end
116
+
117
+ def collapse_anyof_required(details)
118
+ # instanceLocation is the input data that failed. Group errors for each failing data location.
119
+ details.group_by { |detail| detail[:instanceLocation] }.flat_map do |loc, group|
120
+ # splits errors into "required" anyOf errors and others (minItems, unevaluatedProperties)
121
+ required, others = group.partition { |detail| detail[:errors].keys == ['required'] }
122
+ next group if required.size <= 1
123
+
124
+ # Extract property name from "required" messages such as, '"url" is a required property'
125
+ props = required.filter_map { |detail| detail[:errors]['required'][/"([^"]+)"/, 1] }.uniq
126
+ # Put the data path at the start of the message; blank instanceLocation so format_detail won't also append it
127
+ msg = "#{loc} needs to include at least one of the following: #{props.join(', ')}"
128
+ others + [required.first.merge(instanceLocation: '', errors: { 'required' => msg })]
129
+ end
105
130
  end
106
131
 
107
132
  def false_schema_noise?(detail)
@@ -120,12 +145,32 @@ module Cocina
120
145
  unexpected.all? { |prop| known_root_properties.include?(prop) }
121
146
  end
122
147
 
148
+ # Formats error details hash into more user-friendly messages
149
+ # A detail can carry multiple errors (one per JSON Schema keyword), so this returns an array.
150
+ # minItems errors get a dedicated formatter; everything else uses the generic one.
123
151
  def format_detail(detail)
124
152
  loc = detail[:instanceLocation]
125
- detail[:errors].map do |_keyword, message|
126
- loc.empty? ? message : "#{message} at #{loc}"
153
+ detail[:errors].map do |keyword, message|
154
+ keyword == 'minItems' ? format_min_items(message, loc) : format_generic(message, loc)
127
155
  end
128
156
  end
157
+
158
+ # Rewrites messages regarding minItems validation
159
+ # "[] has less than 1 item at /event/0/date " is rewritten to "/event/0/date is empty but should have at least 1 item"
160
+ # Arrays with items but fewer than the minimum will be rewritten to "/event/0/date should have at least 2 items"
161
+ def format_min_items(message, loc)
162
+ # extract minimum number of items from message
163
+ min = message[/less than (\d+)/, 1] || '1'
164
+ # pluralize "item" when appropriate
165
+ items = min == '1' ? 'item' : 'items'
166
+ # determine if the message is about an empty array or an non-empty array without enough items
167
+ prefix = message.start_with?('[]') ? "#{loc} is empty but" : loc.to_s
168
+ "#{prefix} should have at least #{min} #{items}"
169
+ end
170
+
171
+ def format_generic(message, loc)
172
+ loc.empty? ? message : "#{message} at #{loc}"
173
+ end
129
174
  end
130
175
  end
131
176
  end
@@ -16,12 +16,22 @@ module Cocina
16
16
  ].freeze
17
17
 
18
18
  def self.validate(clazz, attributes, validators: VALIDATORS)
19
- # This gets rid of nested model objects.
20
- attributes_hash = attributes.to_h.deep_transform_values do |value|
19
+ hash = attributes_hash(attributes)
20
+ validators.each { |validator| validator.validate(clazz, hash) }
21
+ end
22
+
23
+ # @return [Hash] attributes with any embedded Cocina model instances flattened to hashes
24
+ def self.attributes_hash(attributes)
25
+ # Dry::Struct#to_h is already fully recursive (Dry::Struct::Hashify flattens nested
26
+ # structs all the way down), so a Cocina model instance's #to_h has no embedded
27
+ # Cocina model instances left to flatten and the deep walk below would be a no-op.
28
+ return attributes.to_h.with_indifferent_access if attributes.class.name.starts_with?('Cocina::Models')
29
+
30
+ attributes.to_h.deep_transform_values do |value|
21
31
  value.class.name.starts_with?('Cocina::Models') ? value.to_h : value
22
32
  end.with_indifferent_access
23
- validators.each { |validator| validator.validate(clazz, attributes_hash) }
24
33
  end
34
+ private_class_method :attributes_hash
25
35
 
26
36
  def self.deep_transform_values(object, ...)
27
37
  case object
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.128.0'
5
+ VERSION = '0.129.0'
6
6
  end
7
7
  end
data/schema.json CHANGED
@@ -2546,9 +2546,21 @@
2546
2546
  "required": [
2547
2547
  "cocinaVersion",
2548
2548
  "administrative",
2549
+ "description",
2549
2550
  "type",
2550
2551
  "version"
2551
2552
  ],
2553
+ "allOf": [
2554
+ {
2555
+ "properties": {
2556
+ "description": {
2557
+ "required": [
2558
+ "title"
2559
+ ]
2560
+ }
2561
+ }
2562
+ }
2563
+ ],
2552
2564
  "unevaluatedProperties": false
2553
2565
  },
2554
2566
  "RequestAdministrative": {
@@ -2616,6 +2628,47 @@
2616
2628
  "type",
2617
2629
  "version"
2618
2630
  ],
2631
+ "anyOf": [
2632
+ {
2633
+ "required": [
2634
+ "description"
2635
+ ],
2636
+ "properties": {
2637
+ "description": {
2638
+ "required": [
2639
+ "title"
2640
+ ]
2641
+ }
2642
+ }
2643
+ },
2644
+ {
2645
+ "required": [
2646
+ "identification"
2647
+ ],
2648
+ "properties": {
2649
+ "identification": {
2650
+ "required": [
2651
+ "catalogLinks"
2652
+ ],
2653
+ "properties": {
2654
+ "catalogLinks": {
2655
+ "contains": {
2656
+ "type": "object",
2657
+ "required": [
2658
+ "refresh"
2659
+ ],
2660
+ "properties": {
2661
+ "refresh": {
2662
+ "const": true
2663
+ }
2664
+ }
2665
+ }
2666
+ }
2667
+ }
2668
+ }
2669
+ }
2670
+ }
2671
+ ],
2619
2672
  "unevaluatedProperties": false
2620
2673
  },
2621
2674
  "RequestDRO": {
@@ -2682,6 +2735,47 @@
2682
2735
  "type",
2683
2736
  "version"
2684
2737
  ],
2738
+ "anyOf": [
2739
+ {
2740
+ "required": [
2741
+ "description"
2742
+ ],
2743
+ "properties": {
2744
+ "description": {
2745
+ "required": [
2746
+ "title"
2747
+ ]
2748
+ }
2749
+ }
2750
+ },
2751
+ {
2752
+ "required": [
2753
+ "identification"
2754
+ ],
2755
+ "properties": {
2756
+ "identification": {
2757
+ "required": [
2758
+ "catalogLinks"
2759
+ ],
2760
+ "properties": {
2761
+ "catalogLinks": {
2762
+ "contains": {
2763
+ "type": "object",
2764
+ "required": [
2765
+ "refresh"
2766
+ ],
2767
+ "properties": {
2768
+ "refresh": {
2769
+ "const": true
2770
+ }
2771
+ }
2772
+ }
2773
+ }
2774
+ }
2775
+ }
2776
+ }
2777
+ }
2778
+ ],
2685
2779
  "unevaluatedProperties": false
2686
2780
  },
2687
2781
  "RequestDROStructural": {
@@ -2803,9 +2897,6 @@
2803
2897
  "type": "string"
2804
2898
  }
2805
2899
  },
2806
- "required": [
2807
- "title"
2808
- ],
2809
2900
  "unevaluatedProperties": false
2810
2901
  },
2811
2902
  "RequestFile": {
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.128.0
4
+ version: 0.129.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
@@ -326,6 +326,7 @@ files:
326
326
  - docs/cocina-base.jsonld
327
327
  - docs/description_types.md
328
328
  - exe/generator
329
+ - form_source_codes.yml
329
330
  - identifier_source_codes.yml
330
331
  - iso15924_codes.yml
331
332
  - language_uri_iso639_2_codes.yml
@@ -485,6 +486,7 @@ files:
485
486
  - lib/cocina/models/validators/description_date_time_visitor_validator.rb
486
487
  - lib/cocina/models/validators/description_event_date_visitor_validator.rb
487
488
  - lib/cocina/models/validators/description_form_resource_type_visitor_validator.rb
489
+ - lib/cocina/models/validators/description_form_source_code_visitor_validator.rb
488
490
  - lib/cocina/models/validators/description_identifier_source_code_visitor_validator.rb
489
491
  - lib/cocina/models/validators/description_language_code_visitor_validator.rb
490
492
  - lib/cocina/models/validators/description_language_uri_visitor_validator.rb
@@ -536,7 +538,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
536
538
  - !ruby/object:Gem::Version
537
539
  version: '0'
538
540
  requirements: []
539
- rubygems_version: 4.0.6
541
+ rubygems_version: 3.6.9
540
542
  specification_version: 4
541
543
  summary: Data models for the SDR
542
544
  test_files: []