cocina-models 0.107.1 → 0.108.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 (91) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/Gemfile +1 -1
  4. data/Gemfile.lock +33 -11
  5. data/lib/cocina/generator/datatype.rb +1 -1
  6. data/lib/cocina/generator/generator.rb +1 -0
  7. data/lib/cocina/generator/schema_array.rb +1 -1
  8. data/lib/cocina/generator/schema_base.rb +10 -2
  9. data/lib/cocina/generator/schema_ref.rb +2 -2
  10. data/lib/cocina/generator/union_type.rb +1 -1
  11. data/lib/cocina/generator/vocab.rb +6 -5
  12. data/lib/cocina/models/access_role.rb +1 -0
  13. data/lib/cocina/models/admin_policy.rb +1 -0
  14. data/lib/cocina/models/admin_policy_access_template.rb +9 -3
  15. data/lib/cocina/models/admin_policy_administrative.rb +10 -1
  16. data/lib/cocina/models/admin_policy_lite.rb +3 -0
  17. data/lib/cocina/models/admin_policy_with_metadata.rb +1 -0
  18. data/lib/cocina/models/applies_to.rb +2 -1
  19. data/lib/cocina/models/barcode.rb +1 -0
  20. data/lib/cocina/models/business_barcode.rb +2 -0
  21. data/lib/cocina/models/catalog_link.rb +1 -0
  22. data/lib/cocina/models/catkey_barcode.rb +3 -0
  23. data/lib/cocina/models/citation_only_access.rb +2 -1
  24. data/lib/cocina/models/cocina_version.rb +2 -0
  25. data/lib/cocina/models/collection.rb +3 -1
  26. data/lib/cocina/models/collection_access.rb +6 -2
  27. data/lib/cocina/models/collection_identification.rb +8 -1
  28. data/lib/cocina/models/collection_lite.rb +7 -1
  29. data/lib/cocina/models/collection_with_metadata.rb +1 -0
  30. data/lib/cocina/models/contributor.rb +13 -3
  31. data/lib/cocina/models/copyright.rb +2 -0
  32. data/lib/cocina/models/created_in_folio_identifier.rb +2 -0
  33. data/lib/cocina/models/description.rb +14 -0
  34. data/lib/cocina/models/descriptive_access_metadata.rb +7 -0
  35. data/lib/cocina/models/descriptive_admin_metadata.rb +6 -0
  36. data/lib/cocina/models/descriptive_basic_value.rb +15 -3
  37. data/lib/cocina/models/descriptive_geographic_metadata.rb +1 -0
  38. data/lib/cocina/models/descriptive_grouped_value.rb +2 -1
  39. data/lib/cocina/models/descriptive_parallel_contributor.rb +11 -3
  40. data/lib/cocina/models/descriptive_parallel_event.rb +8 -1
  41. data/lib/cocina/models/descriptive_parallel_value.rb +2 -1
  42. data/lib/cocina/models/descriptive_value.rb +13 -2
  43. data/lib/cocina/models/descriptive_value_language.rb +5 -0
  44. data/lib/cocina/models/doi.rb +2 -1
  45. data/lib/cocina/models/doi_exceptions.rb +6 -1
  46. data/lib/cocina/models/dro.rb +4 -1
  47. data/lib/cocina/models/dro_access.rb +6 -2
  48. data/lib/cocina/models/dro_lite.rb +10 -1
  49. data/lib/cocina/models/dro_structural.rb +4 -0
  50. data/lib/cocina/models/dro_with_metadata.rb +2 -0
  51. data/lib/cocina/models/druid.rb +1 -0
  52. data/lib/cocina/models/embargo.rb +4 -1
  53. data/lib/cocina/models/event.rb +8 -0
  54. data/lib/cocina/models/file.rb +8 -3
  55. data/lib/cocina/models/file_set.rb +1 -0
  56. data/lib/cocina/models/file_use.rb +1 -0
  57. data/lib/cocina/models/folio_catalog_link.rb +3 -1
  58. data/lib/cocina/models/identification.rb +8 -1
  59. data/lib/cocina/models/lane_medical_barcode.rb +2 -0
  60. data/lib/cocina/models/language.rb +22 -3
  61. data/lib/cocina/models/language_tag.rb +2 -0
  62. data/lib/cocina/models/libraries_doi.rb +11 -0
  63. data/lib/cocina/models/license.rb +2 -0
  64. data/lib/cocina/models/migrated_from_symphony_identifier.rb +2 -0
  65. data/lib/cocina/models/migrated_from_voyager_identifier.rb +2 -0
  66. data/lib/cocina/models/preregistered_repository_doi.rb +12 -0
  67. data/lib/cocina/models/purl.rb +1 -0
  68. data/lib/cocina/models/related_resource.rb +17 -1
  69. data/lib/cocina/models/repository_doi.rb +13 -0
  70. data/lib/cocina/models/request_admin_policy.rb +3 -0
  71. data/lib/cocina/models/request_administrative.rb +2 -1
  72. data/lib/cocina/models/request_collection.rb +3 -0
  73. data/lib/cocina/models/request_description.rb +16 -1
  74. data/lib/cocina/models/request_dro.rb +8 -1
  75. data/lib/cocina/models/request_dro_structural.rb +1 -0
  76. data/lib/cocina/models/request_file.rb +4 -1
  77. data/lib/cocina/models/request_file_set.rb +1 -0
  78. data/lib/cocina/models/request_identification.rb +8 -1
  79. data/lib/cocina/models/sequence.rb +1 -0
  80. data/lib/cocina/models/source.rb +3 -1
  81. data/lib/cocina/models/source_id.rb +10 -0
  82. data/lib/cocina/models/standard.rb +5 -1
  83. data/lib/cocina/models/standard_barcode.rb +2 -0
  84. data/lib/cocina/models/symphony_catalog_link.rb +3 -1
  85. data/lib/cocina/models/title.rb +13 -2
  86. data/lib/cocina/models/use_and_reproduction_statement.rb +5 -0
  87. data/lib/cocina/models/version.rb +1 -1
  88. data/lib/cocina/models.rb +5 -1
  89. data/openapi.yml +24 -13
  90. metadata +6 -4
  91. data/lib/cocina/models/doi_pattern.rb +0 -7
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3e982057b0f0017c03ce8809fa93494bd179b28a90e6ad3f32ad6859c4a8249c
4
- data.tar.gz: 4777322f4d9b18fa6d814b36974dbbbd9e79857a4ce5149a756ae737e82ca49c
3
+ metadata.gz: dd16339f9a675493e71e0ced334d9f5c265dd0ce0c712f7016f8fd0e4e5c4125
4
+ data.tar.gz: 03f80e5b956fd69a8dbf978469668f62bac2c70a9100f781d05d4c3d7f662f92
5
5
  SHA512:
6
- metadata.gz: c0c1136149b28c85dfa4c7a5e1aab4ee6829beecb2a04367db82a85f31a4a84aca774a3243fdbbfac34db1dca4d6f7624eaf399548db69a281c0e7059136d67a
7
- data.tar.gz: 0ba5d2b587e122a0ab1cd363fcc5c32e0fc3a3a26ae35621967bcb8e0eead73bc87d86f263520be8b6d831ca528f2e7e0a85138f545e31ff8381d90bd826971c
6
+ metadata.gz: c0f258871c023833f9d43443c2140e091671d18d1f4c65c12626e14308ee78c99baa91fdb2a408b88d0ad3f7197931ddfb57979b122c806eec664e1b15a6fdff
7
+ data.tar.gz: 8f5d5d83bbf5c0ed0a919056458b7ac13bf009f537f69fbf60c8220acdcf14adeb594a5ff0c601da87859cae23e85fea7fd49b2d0368d500c1530bcdf041a629
data/.rubocop.yml CHANGED
@@ -538,3 +538,5 @@ Style/EmptyStringInsideInterpolation: # new in 1.76
538
538
  Enabled: true
539
539
  Style/RedundantArrayFlatten: # new in 1.76
540
540
  Enabled: true
541
+ Style/ArrayIntersectWithSingleElement: # new in 1.81
542
+ Enabled: true
data/Gemfile CHANGED
@@ -5,5 +5,5 @@ source 'https://rubygems.org'
5
5
  # Specify your gem's dependencies in cocina-models.gemspec
6
6
  gemspec
7
7
 
8
- gem 'byebug'
8
+ gem 'debug'
9
9
  gem 'rspec_junit_formatter' # For CircleCI
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cocina-models (0.107.1)
4
+ cocina-models (0.108.0)
5
5
  activesupport
6
6
  deprecation
7
7
  dry-struct (~> 1.0)
@@ -19,14 +19,14 @@ PATH
19
19
  GEM
20
20
  remote: https://rubygems.org/
21
21
  specs:
22
- activesupport (8.0.3)
22
+ activesupport (8.1.0)
23
23
  base64
24
- benchmark (>= 0.3)
25
24
  bigdecimal
26
25
  concurrent-ruby (~> 1.0, >= 1.3.1)
27
26
  connection_pool (>= 2.2.5)
28
27
  drb
29
28
  i18n (>= 1.6, < 2)
29
+ json
30
30
  logger (>= 1.4.2)
31
31
  minitest (>= 5.1)
32
32
  securerandom (>= 0.3)
@@ -35,15 +35,17 @@ GEM
35
35
  ast (2.4.3)
36
36
  attr_extras (7.1.0)
37
37
  base64 (0.3.0)
38
- benchmark (0.4.1)
39
38
  bigdecimal (3.3.1)
40
- byebug (12.0.0)
41
39
  committee (5.0.0)
42
40
  json_schema (~> 0.14, >= 0.14.3)
43
41
  openapi_parser (~> 1.0)
44
42
  rack (>= 1.5)
45
43
  concurrent-ruby (1.3.5)
46
44
  connection_pool (2.5.4)
45
+ date (3.4.1)
46
+ debug (1.11.0)
47
+ irb (~> 1.10)
48
+ reline (>= 0.3.8)
47
49
  deprecation (1.1.0)
48
50
  activesupport
49
51
  diff-lcs (1.6.2)
@@ -75,10 +77,16 @@ GEM
75
77
  activesupport (>= 3.0, < 9.0)
76
78
  equivalent-xml (0.6.0)
77
79
  nokogiri (>= 1.4.3)
80
+ erb (5.1.1)
78
81
  i18n (1.14.7)
79
82
  concurrent-ruby (~> 1.0)
80
83
  ice_nine (0.11.2)
81
- json (2.15.1)
84
+ io-console (0.8.1)
85
+ irb (1.15.2)
86
+ pp (>= 0.6.0)
87
+ rdoc (>= 4.0.0)
88
+ reline (>= 0.4.2)
89
+ json (2.15.2)
82
90
  json_schema (0.21.0)
83
91
  jsonpath (1.1.5)
84
92
  multi_json
@@ -94,18 +102,30 @@ GEM
94
102
  openapi_parser (1.0.0)
95
103
  optimist (3.2.1)
96
104
  parallel (1.27.0)
97
- parser (3.3.9.0)
105
+ parser (3.3.10.0)
98
106
  ast (~> 2.4.1)
99
107
  racc
100
108
  patience_diff (1.2.0)
101
109
  optimist (~> 3.0)
110
+ pp (0.6.3)
111
+ prettyprint
112
+ prettyprint (0.2.0)
102
113
  prism (1.6.0)
114
+ psych (5.2.6)
115
+ date
116
+ stringio
103
117
  racc (1.8.1)
104
118
  rack (3.2.3)
105
119
  rainbow (3.1.1)
106
120
  rake (13.3.0)
121
+ rdoc (6.15.0)
122
+ erb
123
+ psych (>= 4.0.0)
124
+ tsort
107
125
  regexp_parser (2.11.3)
108
- rspec (3.13.1)
126
+ reline (0.6.2)
127
+ io-console (~> 0.5)
128
+ rspec (3.13.2)
109
129
  rspec-core (~> 3.13.0)
110
130
  rspec-expectations (~> 3.13.0)
111
131
  rspec-mocks (~> 3.13.0)
@@ -120,7 +140,7 @@ GEM
120
140
  rspec-support (3.13.6)
121
141
  rspec_junit_formatter (0.6.0)
122
142
  rspec-core (>= 2, < 4, != 2.12.0)
123
- rubocop (1.81.1)
143
+ rubocop (1.81.6)
124
144
  json (~> 2.3)
125
145
  language_server-protocol (~> 3.17.0.2)
126
146
  lint_roller (~> 1.1.0)
@@ -148,11 +168,13 @@ GEM
148
168
  simplecov_json_formatter (~> 0.1)
149
169
  simplecov-html (0.13.2)
150
170
  simplecov_json_formatter (0.1.4)
151
- super_diff (0.16.0)
171
+ stringio (3.1.7)
172
+ super_diff (0.17.0)
152
173
  attr_extras (>= 6.2.4)
153
174
  diff-lcs
154
175
  patience_diff
155
176
  thor (1.4.0)
177
+ tsort (0.2.0)
156
178
  tzinfo (2.0.6)
157
179
  concurrent-ruby (~> 1.0)
158
180
  unicode-display_width (3.2.0)
@@ -166,9 +188,9 @@ PLATFORMS
166
188
 
167
189
  DEPENDENCIES
168
190
  bundler (~> 2.0)
169
- byebug
170
191
  cocina-models!
171
192
  committee
193
+ debug
172
194
  rake (~> 13.0)
173
195
  rspec (~> 3.0)
174
196
  rspec_junit_formatter
@@ -10,7 +10,7 @@ module Cocina
10
10
 
11
11
  module Cocina
12
12
  module Models
13
- #{name} = Types::String#{pattern}#{enum}
13
+ #{preamble}#{name} = Types::String#{pattern}#{enum}
14
14
  end
15
15
  end
16
16
  RUBY
@@ -1,5 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'debug'
3
4
  require 'fileutils'
4
5
 
5
6
  module Cocina
@@ -7,7 +7,7 @@ module Cocina
7
7
  GENERIC_ITEMS_NAME = 'items'
8
8
 
9
9
  def generate
10
- "attribute :#{name.camelize(:lower)}, Types::Strict::Array.of(#{array_of_type}).default([].freeze)"
10
+ "#{preamble}attribute :#{name.camelize(:lower)}, Types::Strict::Array.of(#{array_of_type}).default([].freeze)"
11
11
  end
12
12
 
13
13
  def array_of_type
@@ -46,7 +46,15 @@ module Cocina
46
46
  def description
47
47
  return '' unless schema_doc.description
48
48
 
49
- "# #{schema_doc.description}\n"
49
+ to_multiline_comment(schema_doc.description)
50
+ end
51
+
52
+ def to_multiline_comment(string)
53
+ string
54
+ .split(/(.{80,}?) /)
55
+ .compact_blank
56
+ .map { |comment_chunk| "# #{comment_chunk}\n" }
57
+ .join
50
58
  end
51
59
 
52
60
  def deprecation
@@ -58,7 +66,7 @@ module Cocina
58
66
  def example
59
67
  return '' unless schema_doc.example
60
68
 
61
- "# example: #{schema_doc.example}\n"
69
+ to_multiline_comment("example: #{schema_doc.example}")
62
70
  end
63
71
 
64
72
  def relaxed_comment
@@ -6,9 +6,9 @@ module Cocina
6
6
  class SchemaRef < SchemaBase
7
7
  def generate
8
8
  if required && !relaxed
9
- "attribute(:#{name.camelize(:lower)}, #{schema_doc.name}.default { #{schema_doc.name}.new })"
9
+ "#{preamble}attribute(:#{name.camelize(:lower)}, #{schema_doc.name}.default { #{schema_doc.name}.new })"
10
10
  else
11
- "attribute? :#{name.camelize(:lower)}, #{schema_doc.name}.optional"
11
+ "#{preamble}attribute? :#{name.camelize(:lower)}, #{schema_doc.name}.optional"
12
12
  end
13
13
  end
14
14
  end
@@ -10,7 +10,7 @@ module Cocina
10
10
 
11
11
  module Cocina
12
12
  module Models
13
- #{name} = #{type_names}
13
+ #{preamble}#{name} = #{type_names}
14
14
  end
15
15
  end
16
16
  RUBY
@@ -52,11 +52,12 @@ module Cocina
52
52
  private_constant :BASE, :URIS
53
53
 
54
54
  def vocabs
55
- type_properties = schemas.values.map { |schema| schema.properties&.[]('type') }.compact
56
- type_properties.map(&:enum).flat_map(&:to_a)
57
- .filter { |vocab| vocab.start_with?(BASE) }
58
- .uniq
59
- .sort
55
+ schemas.values
56
+ .filter_map { |schema| schema.properties&.[]('type')&.enum }
57
+ .flat_map(&:to_a)
58
+ .select { |vocab| vocab.start_with?(BASE) }
59
+ .uniq
60
+ .sort
60
61
  end
61
62
 
62
63
  def names
@@ -6,6 +6,7 @@ module Cocina
6
6
  class AccessRole < Struct
7
7
  # Name of role
8
8
  attribute :name, Types::Strict::String.enum('dor-apo-depositor', 'dor-apo-manager', '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')
9
+ # The users and groups that are members of the role
9
10
  attribute :members, Types::Strict::Array.of(AccessRoleMember).default([].freeze)
10
11
  end
11
12
  end
@@ -17,6 +17,7 @@ module Cocina
17
17
  attribute :externalIdentifier, Druid
18
18
  attribute :label, Types::Strict::String
19
19
  attribute :version, Types::Strict::Integer
20
+ # Administrative properties for an AdminPolicy
20
21
  attribute(:administrative, AdminPolicyAdministrative.default { AdminPolicyAdministrative.new })
21
22
  attribute? :description, Description.optional
22
23
  end
@@ -2,15 +2,21 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- # Provides the template of access settings that is copied to the items governed by an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults and has no embargo.
5
+ # Provides the template of access settings that is copied to the items governed by
6
+ # an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults
7
+ # and has no embargo.
6
8
  class AdminPolicyAccessTemplate < Struct
7
9
  # The human readable copyright statement that applies
8
10
  # example: Copyright World Trade Organization
9
11
  attribute? :copyright, Copyright.optional
10
12
  # The human readable use and reproduction statement that applies
11
- # 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).
13
+ # example: Property rights reside with the repository. Literary rights reside with
14
+ # the creators of the documents or their heirs. To obtain permission to publish or
15
+ # reproduce, please contact the Public Services Librarian of the Dept. of Special Collections
16
+ # (http://library.stanford.edu/spc).
12
17
  attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
13
- # The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
18
+ # The license governing reuse of the DRO. Should be an IRI for known licenses (i.e.
19
+ # CC, RightsStatement.org URI, etc.).
14
20
  attribute? :license, License.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', 'https://cocina.sul.stanford.edu/licenses/none')
15
21
  # Access level.
16
22
  # Validation of this property is relaxed. See the openapi for full validation.
@@ -4,16 +4,25 @@ module Cocina
4
4
  module Models
5
5
  # Administrative properties for an AdminPolicy
6
6
  class AdminPolicyAdministrative < Struct
7
+ # Provides the template of access settings that is copied to the items governed by
8
+ # an AdminPolicy. This is almost the same as DROAccess, but it provides no defaults
9
+ # and has no embargo.
7
10
  attribute(:accessTemplate, AdminPolicyAccessTemplate.default { AdminPolicyAccessTemplate.new })
11
+ # When you register an item with this admin policy, these are the workflows that are
12
+ # available.
8
13
  attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).default([].freeze)
9
- # An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete
14
+ # An additional workflow to start for objects managed by this admin policy once the
15
+ # end-accession workflow step is complete
10
16
  # example: wasCrawlPreassemblyWF
11
17
  attribute? :disseminationWorkflow, Types::Strict::String
18
+ # When you register an item with this admin policy, these are the collections that
19
+ # are available.
12
20
  attribute :collectionsForRegistration, Types::Strict::Array.of(Types::Strict::String).default([].freeze)
13
21
  # example: druid:bc123df4567
14
22
  attribute :hasAdminPolicy, Druid
15
23
  # example: druid:bc123df4567
16
24
  attribute :hasAgreement, Druid
25
+ # The access roles conferred by this AdminPolicy (used by Argo)
17
26
  attribute :roles, Types::Strict::Array.of(AccessRole).default([].freeze)
18
27
  end
19
28
  end
@@ -15,7 +15,10 @@ module Cocina
15
15
  attribute :externalIdentifier, Druid
16
16
  attribute :label, Types::Strict::String
17
17
  attribute :version, Types::Strict::Integer
18
+ # Administrative properties for an AdminPolicy
19
+ # Validation of this property is relaxed. See the openapi for full validation.
18
20
  attribute? :administrative, AdminPolicyAdministrative.optional
21
+ # Validation of this property is relaxed. See the openapi for full validation.
19
22
  attribute? :description, Description.optional
20
23
  end
21
24
  end
@@ -18,6 +18,7 @@ module Cocina
18
18
  attribute :externalIdentifier, Druid
19
19
  attribute :label, Types::Strict::String
20
20
  attribute :version, Types::Strict::Integer
21
+ # Administrative properties for an AdminPolicy
21
22
  attribute(:administrative, AdminPolicyAdministrative.default { AdminPolicyAdministrative.new })
22
23
  attribute? :description, Description.optional
23
24
  # When the object was created.
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- # Property model for indicating the parts, aspects, or versions of the resource to which a descriptive element is applicable.
5
+ # Property model for indicating the parts, aspects, or versions of the resource to
6
+ # which a descriptive element is applicable.
6
7
  class AppliesTo < Struct
7
8
  attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).default([].freeze)
8
9
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
+ # A barcode
5
6
  Barcode = BusinessBarcode | LaneMedicalBarcode | CatkeyBarcode | StandardBarcode
6
7
  end
7
8
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
+ # The barcode associated with a business library DRO object, prefixed with 2050
6
+ # example: 20503740296
5
7
  BusinessBarcode = Types::String.constrained(format: /^2050[0-9]{7}$/)
6
8
  end
7
9
  end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
+ # A linkage between an object and a catalog record
5
6
  CatalogLink = FolioCatalogLink | SymphonyCatalogLink
6
7
  end
7
8
  end
@@ -2,6 +2,9 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
+ # The barcode associated with a DRO object based on catkey, prefixed with a catkey
6
+ # followed by a hyphen
7
+ # example: 6772719-1001
5
8
  CatkeyBarcode = Types::String.constrained(format: /^[0-9]+-[0-9]+$/)
6
9
  end
7
10
  end
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- # A type of access for an object wherein users can see the metadata and a list of files, but the files will not have view or download access
5
+ # A type of access for an object wherein users can see the metadata and a list of files,
6
+ # but the files will not have view or download access
6
7
  class CitationOnlyAccess < Struct
7
8
  # Access level.
8
9
  attribute :view, Types::Strict::String.enum('citation-only')
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
+ # The version of Cocina with which this object conforms.
6
+ # example: 1.2.3
5
7
  CocinaVersion = Types::String.constrained(format: /^\d+\.\d+\.\d+$/)
6
8
  end
7
9
  end
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- # A group of Digital Repository Objects that indicate some type of conceptual grouping within the domain that is worth reusing across the system.
5
+ # A group of Digital Repository Objects that indicate some type of conceptual grouping
6
+ # within the domain that is worth reusing across the system.
6
7
  class Collection < Struct
7
8
  include Validatable
8
9
 
@@ -25,6 +26,7 @@ module Cocina
25
26
  attribute :label, Types::Strict::String
26
27
  # Version for the Collection within SDR.
27
28
  attribute :version, Types::Strict::Integer
29
+ # Access metadata for collections
28
30
  attribute(:access, CollectionAccess.default { CollectionAccess.new })
29
31
  attribute(:administrative, Administrative.default { Administrative.new })
30
32
  attribute(:description, Description.default { Description.new })
@@ -10,9 +10,13 @@ module Cocina
10
10
  # example: Copyright World Trade Organization
11
11
  attribute? :copyright, Copyright.optional
12
12
  # The human readable use and reproduction statement that applies
13
- # 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).
13
+ # example: Property rights reside with the repository. Literary rights reside with
14
+ # the creators of the documents or their heirs. To obtain permission to publish or
15
+ # reproduce, please contact the Public Services Librarian of the Dept. of Special Collections
16
+ # (http://library.stanford.edu/spc).
14
17
  attribute? :useAndReproductionStatement, UseAndReproductionStatement.optional
15
- # The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
18
+ # The license governing reuse of the DRO. Should be an IRI for known licenses (i.e.
19
+ # CC, RightsStatement.org URI, etc.).
16
20
  attribute? :license, License.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', 'https://cocina.sul.stanford.edu/licenses/none')
17
21
  end
18
22
  end
@@ -4,7 +4,14 @@ module Cocina
4
4
  module Models
5
5
  class CollectionIdentification < Struct
6
6
  attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).default([].freeze)
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"
7
+ # Unique identifier in some other system. This is because a large proportion of what
8
+ # is deposited in SDR, historically and currently, are representations of objects that
9
+ # are also represented in other systems. For example, digitized paper and A/V collections
10
+ # have physical manifestations, and those physical objects are managed in systems that
11
+ # have their own identifiers. Similarly, books have barcodes, archival materials have
12
+ # collection numbers and physical locations, etc. The sourceId allows determining if
13
+ # an item has been deposited before and where to look for the original item if you're
14
+ # looking at its SDR representation. The format is: "namespace:identifier"
8
15
 
9
16
  # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
10
17
  attribute? :sourceId, SourceId.optional
@@ -2,7 +2,8 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- # A group of Digital Repository Objects that indicate some type of conceptual grouping within the domain that is worth reusing across the system.
5
+ # A group of Digital Repository Objects that indicate some type of conceptual grouping
6
+ # within the domain that is worth reusing across the system.
6
7
  class CollectionLite < Struct
7
8
  include Checkable
8
9
 
@@ -23,9 +24,14 @@ module Cocina
23
24
  attribute :label, Types::Strict::String
24
25
  # Version for the Collection within SDR.
25
26
  attribute :version, Types::Strict::Integer
27
+ # Access metadata for collections
28
+ # Validation of this property is relaxed. See the openapi for full validation.
26
29
  attribute? :access, CollectionAccess.optional
30
+ # Validation of this property is relaxed. See the openapi for full validation.
27
31
  attribute? :administrative, Administrative.optional
32
+ # Validation of this property is relaxed. See the openapi for full validation.
28
33
  attribute? :description, Description.optional
34
+ # Validation of this property is relaxed. See the openapi for full validation.
29
35
  attribute? :identification, CollectionIdentification.optional
30
36
  end
31
37
  end
@@ -25,6 +25,7 @@ module Cocina
25
25
  attribute :label, Types::Strict::String
26
26
  # Version for the Collection within SDR.
27
27
  attribute :version, Types::Strict::Integer
28
+ # Access metadata for collections
28
29
  attribute(:access, CollectionAccess.default { CollectionAccess.new })
29
30
  attribute(:administrative, Administrative.default { Administrative.new })
30
31
  attribute(:description, Description.default { Description.new })
@@ -2,19 +2,29 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- # Property model for describing agents contributing in some way to the creation and history of the resource.
5
+ # Property model for describing agents contributing in some way to the creation and
6
+ # history of the resource.
6
7
  class Contributor < Struct
8
+ # Names associated with a contributor.
7
9
  attribute :name, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
8
- # Entity type of the contributor (person, organization, etc.). See https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md for valid types.
10
+ # Entity type of the contributor (person, organization, etc.). See https://github.com/sul-dlss/cocina-models/blob/main/docs/description_types.md
11
+ # for valid types.
9
12
  attribute? :type, Types::Strict::String
10
- # Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
13
+ # Status of the contributor relative to other parallel contributors (e.g. the primary
14
+ # author among a group of contributors).
11
15
  attribute? :status, Types::Strict::String
16
+ # Relationships of the contributor to the resource or to an event in its history.
12
17
  attribute :role, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
18
+ # Identifiers and URIs associated with the contributor entity.
13
19
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
20
+ # Institutional or other affiliation associated with a contributor.
14
21
  attribute :affiliation, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
22
+ # Other information associated with the contributor.
15
23
  attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
16
24
  # URL or other pointer to the location of the contributor information.
17
25
  attribute? :valueAt, Types::Strict::String
26
+ # For multiple representations of information about the same contributor (e.g. in different
27
+ # languages).
18
28
  attribute :parallelContributor, Types::Strict::Array.of(DescriptiveParallelContributor).default([].freeze)
19
29
  end
20
30
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
+ # The human readable copyright statement that applies
6
+ # example: Copyright World Trade Organization
5
7
  Copyright = Types::String
6
8
  end
7
9
  end
@@ -2,6 +2,8 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
+ # A record identifier created in Folio
6
+ # example: in11403803
5
7
  CreatedInFolioIdentifier = Types::String.constrained(format: /^in\d+$/)
6
8
  end
7
9
  end
@@ -5,18 +5,32 @@ module Cocina
5
5
  class Description < Struct
6
6
  include Validatable
7
7
 
8
+ # Titles of the resource.
8
9
  attribute :title, Types::Strict::Array.of(Title).default([].freeze)
10
+ # Agents contributing in some way to the creation and history of the resource.
9
11
  attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
12
+ # Events in the history of the resource.
10
13
  attribute :event, Types::Strict::Array.of(Event).default([].freeze)
14
+ # Characteristics of the resource's physical, digital, and intellectual form and genre,
15
+ # and of its process of creation.
11
16
  attribute :form, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
17
+ # Geographic description for items with coordinates or bounding boxes.
12
18
  attribute :geographic, Types::Strict::Array.of(DescriptiveGeographicMetadata).default([].freeze)
19
+ # Languages, scripts, symbolic systems, and notations used in all or part of a resource.
13
20
  attribute :language, Types::Strict::Array.of(Language).default([].freeze)
21
+ # Additional information relevant to a resource.
14
22
  attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
23
+ # Identifiers and URIs associated with the resource.
15
24
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
25
+ # Terms associated with the intellectual content of the resource.
16
26
  attribute :subject, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
27
+ # Information about how to access digital and physical versions of the object.
17
28
  attribute? :access, DescriptiveAccessMetadata.optional
29
+ # Other resources associated with the described resource.
18
30
  attribute :relatedResource, Types::Strict::Array.of(RelatedResource).default([].freeze)
31
+ # Data about the resource represented in MARC fixed fields and codes.
19
32
  attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
33
+ # Information about this resource description.
20
34
  attribute? :adminMetadata, DescriptiveAdminMetadata.optional
21
35
  # URL or other pointer to the location of the resource description.
22
36
  attribute? :valueAt, Types::Strict::String
@@ -4,11 +4,18 @@ module Cocina
4
4
  module Models
5
5
  # Information about how to access digital and physical versions of the object.
6
6
  class DescriptiveAccessMetadata < Struct
7
+ # URLs where the resource may be accessed in full or part.
7
8
  attribute :url, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
9
+ # Location of a physical version of the resource.
8
10
  attribute :physicalLocation, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
11
+ # Location of a digital version of the resource, such as a file path for a born digital
12
+ # resource.
9
13
  attribute :digitalLocation, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
14
+ # The library, organization, or person responsible for access to the resource.
10
15
  attribute :accessContact, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
16
+ # The digital repositories that hold the resource.
11
17
  attribute :digitalRepository, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
18
+ # Other information related to accessing the resource.
12
19
  attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
13
20
  end
14
21
  end
@@ -4,11 +4,17 @@ module Cocina
4
4
  module Models
5
5
  # Information about this resource description.
6
6
  class DescriptiveAdminMetadata < Struct
7
+ # Contributors to this resource description.
7
8
  attribute :contributor, Types::Strict::Array.of(Contributor).default([].freeze)
9
+ # Events in the history of this resource description.
8
10
  attribute :event, Types::Strict::Array.of(Event).default([].freeze)
11
+ # Languages, scripts, symbolic systems, and notations used in this resource description.
9
12
  attribute :language, Types::Strict::Array.of(Language).default([].freeze)
13
+ # Other information related to this resource description.
10
14
  attribute :note, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
15
+ # Descriptive or content standard(s) to which this resource description conforms.
11
16
  attribute :metadataStandard, Types::Strict::Array.of(Standard).default([].freeze)
17
+ # Identifiers associated with this resource description.
12
18
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).default([].freeze)
13
19
  end
14
20
  end