cocina-models 0.63.0 → 0.65.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. checksums.yaml +4 -4
  2. data/docs/maps/Collection.json +0 -5
  3. data/docs/maps/DRO.json +0 -5
  4. data/lib/cocina/generator/schema_array.rb +1 -1
  5. data/lib/cocina/generator/schema_value.rb +4 -0
  6. data/lib/cocina/models/access_role.rb +1 -1
  7. data/lib/cocina/models/admin_policy.rb +3 -0
  8. data/lib/cocina/models/admin_policy_administrative.rb +4 -4
  9. data/lib/cocina/models/administrative.rb +1 -1
  10. data/lib/cocina/models/applies_to.rb +1 -1
  11. data/lib/cocina/models/cocina_version.rb +9 -0
  12. data/lib/cocina/models/collection.rb +3 -0
  13. data/lib/cocina/models/collection_identification.rb +1 -1
  14. data/lib/cocina/models/contributor.rb +5 -5
  15. data/lib/cocina/models/description.rb +13 -13
  16. data/lib/cocina/models/descriptive_access_metadata.rb +6 -6
  17. data/lib/cocina/models/descriptive_admin_metadata.rb +6 -6
  18. data/lib/cocina/models/descriptive_basic_value.rb +5 -5
  19. data/lib/cocina/models/descriptive_geographic_metadata.rb +2 -2
  20. data/lib/cocina/models/descriptive_grouped_value.rb +1 -1
  21. data/lib/cocina/models/descriptive_parallel_contributor.rb +4 -4
  22. data/lib/cocina/models/descriptive_parallel_event.rb +6 -6
  23. data/lib/cocina/models/descriptive_parallel_value.rb +1 -1
  24. data/lib/cocina/models/descriptive_structured_value.rb +1 -1
  25. data/lib/cocina/models/descriptive_value.rb +6 -6
  26. data/lib/cocina/models/descriptive_value_language.rb +1 -1
  27. data/lib/cocina/models/dro.rb +3 -0
  28. data/lib/cocina/models/dro_access.rb +1 -1
  29. data/lib/cocina/models/dro_structural.rb +3 -5
  30. data/lib/cocina/models/event.rb +7 -7
  31. data/lib/cocina/models/file.rb +1 -1
  32. data/lib/cocina/models/file_set_structural.rb +1 -1
  33. data/lib/cocina/models/identification.rb +1 -1
  34. data/lib/cocina/models/language.rb +5 -5
  35. data/lib/cocina/models/related_resource.rb +9 -9
  36. data/lib/cocina/models/request_admin_policy.rb +4 -1
  37. data/lib/cocina/models/request_collection.rb +4 -1
  38. data/lib/cocina/models/request_description.rb +28 -0
  39. data/lib/cocina/models/request_dro.rb +4 -1
  40. data/lib/cocina/models/request_dro_structural.rb +3 -4
  41. data/lib/cocina/models/request_file.rb +1 -1
  42. data/lib/cocina/models/request_file_set_structural.rb +1 -1
  43. data/lib/cocina/models/request_identification.rb +1 -1
  44. data/lib/cocina/models/sequence.rb +1 -1
  45. data/lib/cocina/models/source.rb +1 -1
  46. data/lib/cocina/models/standard.rb +1 -1
  47. data/lib/cocina/models/title.rb +6 -6
  48. data/lib/cocina/models/validator.rb +21 -1
  49. data/lib/cocina/models/version.rb +1 -1
  50. data/openapi.yml +124 -80
  51. metadata +5 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 147f3cdbe82ab61d39648503137c0a59bae31349064e891d7deaf096622a0d47
4
- data.tar.gz: 763af02786783bf5066bb8c33c0cd4680e6049ff8a48977782cac1d74c84e27f
3
+ metadata.gz: 896e1abaec6ec5cd04b1d3279e30723f0308ee96131656f8197a522fd910ff34
4
+ data.tar.gz: e01d1e2ca3455bacd76c8fd95f4a07b2444983a356e338d03950fc4025acd40c
5
5
  SHA512:
6
- metadata.gz: e6b8e5144e42624206ab642bde2960ca1eaaf1a91f0ea064934091bce6f729167c971f73387fa184e5c9a817babcfef359421317ce283d46922c043f2865b0e0
7
- data.tar.gz: 8dfc5f0a06e81bdf4c27e4f1bd67a3ef3bd9380da4394976aea891df75e1be8c65147abb9921e3029100d7682b85ed54facae8362b61f77088af037022af74c0
6
+ metadata.gz: b82cf62f83fe5d2854fb618df552e487476be6ebc0d0926978e56de62cfae9df9d19eeaceddf506eeb99e84037d4561353563a83a1b93e11ca1feebbe377c2ac
7
+ data.tar.gz: 2b479b5e1a73da2e3df558d515d403862312d81b5feb5faf62f1931065b6b074a80961a0a8b8c5492b505482f3adbe3d64f850c96d68c3a296faccf6ce3d6627
@@ -215,12 +215,7 @@
215
215
  "structural": {
216
216
  "description": "Structural metadata for the Collection.",
217
217
  "type": "object",
218
- "required": ["hasAgreement"],
219
218
  "properties": {
220
- "hasAgreement": {
221
- "description": "Agreement that covers the deposit of the Collection into SDR.",
222
- "type": "string"
223
- },
224
219
  "hasMember": {
225
220
  "description": "Component digital repository objects or collections that are a part of this collection.",
226
221
  "type": "array",
data/docs/maps/DRO.json CHANGED
@@ -277,7 +277,6 @@
277
277
  "structural": {
278
278
  "description": "Structural metadata for the DRO.",
279
279
  "type": "object",
280
- "required": ["hasAgreement"],
281
280
  "properties": {
282
281
  "contains": {
283
282
  "description": "Filesets that contain the digital representations (Files) of the DRO.",
@@ -286,10 +285,6 @@
286
285
  "$ref": "/Fileset"
287
286
  }
288
287
  },
289
- "hasAgreement": {
290
- "description": "Agreement that covers the deposit of the DRO into SDR.",
291
- "type": "string"
292
- },
293
288
  "hasMember": {
294
289
  "description": "Component or 'children' digital repository objects that are a part or portion of this 'parent' or aggregate DRO.",
295
290
  "type": "array",
@@ -5,7 +5,7 @@ module Cocina
5
5
  # Class for generating from an openapi array
6
6
  class SchemaArray < SchemaBase
7
7
  def generate
8
- "attribute :#{name.camelize(:lower)}, Types::Strict::Array.of(#{array_of_type}).default([])"
8
+ "attribute :#{name.camelize(:lower)}, Types::Strict::Array.of(#{array_of_type}).default([].freeze)"
9
9
  end
10
10
 
11
11
  def array_of_type
@@ -26,10 +26,14 @@ module Cocina
26
26
  end
27
27
 
28
28
  def default
29
+ # Provide version as default for cocinaVersion
30
+ return '.default(Cocina::Models::VERSION)' if name == 'cocinaVersion'
31
+
29
32
  # If type is boolean and default is false, erroneously getting a nil.
30
33
  # Assuming that if required, then default is false.
31
34
  default = schema_doc.default
32
35
  default = false if default.nil? && schema_doc.type == 'boolean' && required
36
+
33
37
  return '' if default.nil?
34
38
 
35
39
  ".default(#{quote(default)})"
@@ -5,7 +5,7 @@ module Cocina
5
5
  class AccessRole < Struct
6
6
  # Name of role
7
7
  attribute :name, Types::Strict::String.enum('dor-apo-creator', 'dor-apo-depositor', 'dor-apo-manager', 'dor-apo-metadata', 'dor-apo-reviewer', 'dor-apo-viewer', 'sdr-administrator', 'sdr-viewer', 'hydrus-collection-creator', 'hydrus-collection-manager', 'hydrus-collection-depositor', 'hydrus-collection-item-depositor', 'hydrus-collection-reviewer', 'hydrus-collection-viewer')
8
- attribute :members, Types::Strict::Array.of(AccessRoleMember).default([])
8
+ attribute :members, Types::Strict::Array.of(AccessRoleMember).default([].freeze)
9
9
  end
10
10
  end
11
11
  end
@@ -7,6 +7,9 @@ module Cocina
7
7
 
8
8
  TYPES = ['http://cocina.sul.stanford.edu/models/admin_policy.jsonld'].freeze
9
9
 
10
+ # The version of Cocina with which this object conforms.
11
+ # example: 1.2.3
12
+ attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
10
13
  attribute :type, Types::Strict::String.enum(*AdminPolicy::TYPES)
11
14
  # example: druid:bc123df4567
12
15
  attribute :externalIdentifier, Types::Strict::String
@@ -6,16 +6,16 @@ module Cocina
6
6
  # This is an XML expression of the default access (see defaultAccess)
7
7
  attribute :defaultObjectRights, Types::Strict::String.default('<?xml version="1.0" encoding="UTF-8"?><rightsMetadata><access type="discover"><machine><world/></machine></access><access type="read"><machine><world/></machine></access><use><human type="useAndReproduction"/><human type="creativeCommons"/><machine type="creativeCommons" uri=""/><human type="openDataCommons"/><machine type="openDataCommons" uri=""/></use><copyright><human/></copyright></rightsMetadata>').meta(omittable: true)
8
8
  attribute :defaultAccess, AdminPolicyDefaultAccess.optional.meta(omittable: true)
9
- attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).default([])
9
+ attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).default([].freeze)
10
10
  # An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete
11
11
  # example: wasCrawlPreassemblyWF
12
12
  attribute :disseminationWorkflow, Types::Strict::String.meta(omittable: true)
13
- attribute :collectionsForRegistration, Types::Strict::Array.of(Types::Strict::String).default([])
13
+ attribute :collectionsForRegistration, Types::Strict::Array.of(Types::Strict::String).default([].freeze)
14
14
  # example: druid:bc123df4567
15
15
  attribute :hasAdminPolicy, Types::Strict::String
16
16
  # example: druid:bc123df4567
17
- attribute :referencesAgreement, Types::Strict::String.meta(omittable: true)
18
- attribute :roles, Types::Strict::Array.of(AccessRole).default([])
17
+ attribute :hasAgreement, Types::Strict::String
18
+ attribute :roles, Types::Strict::Array.of(AccessRole).default([].freeze)
19
19
  end
20
20
  end
21
21
  end
@@ -5,7 +5,7 @@ module Cocina
5
5
  class Administrative < Struct
6
6
  # example: druid:bc123df4567
7
7
  attribute :hasAdminPolicy, Types::Strict::String
8
- attribute :releaseTags, Types::Strict::Array.of(ReleaseTag).default([])
8
+ attribute :releaseTags, Types::Strict::Array.of(ReleaseTag).default([].freeze)
9
9
  # Administrative or Internal project this resource is a part of
10
10
  # example: Google Books
11
11
  attribute :partOfProject, Types::Strict::String.meta(omittable: true)
@@ -3,7 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class AppliesTo < Struct
6
- attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([])
6
+ attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([].freeze)
7
7
  end
8
8
  end
9
9
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ CocinaVersion = Types::String.constrained(
6
+ format: /^\d+\.\d+\.\d+$/i
7
+ )
8
+ end
9
+ end
@@ -11,6 +11,9 @@ module Cocina
11
11
  'http://cocina.sul.stanford.edu/models/exhibit.jsonld',
12
12
  'http://cocina.sul.stanford.edu/models/series.jsonld'].freeze
13
13
 
14
+ # The version of Cocina with which this object conforms.
15
+ # example: 1.2.3
16
+ attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
14
17
  # The content type of the Collection. Selected from an established set of values.
15
18
  attribute :type, Types::Strict::String.enum(*Collection::TYPES)
16
19
  # example: druid:bc123df4567
@@ -3,7 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class CollectionIdentification < Struct
6
- attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).default([])
6
+ attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).default([].freeze)
7
7
  # Unique identifier in some other system. This is because a large proportion of what is deposited in SDR, historically and currently, are representations of objects that are also represented in other systems. For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to look for the original item if you're looking at its SDR representation. The format is: "namespace:identifier"
8
8
 
9
9
  # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
@@ -3,17 +3,17 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Contributor < Struct
6
- attribute :name, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :name, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
7
  # Entity type of the contributor (person, organization, etc.).
8
8
  attribute :type, Types::Strict::String.meta(omittable: true)
9
9
  # Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
10
10
  attribute :status, Types::Strict::String.meta(omittable: true)
11
- attribute :role, Types::Strict::Array.of(DescriptiveValue).default([])
12
- attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([])
13
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
11
+ attribute :role, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
12
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
13
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
14
14
  # URL or other pointer to the location of the contributor information.
15
15
  attribute :valueAt, Types::Strict::String.meta(omittable: true)
16
- attribute :parallelContributor, Types::Strict::Array.of(DescriptiveParallelContributor).default([])
16
+ attribute :parallelContributor, Types::Strict::Array.of(DescriptiveParallelContributor).default([].freeze)
17
17
  end
18
18
  end
19
19
  end
@@ -3,23 +3,23 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Description < Struct
6
- attribute :title, Types::Strict::Array.of(Title).default([])
7
- attribute :contributor, Types::Strict::Array.of(Contributor).default([])
8
- attribute :event, Types::Strict::Array.of(Event).default([])
9
- attribute :form, Types::Strict::Array.of(DescriptiveValue).default([])
10
- attribute :geographic, Types::Strict::Array.of(DescriptiveGeographicMetadata).default([])
11
- attribute :language, Types::Strict::Array.of(Language).default([])
12
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
13
- attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([])
14
- attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([])
15
- # Stanford persistent URL associated with the related resource. Note this is http, not https.
16
- attribute :purl, Types::Strict::String.meta(omittable: true)
6
+ attribute :title, Types::Strict::Array.of(Title).default([].freeze)
7
+ attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
8
+ attribute :event, Types::Strict::Array.of(Event).default([].freeze)
9
+ attribute :form, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
10
+ attribute :geographic, Types::Strict::Array.of(DescriptiveGeographicMetadata).default([].freeze)
11
+ attribute :language, Types::Strict::Array.of(Language).default([].freeze)
12
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
13
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
14
+ attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
17
15
  attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
18
- attribute :relatedResource, Types::Strict::Array.of(RelatedResource).default([])
19
- attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).default([])
16
+ attribute :relatedResource, Types::Strict::Array.of(RelatedResource).default([].freeze)
17
+ attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
20
18
  attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
21
19
  # URL or other pointer to the location of the resource description.
22
20
  attribute :valueAt, Types::Strict::String.meta(omittable: true)
21
+ # Stanford persistent URL associated with the related resource. Note this is http, not https.
22
+ attribute :purl, Types::Strict::String
23
23
 
24
24
  def self.new(attributes = default_attributes, safe = false, validate = true, &block)
25
25
  Validator.validate(self, attributes.with_indifferent_access) if validate && name
@@ -3,12 +3,12 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveAccessMetadata < Struct
6
- attribute :url, Types::Strict::Array.of(DescriptiveValue).default([])
7
- attribute :physicalLocation, Types::Strict::Array.of(DescriptiveValue).default([])
8
- attribute :digitalLocation, Types::Strict::Array.of(DescriptiveValue).default([])
9
- attribute :accessContact, Types::Strict::Array.of(DescriptiveValue).default([])
10
- attribute :digitalRepository, Types::Strict::Array.of(DescriptiveValue).default([])
11
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :url, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
+ attribute :physicalLocation, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
8
+ attribute :digitalLocation, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
9
+ attribute :accessContact, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
10
+ attribute :digitalRepository, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
11
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
12
12
  end
13
13
  end
14
14
  end
@@ -3,12 +3,12 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveAdminMetadata < Struct
6
- attribute :contributor, Types::Strict::Array.of(Contributor).default([])
7
- attribute :event, Types::Strict::Array.of(Event).default([])
8
- attribute :language, Types::Strict::Array.of(Language).default([])
9
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
10
- attribute :metadataStandard, Types::Strict::Array.of(Standard).default([])
11
- attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
7
+ attribute :event, Types::Strict::Array.of(Event).default([].freeze)
8
+ attribute :language, Types::Strict::Array.of(Language).default([].freeze)
9
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
10
+ attribute :metadataStandard, Types::Strict::Array.of(Standard).default([].freeze)
11
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
12
12
  end
13
13
  end
14
14
  end
@@ -3,9 +3,9 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveBasicValue < Struct
6
- attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([])
7
- attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([])
8
- attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
+ attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
8
+ attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
9
9
  # String or integer value of the descriptive element.
10
10
  attribute :value, Types::Nominal::Any.meta(omittable: true)
11
11
  # Type of value provided by the descriptive element.
@@ -18,13 +18,13 @@ module Cocina
18
18
  attribute :uri, Types::Strict::String.meta(omittable: true)
19
19
  attribute :standard, Standard.optional.meta(omittable: true)
20
20
  attribute :encoding, Standard.optional.meta(omittable: true)
21
- attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([])
21
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
22
22
  attribute :source, Source.optional.meta(omittable: true)
23
23
  # The preferred display label to use for the descriptive element in access systems.
24
24
  attribute :displayLabel, Types::Strict::String.meta(omittable: true)
25
25
  # A term providing information about the circumstances of the statement (e.g., approximate dates).
26
26
  attribute :qualifier, Types::Strict::String.meta(omittable: true)
27
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
27
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
28
28
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
29
29
  # URL or other pointer to the location of the value of the descriptive element.
30
30
  attribute :valueAt, Types::Strict::String.meta(omittable: true)
@@ -3,8 +3,8 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveGeographicMetadata < Struct
6
- attribute :form, Types::Strict::Array.of(DescriptiveValue).default([])
7
- attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :form, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
+ attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
8
8
  end
9
9
  end
10
10
  end
@@ -3,7 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveGroupedValue < Struct
6
- attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
7
  end
8
8
  end
9
9
  end
@@ -3,14 +3,14 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveParallelContributor < Struct
6
- attribute :name, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :name, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
7
  # Entity type of the contributor (person, organization, etc.).
8
8
  attribute :type, Types::Strict::String.meta(omittable: true)
9
9
  # Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
10
10
  attribute :status, Types::Strict::String.meta(omittable: true)
11
- attribute :role, Types::Strict::Array.of(DescriptiveValue).default([])
12
- attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([])
13
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
11
+ attribute :role, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
12
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
13
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
14
14
  # URL or other pointer to the location of the contributor information.
15
15
  attribute :valueAt, Types::Strict::String.meta(omittable: true)
16
16
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
@@ -3,16 +3,16 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveParallelEvent < Struct
6
- attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
7
  # Description of the event (creation, publication, etc.).
8
8
  attribute :type, Types::Strict::String.meta(omittable: true)
9
9
  # The preferred display label to use for the event in access systems.
10
10
  attribute :displayLabel, Types::Strict::String.meta(omittable: true)
11
- attribute :date, Types::Strict::Array.of(DescriptiveValue).default([])
12
- attribute :contributor, Types::Strict::Array.of(Contributor).default([])
13
- attribute :location, Types::Strict::Array.of(DescriptiveValue).default([])
14
- attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([])
15
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
11
+ attribute :date, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
12
+ attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
13
+ attribute :location, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
14
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
15
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
16
16
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
17
17
  end
18
18
  end
@@ -3,7 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveParallelValue < Struct
6
- attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
7
  end
8
8
  end
9
9
  end
@@ -3,7 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveStructuredValue < Struct
6
- attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
7
  end
8
8
  end
9
9
  end
@@ -3,9 +3,9 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveValue < Struct
6
- attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([])
7
- attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([])
8
- attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
+ attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
8
+ attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
9
9
  # String or integer value of the descriptive element.
10
10
  attribute :value, Types::Nominal::Any.meta(omittable: true)
11
11
  # Type of value provided by the descriptive element.
@@ -18,17 +18,17 @@ module Cocina
18
18
  attribute :uri, Types::Strict::String.meta(omittable: true)
19
19
  attribute :standard, Standard.optional.meta(omittable: true)
20
20
  attribute :encoding, Standard.optional.meta(omittable: true)
21
- attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([])
21
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
22
22
  attribute :source, Source.optional.meta(omittable: true)
23
23
  # The preferred display label to use for the descriptive element in access systems.
24
24
  attribute :displayLabel, Types::Strict::String.meta(omittable: true)
25
25
  # A term providing information about the circumstances of the statement (e.g., approximate dates).
26
26
  attribute :qualifier, Types::Strict::String.meta(omittable: true)
27
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
27
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
28
28
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
29
29
  # URL or other pointer to the location of the value of the descriptive element.
30
30
  attribute :valueAt, Types::Strict::String.meta(omittable: true)
31
- attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([])
31
+ attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([].freeze)
32
32
  end
33
33
  end
34
34
  end
@@ -9,7 +9,7 @@ module Cocina
9
9
  attribute :uri, Types::Strict::String.meta(omittable: true)
10
10
  # String describing the standard or encoding.
11
11
  attribute :value, Types::Strict::String.meta(omittable: true)
12
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
12
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
13
13
  # The version of the standard or encoding.
14
14
  attribute :version, Types::Strict::String.meta(omittable: true)
15
15
  attribute :source, Source.optional.meta(omittable: true)
@@ -21,6 +21,9 @@ module Cocina
21
21
  'http://cocina.sul.stanford.edu/models/webarchive-binary.jsonld',
22
22
  'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'].freeze
23
23
 
24
+ # The version of Cocina with which this object conforms.
25
+ # example: 1.2.3
26
+ attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
24
27
  # The content type of the DRO. Selected from an established set of values.
25
28
  attribute :type, Types::Strict::String.enum(*DRO::TYPES)
26
29
  # example: druid:bc123df4567
@@ -22,7 +22,7 @@ module Cocina
22
22
  # example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
23
23
  attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
24
24
  # The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
25
- attribute :license, Types::Strict::String.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'http://cocina.sul.stanford.edu/licenses/none').meta(omittable: true)
25
+ attribute :license, Types::Strict::String.optional.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'http://cocina.sul.stanford.edu/licenses/none').meta(omittable: true)
26
26
  end
27
27
  end
28
28
  end
@@ -3,11 +3,9 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DROStructural < Struct
6
- attribute :contains, Types::Strict::Array.of(FileSet).default([])
7
- attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).default([])
8
- attribute :isMemberOf, Types::Strict::Array.of(Druid).default([])
9
- # Agreement that covers the deposit of the DRO into SDR.
10
- attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
6
+ attribute :contains, Types::Strict::Array.of(FileSet).default([].freeze)
7
+ attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).default([].freeze)
8
+ attribute :isMemberOf, Types::Strict::Array.of(Druid).default([].freeze)
11
9
  end
12
10
  end
13
11
  end
@@ -3,18 +3,18 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Event < Struct
6
- attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([])
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
7
7
  # Description of the event (creation, publication, etc.).
8
8
  attribute :type, Types::Strict::String.meta(omittable: true)
9
9
  # The preferred display label to use for the event in access systems.
10
10
  attribute :displayLabel, Types::Strict::String.meta(omittable: true)
11
- attribute :date, Types::Strict::Array.of(DescriptiveValue).default([])
12
- attribute :contributor, Types::Strict::Array.of(Contributor).default([])
13
- attribute :location, Types::Strict::Array.of(DescriptiveValue).default([])
14
- attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([])
15
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
11
+ attribute :date, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
12
+ attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
13
+ attribute :location, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
14
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
15
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
16
16
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
17
- attribute :parallelEvent, Types::Strict::Array.of(DescriptiveParallelEvent).default([])
17
+ attribute :parallelEvent, Types::Strict::Array.of(DescriptiveParallelEvent).default([].freeze)
18
18
  end
19
19
  end
20
20
  end
@@ -23,7 +23,7 @@ module Cocina
23
23
  attribute :hasMimeType, Types::Strict::String.meta(omittable: true)
24
24
  # Use for the File.
25
25
  attribute :use, Types::Strict::String.meta(omittable: true)
26
- attribute :hasMessageDigests, Types::Strict::Array.of(MessageDigest).default([])
26
+ attribute :hasMessageDigests, Types::Strict::Array.of(MessageDigest).default([].freeze)
27
27
  attribute(:access, FileAccess.default { FileAccess.new })
28
28
  attribute(:administrative, FileAdministrative.default { FileAdministrative.new })
29
29
  attribute :presentation, Presentation.optional.meta(omittable: true)
@@ -3,7 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class FileSetStructural < Struct
6
- attribute :contains, Types::Strict::Array.of(File).default([])
6
+ attribute :contains, Types::Strict::Array.of(File).default([].freeze)
7
7
  end
8
8
  end
9
9
  end
@@ -5,7 +5,7 @@ module Cocina
5
5
  class Identification < Struct
6
6
  # A barcode
7
7
  attribute :barcode, Types::Nominal::Any.meta(omittable: true)
8
- attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).default([])
8
+ attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).default([].freeze)
9
9
  # Digital Object Identifier (https://www.doi.org)
10
10
  # example: 10.25740/bc123df4567
11
11
  attribute :doi, Types::Strict::String.meta(omittable: true)
@@ -3,15 +3,15 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Language < Struct
6
- attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([])
6
+ attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([].freeze)
7
7
  # Code value of the descriptive element.
8
8
  attribute :code, Types::Strict::String.meta(omittable: true)
9
9
  # The preferred display label to use for the descriptive element in access systems.
10
10
  attribute :displayLabel, Types::Strict::String.meta(omittable: true)
11
11
  attribute :encoding, Standard.optional.meta(omittable: true)
12
- attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([])
13
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
14
- attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([])
12
+ attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
13
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
14
+ attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
15
15
  # present for mapping to additional schemas in the future and for consistency but not otherwise used
16
16
  attribute :qualifier, Types::Strict::String.meta(omittable: true)
17
17
  attribute :script, DescriptiveValue.optional.meta(omittable: true)
@@ -19,7 +19,7 @@ module Cocina
19
19
  # Status of the language relative to other parallel language elements (e.g. the primary language)
20
20
  attribute :status, Types::Strict::String.enum('primary').meta(omittable: true)
21
21
  attribute :standard, Standard.optional.meta(omittable: true)
22
- attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([])
22
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
23
23
  # URI value of the descriptive element.
24
24
  attribute :uri, Types::Strict::String.meta(omittable: true)
25
25
  # Value of the descriptive element.
@@ -9,19 +9,19 @@ module Cocina
9
9
  attribute :status, Types::Strict::String.meta(omittable: true)
10
10
  # The preferred display label to use for the related resource in access systems.
11
11
  attribute :displayLabel, Types::Strict::String.meta(omittable: true)
12
- attribute :title, Types::Strict::Array.of(DescriptiveValue).default([])
13
- attribute :contributor, Types::Strict::Array.of(Contributor).default([])
14
- attribute :event, Types::Strict::Array.of(Event).default([])
15
- attribute :form, Types::Strict::Array.of(DescriptiveValue).default([])
16
- attribute :language, Types::Strict::Array.of(Language).default([])
17
- attribute :note, Types::Strict::Array.of(DescriptiveValue).default([])
18
- attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([])
12
+ attribute :title, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
13
+ attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
14
+ attribute :event, Types::Strict::Array.of(Event).default([].freeze)
15
+ attribute :form, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
16
+ attribute :language, Types::Strict::Array.of(Language).default([].freeze)
17
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
18
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
19
19
  attribute :standard, Standard.optional.meta(omittable: true)
20
- attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([])
20
+ attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
21
21
  # Stanford persistent URL associated with the related resource. Note this is http, not https.
22
22
  attribute :purl, Types::Strict::String.meta(omittable: true)
23
23
  attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
24
- attribute :relatedResource, Types::Strict::Array.of(RelatedResource).default([])
24
+ attribute :relatedResource, Types::Strict::Array.of(RelatedResource).default([].freeze)
25
25
  attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
26
26
  # The version of the related resource.
27
27
  attribute :version, Types::Strict::String.meta(omittable: true)
@@ -7,11 +7,14 @@ module Cocina
7
7
 
8
8
  TYPES = ['http://cocina.sul.stanford.edu/models/admin_policy.jsonld'].freeze
9
9
 
10
+ # The version of Cocina with which this object conforms.
11
+ # example: 1.2.3
12
+ attribute :cocinaVersion, Types::Strict::String.default(Cocina::Models::VERSION)
10
13
  attribute :type, Types::Strict::String.enum(*RequestAdminPolicy::TYPES)
11
14
  attribute :label, Types::Strict::String
12
15
  attribute :version, Types::Strict::Integer
13
16
  attribute(:administrative, AdminPolicyAdministrative.default { AdminPolicyAdministrative.new })
14
- attribute :description, Description.optional.meta(omittable: true)
17
+ attribute :description, RequestDescription.optional.meta(omittable: true)
15
18
 
16
19
  def self.new(attributes = default_attributes, safe = false, validate = true, &block)
17
20
  Validator.validate(self, attributes.with_indifferent_access) if validate && name