cocina-models 0.62.1 → 0.65.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.
Files changed (54) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +9 -48
  3. data/.rubocop.yml +116 -1
  4. data/.rubocop_todo.yml +5 -4
  5. data/Gemfile +1 -0
  6. data/README.md +19 -6
  7. data/cocina-models.gemspec +6 -4
  8. data/docs/maps/Collection.json +0 -5
  9. data/docs/maps/DRO.json +0 -5
  10. data/lib/cocina/generator/schema_array.rb +1 -9
  11. data/lib/cocina/generator/schema_value.rb +4 -0
  12. data/lib/cocina/models/admin_policy.rb +3 -0
  13. data/lib/cocina/models/admin_policy_administrative.rb +4 -4
  14. data/lib/cocina/models/administrative.rb +1 -1
  15. data/lib/cocina/models/applies_to.rb +1 -1
  16. data/lib/cocina/models/cocina_version.rb +9 -0
  17. data/lib/cocina/models/collection.rb +3 -0
  18. data/lib/cocina/models/collection_identification.rb +1 -1
  19. data/lib/cocina/models/contributor.rb +5 -5
  20. data/lib/cocina/models/description.rb +12 -12
  21. data/lib/cocina/models/descriptive_access_metadata.rb +6 -6
  22. data/lib/cocina/models/descriptive_admin_metadata.rb +6 -6
  23. data/lib/cocina/models/descriptive_basic_value.rb +5 -5
  24. data/lib/cocina/models/descriptive_geographic_metadata.rb +2 -2
  25. data/lib/cocina/models/descriptive_grouped_value.rb +1 -1
  26. data/lib/cocina/models/descriptive_parallel_contributor.rb +4 -4
  27. data/lib/cocina/models/descriptive_parallel_event.rb +6 -6
  28. data/lib/cocina/models/descriptive_parallel_value.rb +1 -1
  29. data/lib/cocina/models/descriptive_structured_value.rb +1 -1
  30. data/lib/cocina/models/descriptive_value.rb +6 -6
  31. data/lib/cocina/models/descriptive_value_language.rb +1 -1
  32. data/lib/cocina/models/dro.rb +3 -0
  33. data/lib/cocina/models/dro_access.rb +1 -1
  34. data/lib/cocina/models/dro_structural.rb +3 -5
  35. data/lib/cocina/models/event.rb +7 -7
  36. data/lib/cocina/models/file_set_structural.rb +1 -1
  37. data/lib/cocina/models/identification.rb +3 -3
  38. data/lib/cocina/models/language.rb +5 -5
  39. data/lib/cocina/models/related_resource.rb +9 -9
  40. data/lib/cocina/models/request_admin_policy.rb +4 -1
  41. data/lib/cocina/models/request_collection.rb +4 -1
  42. data/lib/cocina/models/request_description.rb +28 -0
  43. data/lib/cocina/models/request_dro.rb +4 -1
  44. data/lib/cocina/models/request_dro_structural.rb +3 -4
  45. data/lib/cocina/models/request_file_set_structural.rb +1 -1
  46. data/lib/cocina/models/request_identification.rb +2 -2
  47. data/lib/cocina/models/sequence.rb +1 -1
  48. data/lib/cocina/models/source.rb +1 -1
  49. data/lib/cocina/models/standard.rb +1 -1
  50. data/lib/cocina/models/title.rb +6 -6
  51. data/lib/cocina/models/validator.rb +21 -1
  52. data/lib/cocina/models/version.rb +1 -1
  53. data/openapi.yml +124 -80
  54. metadata +30 -13
data/openapi.yml CHANGED
@@ -91,6 +91,18 @@ paths:
91
91
  responses:
92
92
  '200':
93
93
  description: noop
94
+ /validate/RequestDescription:
95
+ post:
96
+ summary: Validate a Request Description
97
+ requestBody:
98
+ required: true
99
+ content:
100
+ application/json:
101
+ schema:
102
+ $ref: '#/components/schemas/RequestDescription'
103
+ responses:
104
+ '200':
105
+ description: noop
94
106
  components:
95
107
  schemas:
96
108
  Access:
@@ -172,6 +184,8 @@ components:
172
184
  type: object
173
185
  additionalProperties: false
174
186
  properties:
187
+ cocinaVersion:
188
+ $ref: '#/components/schemas/CocinaVersion'
175
189
  type:
176
190
  type: string
177
191
  enum:
@@ -187,6 +201,7 @@ components:
187
201
  description:
188
202
  $ref: '#/components/schemas/Description'
189
203
  required:
204
+ - cocinaVersion
190
205
  - administrative
191
206
  - externalIdentifier
192
207
  - label
@@ -220,7 +235,7 @@ components:
220
235
  type: string
221
236
  hasAdminPolicy:
222
237
  $ref: '#/components/schemas/Druid'
223
- referencesAgreement:
238
+ hasAgreement:
224
239
  $ref: '#/components/schemas/Druid'
225
240
  roles:
226
241
  description: The access roles conferred by this AdminPolicy (used by Argo)
@@ -229,6 +244,7 @@ components:
229
244
  $ref: '#/components/schemas/AccessRole'
230
245
  required:
231
246
  - hasAdminPolicy
247
+ - hasAgreement
232
248
  AdminPolicyDefaultAccess:
233
249
  description: 'Provides the default access settings for an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults and has no embargo.'
234
250
  type: object
@@ -298,6 +314,7 @@ components:
298
314
  $ref: "#/components/schemas/DescriptiveBasicValue"
299
315
  Barcode:
300
316
  description: 'A barcode'
317
+ nullable: true
301
318
  oneOf:
302
319
  - $ref: '#/components/schemas/BusinessBarcode'
303
320
  - $ref: '#/components/schemas/LaneMedicalBarcode'
@@ -360,11 +377,18 @@ components:
360
377
  required:
361
378
  - access
362
379
  - download
380
+ CocinaVersion:
381
+ description: The version of Cocina with which this object conforms.
382
+ type: string
383
+ pattern: '^\d+\.\d+\.\d+$'
384
+ example: '1.2.3'
363
385
  Collection:
364
386
  description: A group of Digital Repository Objects that indicate some type of conceptual grouping within the domain that is worth reusing across the system.
365
387
  type: object
366
388
  additionalProperties: false
367
389
  properties:
390
+ cocinaVersion:
391
+ $ref: '#/components/schemas/CocinaVersion'
368
392
  type:
369
393
  description: The content type of the Collection. Selected from an established set of values.
370
394
  type: string
@@ -391,6 +415,7 @@ components:
391
415
  identification:
392
416
  $ref: '#/components/schemas/CollectionIdentification'
393
417
  required:
418
+ - cocinaVersion
394
419
  - externalIdentifier
395
420
  - label
396
421
  - type
@@ -529,77 +554,15 @@ components:
529
554
  Description:
530
555
  type: object
531
556
  additionalProperties: false
532
- properties:
533
- title:
534
- description: Titles of the resource.
535
- type: array
536
- minItems: 1
537
- items:
538
- $ref: "#/components/schemas/Title"
539
- contributor:
540
- description: Agents contributing in some way to the creation and history of the
541
- resource.
542
- type: array
543
- items:
544
- $ref: "#/components/schemas/Contributor"
545
- event:
546
- description: Events in the history of the resource.
547
- type: array
548
- items:
549
- $ref: "#/components/schemas/Event"
550
- form:
551
- description: Characteristics of the resource's physical, digital, and intellectual
552
- form and genre, and of its process of creation.
553
- type: array
554
- items:
555
- $ref: "#/components/schemas/DescriptiveValue"
556
- geographic:
557
- description: Geographic description for items with coordinates or bounding boxes.
558
- type: array
559
- items:
560
- $ref: "#/components/schemas/DescriptiveGeographicMetadata"
561
- language:
562
- description: Languages, scripts, symbolic systems, and notations used in all or
563
- part of a resource.
564
- type: array
565
- items:
566
- $ref: "#/components/schemas/Language"
567
- note:
568
- description: Additional information relevant to a resource.
569
- type: array
570
- items:
571
- $ref: "#/components/schemas/DescriptiveValue"
572
- identifier:
573
- description: Identifiers and URIs associated with the resource.
574
- type: array
575
- items:
576
- $ref: "#/components/schemas/DescriptiveValue"
577
- subject:
578
- description: Terms associated with the intellectual content of the resource.
579
- type: array
580
- items:
581
- $ref: "#/components/schemas/DescriptiveValue"
582
- purl:
583
- $ref: "#/components/schemas/Purl"
584
- access:
585
- $ref: "#/components/schemas/DescriptiveAccessMetadata"
586
- relatedResource:
587
- description: Other resources associated with the described resource.
588
- type: array
589
- items:
590
- $ref: "#/components/schemas/RelatedResource"
591
- marcEncodedData:
592
- description: Data about the resource represented in MARC fixed fields and codes.
593
- type: array
594
- items:
595
- $ref: "#/components/schemas/DescriptiveValue"
596
- adminMetadata:
597
- $ref: "#/components/schemas/DescriptiveAdminMetadata"
598
- valueAt:
599
- description: URL or other pointer to the location of the resource description.
600
- type: string
601
- required:
602
- - title
557
+ allOf:
558
+ - $ref: "#/components/schemas/RequestDescription"
559
+ - type: object
560
+ additionalProperties: false
561
+ properties:
562
+ purl:
563
+ $ref: "#/components/schemas/Purl"
564
+ required:
565
+ - purl
603
566
  DescriptiveAccessMetadata:
604
567
  description: Information about how to access digital and physical versions of the object.
605
568
  type: object
@@ -886,6 +849,8 @@ components:
886
849
  type: object
887
850
  additionalProperties: false
888
851
  properties:
852
+ cocinaVersion:
853
+ $ref: '#/components/schemas/CocinaVersion'
889
854
  type:
890
855
  description: The content type of the DRO. Selected from an established set of values.
891
856
  type: string
@@ -926,6 +891,7 @@ components:
926
891
  geographic:
927
892
  $ref: '#/components/schemas/Geographic'
928
893
  required:
894
+ - cocinaVersion
929
895
  - access
930
896
  - administrative
931
897
  - externalIdentifier
@@ -953,6 +919,7 @@ components:
953
919
  license:
954
920
  description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
955
921
  type: string
922
+ nullable: true
956
923
  enum:
957
924
  - 'https://www.gnu.org/licenses/agpl.txt'
958
925
  - 'https://www.apache.org/licenses/LICENSE-2.0'
@@ -1004,9 +971,6 @@ components:
1004
971
  type: array
1005
972
  items:
1006
973
  $ref: '#/components/schemas/Druid'
1007
- hasAgreement:
1008
- description: Agreement that covers the deposit of the DRO into SDR.
1009
- type: string
1010
974
  Druid:
1011
975
  type: string
1012
976
  pattern: '^druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$'
@@ -1508,6 +1472,8 @@ components:
1508
1472
  type: object
1509
1473
  additionalProperties: false
1510
1474
  properties:
1475
+ cocinaVersion:
1476
+ $ref: '#/components/schemas/CocinaVersion'
1511
1477
  type:
1512
1478
  type: string
1513
1479
  enum:
@@ -1519,8 +1485,9 @@ components:
1519
1485
  administrative:
1520
1486
  $ref: '#/components/schemas/AdminPolicyAdministrative'
1521
1487
  description:
1522
- $ref: '#/components/schemas/Description'
1488
+ $ref: '#/components/schemas/RequestDescription'
1523
1489
  required:
1490
+ - cocinaVersion
1524
1491
  - administrative
1525
1492
  - label
1526
1493
  - type
@@ -1530,6 +1497,8 @@ components:
1530
1497
  type: object
1531
1498
  additionalProperties: false
1532
1499
  properties:
1500
+ cocinaVersion:
1501
+ $ref: '#/components/schemas/CocinaVersion'
1533
1502
  type:
1534
1503
  type: string
1535
1504
  enum:
@@ -1547,20 +1516,96 @@ components:
1547
1516
  administrative:
1548
1517
  $ref: '#/components/schemas/Administrative'
1549
1518
  description:
1550
- $ref: '#/components/schemas/Description'
1519
+ $ref: '#/components/schemas/RequestDescription'
1551
1520
  identification:
1552
1521
  $ref: '#/components/schemas/CollectionIdentification'
1553
1522
  required:
1523
+ - cocinaVersion
1554
1524
  - access
1555
1525
  - administrative
1556
1526
  - label
1557
1527
  - type
1558
1528
  - version
1529
+ RequestDescription:
1530
+ description: Description that is included in a request to create a DRO. This is the same as a Description, except excludes PURL.
1531
+ type: object
1532
+ additionalProperties: false
1533
+ properties:
1534
+ title:
1535
+ description: Titles of the resource.
1536
+ type: array
1537
+ minItems: 1
1538
+ items:
1539
+ $ref: "#/components/schemas/Title"
1540
+ contributor:
1541
+ description: Agents contributing in some way to the creation and history of the
1542
+ resource.
1543
+ type: array
1544
+ items:
1545
+ $ref: "#/components/schemas/Contributor"
1546
+ event:
1547
+ description: Events in the history of the resource.
1548
+ type: array
1549
+ items:
1550
+ $ref: "#/components/schemas/Event"
1551
+ form:
1552
+ description: Characteristics of the resource's physical, digital, and intellectual
1553
+ form and genre, and of its process of creation.
1554
+ type: array
1555
+ items:
1556
+ $ref: "#/components/schemas/DescriptiveValue"
1557
+ geographic:
1558
+ description: Geographic description for items with coordinates or bounding boxes.
1559
+ type: array
1560
+ items:
1561
+ $ref: "#/components/schemas/DescriptiveGeographicMetadata"
1562
+ language:
1563
+ description: Languages, scripts, symbolic systems, and notations used in all or
1564
+ part of a resource.
1565
+ type: array
1566
+ items:
1567
+ $ref: "#/components/schemas/Language"
1568
+ note:
1569
+ description: Additional information relevant to a resource.
1570
+ type: array
1571
+ items:
1572
+ $ref: "#/components/schemas/DescriptiveValue"
1573
+ identifier:
1574
+ description: Identifiers and URIs associated with the resource.
1575
+ type: array
1576
+ items:
1577
+ $ref: "#/components/schemas/DescriptiveValue"
1578
+ subject:
1579
+ description: Terms associated with the intellectual content of the resource.
1580
+ type: array
1581
+ items:
1582
+ $ref: "#/components/schemas/DescriptiveValue"
1583
+ access:
1584
+ $ref: "#/components/schemas/DescriptiveAccessMetadata"
1585
+ relatedResource:
1586
+ description: Other resources associated with the described resource.
1587
+ type: array
1588
+ items:
1589
+ $ref: "#/components/schemas/RelatedResource"
1590
+ marcEncodedData:
1591
+ description: Data about the resource represented in MARC fixed fields and codes.
1592
+ type: array
1593
+ items:
1594
+ $ref: "#/components/schemas/DescriptiveValue"
1595
+ adminMetadata:
1596
+ $ref: "#/components/schemas/DescriptiveAdminMetadata"
1597
+ valueAt:
1598
+ description: URL or other pointer to the location of the resource description.
1599
+ type: string
1600
+ required:
1601
+ - title
1559
1602
  RequestDRO:
1560
1603
  description: A request to create a DRO. This has the same general structure as a DRO but doesn't have externalIdentifier and doesn't require the access subschema. If no access subschema is provided, these values will be inherited from the AdminPolicy.
1561
1604
  type: object
1562
1605
  additionalProperties: false
1563
1606
  properties:
1607
+ cocinaVersion:
1608
+ $ref: '#/components/schemas/CocinaVersion'
1564
1609
  type:
1565
1610
  type: string
1566
1611
  enum:
@@ -1588,7 +1633,7 @@ components:
1588
1633
  administrative:
1589
1634
  $ref: '#/components/schemas/Administrative'
1590
1635
  description:
1591
- $ref: '#/components/schemas/Description'
1636
+ $ref: '#/components/schemas/RequestDescription'
1592
1637
  identification:
1593
1638
  $ref: '#/components/schemas/RequestIdentification'
1594
1639
  structural:
@@ -1596,6 +1641,7 @@ components:
1596
1641
  geographic:
1597
1642
  $ref: '#/components/schemas/Geographic'
1598
1643
  required:
1644
+ - cocinaVersion
1599
1645
  - administrative
1600
1646
  - identification
1601
1647
  - label
@@ -1619,8 +1665,6 @@ components:
1619
1665
  type: array
1620
1666
  items:
1621
1667
  $ref: '#/components/schemas/Druid'
1622
- hasAgreement:
1623
- type: string
1624
1668
  RequestFile:
1625
1669
  type: object
1626
1670
  additionalProperties: false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.62.1
4
+ version: 0.65.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-12-16 00:00:00.000000000 Z
11
+ date: 2022-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -170,42 +170,56 @@ dependencies:
170
170
  requirements:
171
171
  - - "~>"
172
172
  - !ruby/object:Gem::Version
173
- version: '0.93'
173
+ version: '1.24'
174
174
  type: :development
175
175
  prerelease: false
176
176
  version_requirements: !ruby/object:Gem::Requirement
177
177
  requirements:
178
178
  - - "~>"
179
179
  - !ruby/object:Gem::Version
180
- version: '0.93'
180
+ version: '1.24'
181
+ - !ruby/object:Gem::Dependency
182
+ name: rubocop-rake
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :development
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
181
195
  - !ruby/object:Gem::Dependency
182
196
  name: rubocop-rspec
183
197
  requirement: !ruby/object:Gem::Requirement
184
198
  requirements:
185
199
  - - "~>"
186
200
  - !ruby/object:Gem::Version
187
- version: '1.44'
201
+ version: '2.1'
188
202
  type: :development
189
203
  prerelease: false
190
204
  version_requirements: !ruby/object:Gem::Requirement
191
205
  requirements:
192
206
  - - "~>"
193
207
  - !ruby/object:Gem::Version
194
- version: '1.44'
208
+ version: '2.1'
195
209
  - !ruby/object:Gem::Dependency
196
210
  name: simplecov
197
211
  requirement: !ruby/object:Gem::Requirement
198
212
  requirements:
199
- - - "~>"
213
+ - - ">="
200
214
  - !ruby/object:Gem::Version
201
- version: 0.17.0
215
+ version: '0'
202
216
  type: :development
203
217
  prerelease: false
204
218
  version_requirements: !ruby/object:Gem::Requirement
205
219
  requirements:
206
- - - "~>"
220
+ - - ">="
207
221
  - !ruby/object:Gem::Version
208
- version: 0.17.0
222
+ version: '0'
209
223
  description: SDR data models that can be validated
210
224
  email:
211
225
  - jcoyne@justincoyne.com
@@ -266,6 +280,7 @@ files:
266
280
  - lib/cocina/models/catkey_barcode.rb
267
281
  - lib/cocina/models/checkable.rb
268
282
  - lib/cocina/models/citation_only_access.rb
283
+ - lib/cocina/models/cocina_version.rb
269
284
  - lib/cocina/models/collection.rb
270
285
  - lib/cocina/models/collection_access.rb
271
286
  - lib/cocina/models/collection_identification.rb
@@ -309,6 +324,7 @@ files:
309
324
  - lib/cocina/models/release_tag.rb
310
325
  - lib/cocina/models/request_admin_policy.rb
311
326
  - lib/cocina/models/request_collection.rb
327
+ - lib/cocina/models/request_description.rb
312
328
  - lib/cocina/models/request_dro.rb
313
329
  - lib/cocina/models/request_dro_structural.rb
314
330
  - lib/cocina/models/request_file.rb
@@ -329,7 +345,8 @@ files:
329
345
  - openapi.yml
330
346
  homepage: https://github.com/sul-dlss/cocina-models
331
347
  licenses: []
332
- metadata: {}
348
+ metadata:
349
+ rubygems_mfa_required: 'true'
333
350
  post_install_message:
334
351
  rdoc_options: []
335
352
  require_paths:
@@ -338,14 +355,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
338
355
  requirements:
339
356
  - - ">="
340
357
  - !ruby/object:Gem::Version
341
- version: '2.5'
358
+ version: '2.7'
342
359
  required_rubygems_version: !ruby/object:Gem::Requirement
343
360
  requirements:
344
361
  - - ">="
345
362
  - !ruby/object:Gem::Version
346
363
  version: '0'
347
364
  requirements: []
348
- rubygems_version: 3.1.4
365
+ rubygems_version: 3.2.32
349
366
  signing_key:
350
367
  specification_version: 4
351
368
  summary: Data models for the SDR