cocina-models 0.54.0.beta.1 → 0.56.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 458d1785e59901fddf5a48498b69f94918438a17eae1b55b3aae4c2566e7dfa5
4
- data.tar.gz: 2f8db910031913c252f19e019535877d7d7cbb113ee8e2fdf5e3455866a5ef54
3
+ metadata.gz: a52376af9aaa972a14d4519fb0faede24d513fa07398c4c9baee0b3f20905023
4
+ data.tar.gz: 14cff19f291851019d791e55851d2b83f0619e8b2814390cc67fad5a1b6865c9
5
5
  SHA512:
6
- metadata.gz: '095a80dcc767034269cca494bb97ac2cd2ebfd71c8c08407c22d69e3e39fbd3ec9f61d84259ca74ed09a63f0216832230f8da52de20dc384cc1bccd57f48ce4b'
7
- data.tar.gz: fd89991c60f9a90397d250483f6a44aabf0f30ac83f20cc10f34d33dac1b082877a628bcd87465805ba742d143e37e608e5a58759b024ce448826efb3d44b622
6
+ metadata.gz: 4c2bf5052432e221e622b4c87164bcc3ae823a74ef589ede8e07054b98159cb60be777f1b905a7b8846bdbc4a678440e09ab1040fcd252cc67215498fa3d438d
7
+ data.tar.gz: 39fa183b6da0bd4d1a4ff2766cbbd9ec1a11e0b68f7ce640a8394a13565fc4f310d5992ea4e2371a638e860d0c1595fe18899a63acd9d30b3353aff40870e3ca
data/README.md CHANGED
@@ -66,3 +66,12 @@ Once the above listed gems are updated all the following services that use cocin
66
66
  If you are using this gem in an application that has an API that accepts Cocina models (e.g., SDR API, Dor-Services-App), make sure that the `openapi.yml` for the application includes the schemas that match the schemas in this `openapi.yml`.
67
67
 
68
68
  This can be accomplished by cutting and pasting these schemas. By convention, these schemas are listed first in the `openapi.yml` of the associated projects, followed by the application-specific schemas.
69
+
70
+ ### Usage conventions
71
+
72
+ The following are the recommended naming conventions for code using Cocina models:
73
+
74
+ * cocina_item: Cocina::Models::DRO instance
75
+ * cocina_admin_policy: Cocina::Models::AdminPolicy instance
76
+ * cocina_collection: Cocina::Models::Collection instance
77
+ * cocina_object: Cocina::Models::DRO or Cocina::Models::AdminPolicy or Cocina::Models::Collection instance
@@ -1,5 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require 'fileutils'
4
+
3
5
  module Cocina
4
6
  module Generator
5
7
  # Class for generating Cocina models from openapi.
@@ -96,7 +96,7 @@ module Cocina
96
96
  doc.properties.map do |key, properties_doc|
97
97
  property_class_for(properties_doc).new(properties_doc,
98
98
  key: key,
99
- required: doc.requires?(properties_doc),
99
+ required: doc.requires?(key),
100
100
  parent: self)
101
101
  end
102
102
  end
@@ -33,23 +33,40 @@ module Cocina
33
33
 
34
34
  attr_reader :schemas
35
35
 
36
- # rubocop:disable Style/MultilineBlockChain
36
+ BASE = 'http://cocina.sul.stanford.edu/models/'
37
+
37
38
  def vocabs
38
- schemas.values.map do |schema|
39
- type_property = schema.properties['type']
40
- type_property.nil? ? [] : type_property.enum.to_a
41
- end
42
- .flatten
43
- .uniq
44
- .sort
45
- .filter { |vocab| vocab.start_with?('http://cocina.sul.stanford.edu/models') }
39
+ type_properties = schemas.values.map { |schema| schema.properties['type'] }.compact
40
+ type_properties.map(&:enum).flat_map(&:to_a)
41
+ .filter { |vocab| vocab.start_with?(BASE) }
42
+ .uniq
43
+ .sort
46
44
  end
47
- # rubocop:enable Style/MultilineBlockChain
48
45
 
49
46
  def vocab_methods
50
- # Note special handling of 3d
51
- vocabs.map do |vocab|
52
- name = vocab[38, vocab.size - 45].gsub('-', '_').gsub('3d', 'three_dimensional')
47
+ names = vocabs.each_with_object({}) do |vocab, object|
48
+ # Note special handling of 3d
49
+ namespaced = vocab.delete_prefix(BASE).delete_suffix('.jsonld')
50
+ .gsub('-', '_').gsub('3d', 'three_dimensional')
51
+ namespace, name = namespaced.include?('/') ? namespaced.split('/') : [:root, namespaced]
52
+ object[namespace] ||= {}
53
+ object[namespace][name] = vocab
54
+ end
55
+ draw_namespaced_methods(names)
56
+ end
57
+
58
+ def draw_namespaced_methods(names)
59
+ names.flat_map do |namespace, methods|
60
+ [].tap do |items|
61
+ items << "class #{namespace.capitalize}" unless namespace == :root
62
+ items << draw_ruby_methods(methods)
63
+ items << 'end' unless namespace == :root
64
+ end
65
+ end.join("\n")
66
+ end
67
+
68
+ def draw_ruby_methods(methods)
69
+ methods.map do |name, vocab|
53
70
  <<~RUBY
54
71
  def self.#{name}
55
72
  "#{vocab}"
@@ -7,6 +7,11 @@ module Cocina
7
7
  attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
8
8
  # If access is "location-based", which location should have access.
9
9
  attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
10
+ # 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).
12
+ attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
13
+ # The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
14
+ attribute :license, Types::Strict::String.meta(omittable: true)
10
15
  end
11
16
  end
12
17
  end
@@ -4,7 +4,7 @@ module Cocina
4
4
  module Models
5
5
  class AccessRole < Struct
6
6
  # Name of role
7
- attribute :name, Types::Strict::String.enum('sdr-administrator', 'sdr-viewer', 'dor-apo-manager', 'hydrus-collection-creator', 'hydrus-collection-manager', 'hydrus-collection-depositor', 'hydrus-collection-item-depositor', 'hydrus-collection-reviewer', 'hydrus-collection-viewer')
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
8
  attribute :members, Types::Strict::Array.of(AccessRoleMember).default([].freeze)
9
9
  end
10
10
  end
@@ -3,14 +3,19 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class AdminPolicyAdministrative < Struct
6
+ # This is an XML expression of the default access (see defaultAccess)
6
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
+ attribute :defaultAccess, AdminPolicyDefaultAccess.optional.meta(omittable: true)
7
9
  attribute :registrationWorkflow, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
8
10
  # An additional workflow to start for objects managed by this admin policy once the end-accession workflow step is complete
9
11
  # example: wasCrawlPreassemblyWF
10
12
  attribute :disseminationWorkflow, Types::Strict::String.meta(omittable: true)
11
13
  attribute :collectionsForRegistration, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
12
- attribute :roles, Types::Strict::Array.of(AccessRole).meta(omittable: true)
14
+ # example: druid:bc123df4567
13
15
  attribute :hasAdminPolicy, Types::Strict::String
16
+ # example: druid:bc123df4567
17
+ attribute :referencesAgreement, Types::Strict::String.meta(omittable: true)
18
+ attribute :roles, Types::Strict::Array.of(AccessRole).meta(omittable: true)
14
19
  end
15
20
  end
16
21
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class AdminPolicyDefaultAccess < Struct
6
+ attribute :access, Types::Strict::String.enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
7
+ # Available for controlled digital lending.
8
+ attribute :controlledDigitalLending, Types::Strict::Bool.meta(omittable: true)
9
+ # The human readable copyright statement that applies
10
+ # example: Copyright World Trade Organization
11
+ attribute :copyright, Types::Strict::String.meta(omittable: true)
12
+ # Download access level. This is used in the transition from Fedora as a way to set a default download level at registration that is copied down to all the files.
13
+
14
+ attribute :download, Types::Strict::String.enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
15
+ # If access is "location-based", which location should have access. This is used in the transition from Fedora as a way to set a default readLocation at registration that is copied down to all the files.
16
+
17
+ attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
18
+ # The human readable use and reproduction statement that applies
19
+ # 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).
20
+ attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
21
+ # The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
22
+ attribute :license, Types::Strict::String.meta(omittable: true)
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ BusinessBarcode = Types::String.constrained(
6
+ format: /^2050[0-9]{7}$/i
7
+ )
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ CatkeyBarcode = Types::String.constrained(
6
+ format: /^[0-9]+-[0-9]+$/i
7
+ )
8
+ end
9
+ end
@@ -13,6 +13,7 @@ module Cocina
13
13
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
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).meta(omittable: true)
16
17
  end
17
18
  end
18
19
  end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class DescriptiveParallelContributor < Struct
6
+ attribute :name, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
+ # Entity type of the contributor (person, organization, etc.).
8
+ attribute :type, Types::Strict::String.meta(omittable: true)
9
+ # Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
10
+ attribute :status, Types::Strict::String.meta(omittable: true)
11
+ attribute :role, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
12
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
14
+ # URL or other pointer to the location of the contributor information.
15
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
16
+ attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
17
+ end
18
+ end
19
+ end
@@ -19,6 +19,8 @@ module Cocina
19
19
  # The human readable use and reproduction statement that applies
20
20
  # 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).
21
21
  attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
22
+ # The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
23
+ attribute :license, Types::Strict::String.meta(omittable: true)
22
24
  end
23
25
  end
24
26
  end
@@ -5,7 +5,22 @@ module Cocina
5
5
  class FileSet < Struct
6
6
  include Checkable
7
7
 
8
- TYPES = ['http://cocina.sul.stanford.edu/models/fileset.jsonld'].freeze
8
+ TYPES = ['http://cocina.sul.stanford.edu/models/resources/audio.jsonld',
9
+ 'http://cocina.sul.stanford.edu/models/resources/attachment.jsonld',
10
+ 'http://cocina.sul.stanford.edu/models/resources/document.jsonld',
11
+ 'http://cocina.sul.stanford.edu/models/resources/file.jsonld',
12
+ 'http://cocina.sul.stanford.edu/models/resources/image.jsonld',
13
+ 'http://cocina.sul.stanford.edu/models/resources/main-augmented.jsonld',
14
+ 'http://cocina.sul.stanford.edu/models/resources/main-original.jsonld',
15
+ 'http://cocina.sul.stanford.edu/models/resources/media.jsonld',
16
+ 'http://cocina.sul.stanford.edu/models/resources/object.jsonld',
17
+ 'http://cocina.sul.stanford.edu/models/resources/page.jsonld',
18
+ 'http://cocina.sul.stanford.edu/models/resources/permissions.jsonld',
19
+ 'http://cocina.sul.stanford.edu/models/resources/preview.jsonld',
20
+ 'http://cocina.sul.stanford.edu/models/resources/supplement.jsonld',
21
+ 'http://cocina.sul.stanford.edu/models/resources/3d.jsonld',
22
+ 'http://cocina.sul.stanford.edu/models/resources/thumb.jsonld',
23
+ 'http://cocina.sul.stanford.edu/models/resources/video.jsonld'].freeze
9
24
 
10
25
  # The content type of the Fileset.
11
26
  attribute :type, Types::Strict::String.enum(*FileSet::TYPES)
@@ -8,6 +8,8 @@ module Cocina
8
8
  # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
9
9
  attribute :sourceId, Types::Strict::String.meta(omittable: true)
10
10
  attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
11
+ # A barcode
12
+ attribute :barcode, Types::Nominal::Any.meta(omittable: true)
11
13
  end
12
14
  end
13
15
  end
@@ -5,7 +5,22 @@ module Cocina
5
5
  class RequestFileSet < Struct
6
6
  include Checkable
7
7
 
8
- TYPES = ['http://cocina.sul.stanford.edu/models/fileset.jsonld'].freeze
8
+ TYPES = ['http://cocina.sul.stanford.edu/models/resources/audio.jsonld',
9
+ 'http://cocina.sul.stanford.edu/models/resources/attachment.jsonld',
10
+ 'http://cocina.sul.stanford.edu/models/resources/document.jsonld',
11
+ 'http://cocina.sul.stanford.edu/models/resources/file.jsonld',
12
+ 'http://cocina.sul.stanford.edu/models/resources/image.jsonld',
13
+ 'http://cocina.sul.stanford.edu/models/resources/main-augmented.jsonld',
14
+ 'http://cocina.sul.stanford.edu/models/resources/main-original.jsonld',
15
+ 'http://cocina.sul.stanford.edu/models/resources/media.jsonld',
16
+ 'http://cocina.sul.stanford.edu/models/resources/object.jsonld',
17
+ 'http://cocina.sul.stanford.edu/models/resources/page.jsonld',
18
+ 'http://cocina.sul.stanford.edu/models/resources/permissions.jsonld',
19
+ 'http://cocina.sul.stanford.edu/models/resources/preview.jsonld',
20
+ 'http://cocina.sul.stanford.edu/models/resources/supplement.jsonld',
21
+ 'http://cocina.sul.stanford.edu/models/resources/3d.jsonld',
22
+ 'http://cocina.sul.stanford.edu/models/resources/thumb.jsonld',
23
+ 'http://cocina.sul.stanford.edu/models/resources/video.jsonld'].freeze
9
24
 
10
25
  attribute :type, Types::Strict::String.enum(*RequestFileSet::TYPES)
11
26
  attribute :label, Types::Strict::String
@@ -8,6 +8,8 @@ module Cocina
8
8
  # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
9
9
  attribute :sourceId, Types::Strict::String
10
10
  attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
11
+ # A barcode
12
+ attribute :barcode, Types::Nominal::Any.meta(omittable: true)
11
13
  end
12
14
  end
13
15
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ StandardBarcode = Types::String.constrained(
6
+ format: /^36105[0-9]{9}$/i
7
+ )
8
+ end
9
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.54.0.beta.1'
5
+ VERSION = '0.56.1'
6
6
  end
7
7
  end
@@ -40,10 +40,6 @@ module Cocina
40
40
  'http://cocina.sul.stanford.edu/models/file.jsonld'
41
41
  end
42
42
 
43
- def self.fileset
44
- 'http://cocina.sul.stanford.edu/models/fileset.jsonld'
45
- end
46
-
47
43
  def self.geo
48
44
  'http://cocina.sul.stanford.edu/models/geo.jsonld'
49
45
  end
@@ -95,6 +91,72 @@ module Cocina
95
91
  def self.webarchive_seed
96
92
  'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'
97
93
  end
94
+
95
+ class Resources
96
+ def self.three_dimensional
97
+ 'http://cocina.sul.stanford.edu/models/resources/3d.jsonld'
98
+ end
99
+
100
+ def self.attachment
101
+ 'http://cocina.sul.stanford.edu/models/resources/attachment.jsonld'
102
+ end
103
+
104
+ def self.audio
105
+ 'http://cocina.sul.stanford.edu/models/resources/audio.jsonld'
106
+ end
107
+
108
+ def self.document
109
+ 'http://cocina.sul.stanford.edu/models/resources/document.jsonld'
110
+ end
111
+
112
+ def self.file
113
+ 'http://cocina.sul.stanford.edu/models/resources/file.jsonld'
114
+ end
115
+
116
+ def self.image
117
+ 'http://cocina.sul.stanford.edu/models/resources/image.jsonld'
118
+ end
119
+
120
+ def self.main_augmented
121
+ 'http://cocina.sul.stanford.edu/models/resources/main-augmented.jsonld'
122
+ end
123
+
124
+ def self.main_original
125
+ 'http://cocina.sul.stanford.edu/models/resources/main-original.jsonld'
126
+ end
127
+
128
+ def self.media
129
+ 'http://cocina.sul.stanford.edu/models/resources/media.jsonld'
130
+ end
131
+
132
+ def self.object
133
+ 'http://cocina.sul.stanford.edu/models/resources/object.jsonld'
134
+ end
135
+
136
+ def self.page
137
+ 'http://cocina.sul.stanford.edu/models/resources/page.jsonld'
138
+ end
139
+
140
+ def self.permissions
141
+ 'http://cocina.sul.stanford.edu/models/resources/permissions.jsonld'
142
+ end
143
+
144
+ def self.preview
145
+ 'http://cocina.sul.stanford.edu/models/resources/preview.jsonld'
146
+ end
147
+
148
+ def self.supplement
149
+ 'http://cocina.sul.stanford.edu/models/resources/supplement.jsonld'
150
+ end
151
+
152
+ def self.thumb
153
+ 'http://cocina.sul.stanford.edu/models/resources/thumb.jsonld'
154
+ end
155
+
156
+ def self.video
157
+ 'http://cocina.sul.stanford.edu/models/resources/video.jsonld'
158
+ end
159
+ end
98
160
  end
99
161
  end
100
162
  end
data/openapi.yml CHANGED
@@ -118,6 +118,13 @@ components:
118
118
  - 'art'
119
119
  - 'hoover'
120
120
  - 'm&m'
121
+ useAndReproductionStatement:
122
+ description: The human readable use and reproduction statement that applies
123
+ 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).
124
+ type: string
125
+ license:
126
+ description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
127
+ type: string
121
128
  AccessRole:
122
129
  description: Access role conferred by an AdminPolicy to objects within it. (used by Argo)
123
130
  type: object
@@ -127,9 +134,14 @@ components:
127
134
  description: Name of role
128
135
  type: string
129
136
  enum:
137
+ - 'dor-apo-creator'
138
+ - 'dor-apo-depositor'
139
+ - 'dor-apo-manager'
140
+ - 'dor-apo-metadata'
141
+ - 'dor-apo-reviewer'
142
+ - 'dor-apo-viewer'
130
143
  - 'sdr-administrator'
131
144
  - 'sdr-viewer'
132
- - 'dor-apo-manager'
133
145
  - 'hydrus-collection-creator'
134
146
  - 'hydrus-collection-manager'
135
147
  - 'hydrus-collection-depositor'
@@ -209,7 +221,11 @@ components:
209
221
  properties:
210
222
  defaultObjectRights:
211
223
  type: string
224
+ description: This is an XML expression of the default access (see defaultAccess)
225
+ deprecated: true
212
226
  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>
227
+ defaultAccess:
228
+ $ref: '#/components/schemas/AdminPolicyDefaultAccess'
213
229
  registrationWorkflow:
214
230
  description: When you register an item with this admin policy, these are the workflows that are available.
215
231
  type: array
@@ -224,15 +240,70 @@ components:
224
240
  type: array
225
241
  items:
226
242
  type: string
243
+ hasAdminPolicy:
244
+ $ref: '#/components/schemas/Druid'
245
+ referencesAgreement:
246
+ $ref: '#/components/schemas/Druid'
227
247
  roles:
228
248
  description: The access roles conferred by this AdminPolicy (used by Argo)
229
249
  type: array
230
250
  items:
231
251
  $ref: '#/components/schemas/AccessRole'
232
- hasAdminPolicy:
233
- type: string
234
252
  required:
235
253
  - hasAdminPolicy
254
+ AdminPolicyDefaultAccess:
255
+ 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.'
256
+ type: object
257
+ additionalProperties: false
258
+ properties:
259
+ access:
260
+ type: string
261
+ enum:
262
+ - 'world'
263
+ - 'stanford'
264
+ - 'location-based'
265
+ - 'citation-only'
266
+ - 'dark'
267
+ controlledDigitalLending:
268
+ description: Available for controlled digital lending.
269
+ type: boolean
270
+ copyright:
271
+ description: The human readable copyright statement that applies
272
+ example: Copyright World Trade Organization
273
+ type: string
274
+ download:
275
+ description: >
276
+ Download access level. This is used in the transition from Fedora as
277
+ a way to set a default download level at registration that is copied
278
+ down to all the files.
279
+
280
+ type: string
281
+ enum:
282
+ - 'world'
283
+ - 'stanford'
284
+ - 'location-based'
285
+ - 'none'
286
+ readLocation:
287
+ description: >
288
+ If access is "location-based", which location should have access.
289
+ This is used in the transition from Fedora as a way to set a default
290
+ readLocation at registration that is copied down to all the files.
291
+
292
+ type: string
293
+ enum:
294
+ - 'spec'
295
+ - 'music'
296
+ - 'ars'
297
+ - 'art'
298
+ - 'hoover'
299
+ - 'm&m'
300
+ useAndReproductionStatement:
301
+ description: The human readable use and reproduction statement that applies
302
+ 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).
303
+ type: string
304
+ license:
305
+ description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
306
+ type: string
236
307
  AppliesTo:
237
308
  description: Property model for indicating the parts, aspects, or versions of the resource to which a
238
309
  descriptive element is applicable.
@@ -243,6 +314,17 @@ components:
243
314
  type: array
244
315
  items:
245
316
  $ref: "#/components/schemas/DescriptiveBasicValue"
317
+ Barcode:
318
+ description: 'A barcode'
319
+ oneOf:
320
+ - $ref: '#/components/schemas/BusinessBarcode'
321
+ - $ref: '#/components/schemas/CatkeyBarcode'
322
+ - $ref: '#/components/schemas/StandardBarcode'
323
+ BusinessBarcode:
324
+ description: The barcode associated with a business library DRO object, prefixed with 2050
325
+ type: string
326
+ pattern: '^2050[0-9]{7}$'
327
+ example: 20503740296
246
328
  CatalogLink:
247
329
  type: object
248
330
  additionalProperties: false
@@ -258,6 +340,11 @@ components:
258
340
  description: Record identifier that is unique within the context of the linked record's catalog.
259
341
  type: string
260
342
  example: 11403803
343
+ CatkeyBarcode:
344
+ description: The barcode associated with a DRO object based on catkey, prefixed with 36105
345
+ type: string
346
+ pattern: '^[0-9]+-[0-9]+$'
347
+ example: 6772719-1001
261
348
  Collection:
262
349
  description: A group of Digital Repository Objects that indicate some type of conceptual grouping within the domain that is worth reusing across the system.
263
350
  type: object
@@ -342,6 +429,11 @@ components:
342
429
  valueAt:
343
430
  description: URL or other pointer to the location of the contributor information.
344
431
  type: string
432
+ parallelContributor:
433
+ description: For multiple representations of information about the same contributor (e.g. in different languages).
434
+ type: array
435
+ items:
436
+ $ref: "#/components/schemas/DescriptiveParallelContributor"
345
437
  Description:
346
438
  type: object
347
439
  additionalProperties: false
@@ -576,6 +668,43 @@ components:
576
668
  type: array
577
669
  items:
578
670
  $ref: "#/components/schemas/DescriptiveValue"
671
+ DescriptiveParallelContributor:
672
+ description: Value model for multiple representations of information about the same contributor (e.g. in different languages).
673
+ type: object
674
+ additionalProperties: false
675
+ properties:
676
+ name:
677
+ description: Names associated with a contributor.
678
+ type: array
679
+ items:
680
+ $ref: "#/components/schemas/DescriptiveValue"
681
+ type:
682
+ description: Entity type of the contributor (person, organization, etc.).
683
+ type: string
684
+ status:
685
+ description: Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
686
+ type: string
687
+ role:
688
+ description: Relationships of the contributor to the resource or to an event in its history.
689
+ type: array
690
+ items:
691
+ $ref: "#/components/schemas/DescriptiveValue"
692
+ identifier:
693
+ description: Identifiers and URIs associated with the contributor entity.
694
+ type: array
695
+ items:
696
+ $ref: "#/components/schemas/DescriptiveValue"
697
+ note:
698
+ description: Other information associated with the contributor.
699
+ type: array
700
+ items:
701
+ $ref: "#/components/schemas/DescriptiveValue"
702
+ valueAt:
703
+ description: URL or other pointer to the location of the contributor information.
704
+ type: string
705
+ valueLanguage:
706
+ # description: Language of the descriptive element value
707
+ $ref: "#/components/schemas/DescriptiveValueLanguage"
579
708
  DescriptiveParallelEvent:
580
709
  description: Value model for multiple representations of information about the same event (e.g. in different languages).
581
710
  type: object
@@ -762,6 +891,9 @@ components:
762
891
  description: The human readable use and reproduction statement that applies
763
892
  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).
764
893
  type: string
894
+ license:
895
+ description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
896
+ type: string
765
897
  DROStructural:
766
898
  description: Structural metadata
767
899
  type: object
@@ -976,7 +1108,22 @@ components:
976
1108
  description: The content type of the Fileset.
977
1109
  type: string
978
1110
  enum:
979
- - 'http://cocina.sul.stanford.edu/models/fileset.jsonld'
1111
+ - 'http://cocina.sul.stanford.edu/models/resources/audio.jsonld'
1112
+ - 'http://cocina.sul.stanford.edu/models/resources/attachment.jsonld'
1113
+ - 'http://cocina.sul.stanford.edu/models/resources/document.jsonld'
1114
+ - 'http://cocina.sul.stanford.edu/models/resources/file.jsonld'
1115
+ - 'http://cocina.sul.stanford.edu/models/resources/image.jsonld'
1116
+ - 'http://cocina.sul.stanford.edu/models/resources/main-augmented.jsonld'
1117
+ - 'http://cocina.sul.stanford.edu/models/resources/main-original.jsonld'
1118
+ - 'http://cocina.sul.stanford.edu/models/resources/media.jsonld'
1119
+ - 'http://cocina.sul.stanford.edu/models/resources/object.jsonld'
1120
+ - 'http://cocina.sul.stanford.edu/models/resources/page.jsonld'
1121
+ - 'http://cocina.sul.stanford.edu/models/resources/permissions.jsonld'
1122
+ - 'http://cocina.sul.stanford.edu/models/resources/preview.jsonld'
1123
+ - 'http://cocina.sul.stanford.edu/models/resources/supplement.jsonld'
1124
+ - 'http://cocina.sul.stanford.edu/models/resources/3d.jsonld'
1125
+ - 'http://cocina.sul.stanford.edu/models/resources/thumb.jsonld'
1126
+ - 'http://cocina.sul.stanford.edu/models/resources/video.jsonld'
980
1127
  externalIdentifier:
981
1128
  type: string
982
1129
  label:
@@ -1021,6 +1168,8 @@ components:
1021
1168
  type: array
1022
1169
  items:
1023
1170
  $ref: '#/components/schemas/CatalogLink'
1171
+ barcode:
1172
+ $ref: '#/components/schemas/Barcode'
1024
1173
  Language:
1025
1174
  description: Languages, scripts, symbolic systems, and notations used in all
1026
1175
  or part of a resource or its descriptive metadata.
@@ -1393,7 +1542,22 @@ components:
1393
1542
  type:
1394
1543
  type: string
1395
1544
  enum:
1396
- - 'http://cocina.sul.stanford.edu/models/fileset.jsonld'
1545
+ - 'http://cocina.sul.stanford.edu/models/resources/audio.jsonld'
1546
+ - 'http://cocina.sul.stanford.edu/models/resources/attachment.jsonld'
1547
+ - 'http://cocina.sul.stanford.edu/models/resources/document.jsonld'
1548
+ - 'http://cocina.sul.stanford.edu/models/resources/file.jsonld'
1549
+ - 'http://cocina.sul.stanford.edu/models/resources/image.jsonld'
1550
+ - 'http://cocina.sul.stanford.edu/models/resources/main-augmented.jsonld'
1551
+ - 'http://cocina.sul.stanford.edu/models/resources/main-original.jsonld'
1552
+ - 'http://cocina.sul.stanford.edu/models/resources/media.jsonld'
1553
+ - 'http://cocina.sul.stanford.edu/models/resources/object.jsonld'
1554
+ - 'http://cocina.sul.stanford.edu/models/resources/page.jsonld'
1555
+ - 'http://cocina.sul.stanford.edu/models/resources/permissions.jsonld'
1556
+ - 'http://cocina.sul.stanford.edu/models/resources/preview.jsonld'
1557
+ - 'http://cocina.sul.stanford.edu/models/resources/supplement.jsonld'
1558
+ - 'http://cocina.sul.stanford.edu/models/resources/3d.jsonld'
1559
+ - 'http://cocina.sul.stanford.edu/models/resources/thumb.jsonld'
1560
+ - 'http://cocina.sul.stanford.edu/models/resources/video.jsonld'
1397
1561
  label:
1398
1562
  type: string
1399
1563
  version:
@@ -1425,6 +1589,8 @@ components:
1425
1589
  type: array
1426
1590
  items:
1427
1591
  $ref: '#/components/schemas/CatalogLink'
1592
+ barcode:
1593
+ $ref: '#/components/schemas/Barcode'
1428
1594
  required:
1429
1595
  - sourceId
1430
1596
  Sequence:
@@ -1504,6 +1670,11 @@ components:
1504
1670
  type: string
1505
1671
  source:
1506
1672
  $ref: "#/components/schemas/Source"
1673
+ StandardBarcode:
1674
+ description: The standard barcode associated with a DRO object, prefixed with 36105
1675
+ type: string
1676
+ pattern: '^36105[0-9]{9}$'
1677
+ example: 36105010362304
1507
1678
  Title:
1508
1679
  type: object
1509
1680
  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.54.0.beta.1
4
+ version: 0.56.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-10 00:00:00.000000000 Z
11
+ date: 2021-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -258,9 +258,12 @@ files:
258
258
  - lib/cocina/models/access_role_member.rb
259
259
  - lib/cocina/models/admin_policy.rb
260
260
  - lib/cocina/models/admin_policy_administrative.rb
261
+ - lib/cocina/models/admin_policy_default_access.rb
261
262
  - lib/cocina/models/administrative.rb
262
263
  - lib/cocina/models/applies_to.rb
264
+ - lib/cocina/models/business_barcode.rb
263
265
  - lib/cocina/models/catalog_link.rb
266
+ - lib/cocina/models/catkey_barcode.rb
264
267
  - lib/cocina/models/checkable.rb
265
268
  - lib/cocina/models/collection.rb
266
269
  - lib/cocina/models/collection_identification.rb
@@ -271,6 +274,7 @@ files:
271
274
  - lib/cocina/models/descriptive_basic_value.rb
272
275
  - lib/cocina/models/descriptive_geographic_metadata.rb
273
276
  - lib/cocina/models/descriptive_grouped_value.rb
277
+ - lib/cocina/models/descriptive_parallel_contributor.rb
274
278
  - lib/cocina/models/descriptive_parallel_event.rb
275
279
  - lib/cocina/models/descriptive_parallel_value.rb
276
280
  - lib/cocina/models/descriptive_structured_value.rb
@@ -306,6 +310,7 @@ files:
306
310
  - lib/cocina/models/source.rb
307
311
  - lib/cocina/models/source_id.rb
308
312
  - lib/cocina/models/standard.rb
313
+ - lib/cocina/models/standard_barcode.rb
309
314
  - lib/cocina/models/title.rb
310
315
  - lib/cocina/models/validator.rb
311
316
  - lib/cocina/models/version.rb
@@ -314,7 +319,7 @@ files:
314
319
  homepage: https://github.com/sul-dlss/cocina-models
315
320
  licenses: []
316
321
  metadata: {}
317
- post_install_message:
322
+ post_install_message:
318
323
  rdoc_options: []
319
324
  require_paths:
320
325
  - lib
@@ -325,12 +330,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
325
330
  version: '2.5'
326
331
  required_rubygems_version: !ruby/object:Gem::Requirement
327
332
  requirements:
328
- - - ">"
333
+ - - ">="
329
334
  - !ruby/object:Gem::Version
330
- version: 1.3.1
335
+ version: '0'
331
336
  requirements: []
332
- rubygems_version: 3.0.6
333
- signing_key:
337
+ rubygems_version: 3.1.4
338
+ signing_key:
334
339
  specification_version: 4
335
340
  summary: Data models for the SDR
336
341
  test_files: []