cocina-models 0.54.0.beta.2 → 0.57.0

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: c3647bdfe1efdf9e51abdd4136d455eac3962cbd38a1d29fd32aa037ca9c8481
4
- data.tar.gz: c5ddfe3f1eab351ac6eb0fe4b20ecb9b6597397d00600dcd1fdce2ebff4bf86b
3
+ metadata.gz: 327ee6c2265a055d884305f09a8e6ef984ef97890b133bf01c84ef11c4cb587f
4
+ data.tar.gz: 727bfd13e69b3aee8f6d4820dc5a212eacb64ee8cb9d5a9d016f7de3d98493fb
5
5
  SHA512:
6
- metadata.gz: 5b6e644d13d139fcb672b66979d5ba55e8031e06fe691e0beedd3105180f948133f8c37e1d92ed496934fa4947ac4c623c2e6fa3b1474043e9fb7691e125c2d0
7
- data.tar.gz: df4b09ffd691bc52f6fda5d90dd0ae99510261cd73c7017fba9aa3f665643efe8699ae0b2e55e5e30281318391079847e2059d5af29471c4dd2b23fa09477aed
6
+ metadata.gz: 9438bc21b55a4f921314bcd77245bad9d023f40fd58bdae273ff8bc41658eec4aba38a4c670a71e747ab040583f0c16426a0e7dd3383f9d73288ce52c6040f8b
7
+ data.tar.gz: 80b8dcd260337bc8c210ecec957435bebc0b4dfa9318e4ddd9de1a6cf15525e3202c2c21f1366f7e21372560e5a3ba304abde55930898025031d5fe5ba326149
@@ -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}"
@@ -5,8 +5,16 @@ module Cocina
5
5
  class Access < Struct
6
6
  # Access level
7
7
  attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
8
+ # The human readable copyright statement that applies
9
+ # example: Copyright World Trade Organization
10
+ attribute :copyright, Types::Strict::String.meta(omittable: true)
8
11
  # If access is "location-based", which location should have access.
9
12
  attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
13
+ # The human readable use and reproduction statement that applies
14
+ # 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).
15
+ attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
16
+ # The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
17
+ attribute :license, Types::Strict::String.meta(omittable: true)
10
18
  end
11
19
  end
12
20
  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.2'
5
+ VERSION = '0.57.0'
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
@@ -108,6 +108,10 @@ components:
108
108
  - 'citation-only'
109
109
  - 'dark'
110
110
  default: 'dark'
111
+ copyright:
112
+ description: The human readable copyright statement that applies
113
+ example: Copyright World Trade Organization
114
+ type: string
111
115
  readLocation:
112
116
  description: If access is "location-based", which location should have access.
113
117
  type: string
@@ -118,6 +122,13 @@ components:
118
122
  - 'art'
119
123
  - 'hoover'
120
124
  - 'm&m'
125
+ useAndReproductionStatement:
126
+ description: The human readable use and reproduction statement that applies
127
+ 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).
128
+ type: string
129
+ license:
130
+ description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
131
+ type: string
121
132
  AccessRole:
122
133
  description: Access role conferred by an AdminPolicy to objects within it. (used by Argo)
123
134
  type: object
@@ -214,7 +225,11 @@ components:
214
225
  properties:
215
226
  defaultObjectRights:
216
227
  type: string
228
+ description: This is an XML expression of the default access (see defaultAccess)
229
+ deprecated: true
217
230
  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>
231
+ defaultAccess:
232
+ $ref: '#/components/schemas/AdminPolicyDefaultAccess'
218
233
  registrationWorkflow:
219
234
  description: When you register an item with this admin policy, these are the workflows that are available.
220
235
  type: array
@@ -229,15 +244,70 @@ components:
229
244
  type: array
230
245
  items:
231
246
  type: string
247
+ hasAdminPolicy:
248
+ $ref: '#/components/schemas/Druid'
249
+ referencesAgreement:
250
+ $ref: '#/components/schemas/Druid'
232
251
  roles:
233
252
  description: The access roles conferred by this AdminPolicy (used by Argo)
234
253
  type: array
235
254
  items:
236
255
  $ref: '#/components/schemas/AccessRole'
237
- hasAdminPolicy:
238
- type: string
239
256
  required:
240
257
  - hasAdminPolicy
258
+ AdminPolicyDefaultAccess:
259
+ 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.'
260
+ type: object
261
+ additionalProperties: false
262
+ properties:
263
+ access:
264
+ type: string
265
+ enum:
266
+ - 'world'
267
+ - 'stanford'
268
+ - 'location-based'
269
+ - 'citation-only'
270
+ - 'dark'
271
+ controlledDigitalLending:
272
+ description: Available for controlled digital lending.
273
+ type: boolean
274
+ copyright:
275
+ description: The human readable copyright statement that applies
276
+ example: Copyright World Trade Organization
277
+ type: string
278
+ download:
279
+ description: >
280
+ Download access level. This is used in the transition from Fedora as
281
+ a way to set a default download level at registration that is copied
282
+ down to all the files.
283
+
284
+ type: string
285
+ enum:
286
+ - 'world'
287
+ - 'stanford'
288
+ - 'location-based'
289
+ - 'none'
290
+ readLocation:
291
+ description: >
292
+ If access is "location-based", which location should have access.
293
+ This is used in the transition from Fedora as a way to set a default
294
+ readLocation at registration that is copied down to all the files.
295
+
296
+ type: string
297
+ enum:
298
+ - 'spec'
299
+ - 'music'
300
+ - 'ars'
301
+ - 'art'
302
+ - 'hoover'
303
+ - 'm&m'
304
+ useAndReproductionStatement:
305
+ description: The human readable use and reproduction statement that applies
306
+ 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).
307
+ type: string
308
+ license:
309
+ description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
310
+ type: string
241
311
  AppliesTo:
242
312
  description: Property model for indicating the parts, aspects, or versions of the resource to which a
243
313
  descriptive element is applicable.
@@ -248,6 +318,17 @@ components:
248
318
  type: array
249
319
  items:
250
320
  $ref: "#/components/schemas/DescriptiveBasicValue"
321
+ Barcode:
322
+ description: 'A barcode'
323
+ oneOf:
324
+ - $ref: '#/components/schemas/BusinessBarcode'
325
+ - $ref: '#/components/schemas/CatkeyBarcode'
326
+ - $ref: '#/components/schemas/StandardBarcode'
327
+ BusinessBarcode:
328
+ description: The barcode associated with a business library DRO object, prefixed with 2050
329
+ type: string
330
+ pattern: '^2050[0-9]{7}$'
331
+ example: 20503740296
251
332
  CatalogLink:
252
333
  type: object
253
334
  additionalProperties: false
@@ -263,6 +344,11 @@ components:
263
344
  description: Record identifier that is unique within the context of the linked record's catalog.
264
345
  type: string
265
346
  example: 11403803
347
+ CatkeyBarcode:
348
+ description: The barcode associated with a DRO object based on catkey, prefixed with 36105
349
+ type: string
350
+ pattern: '^[0-9]+-[0-9]+$'
351
+ example: 6772719-1001
266
352
  Collection:
267
353
  description: A group of Digital Repository Objects that indicate some type of conceptual grouping within the domain that is worth reusing across the system.
268
354
  type: object
@@ -347,6 +433,11 @@ components:
347
433
  valueAt:
348
434
  description: URL or other pointer to the location of the contributor information.
349
435
  type: string
436
+ parallelContributor:
437
+ description: For multiple representations of information about the same contributor (e.g. in different languages).
438
+ type: array
439
+ items:
440
+ $ref: "#/components/schemas/DescriptiveParallelContributor"
350
441
  Description:
351
442
  type: object
352
443
  additionalProperties: false
@@ -581,6 +672,43 @@ components:
581
672
  type: array
582
673
  items:
583
674
  $ref: "#/components/schemas/DescriptiveValue"
675
+ DescriptiveParallelContributor:
676
+ description: Value model for multiple representations of information about the same contributor (e.g. in different languages).
677
+ type: object
678
+ additionalProperties: false
679
+ properties:
680
+ name:
681
+ description: Names associated with a contributor.
682
+ type: array
683
+ items:
684
+ $ref: "#/components/schemas/DescriptiveValue"
685
+ type:
686
+ description: Entity type of the contributor (person, organization, etc.).
687
+ type: string
688
+ status:
689
+ description: Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
690
+ type: string
691
+ role:
692
+ description: Relationships of the contributor to the resource or to an event in its history.
693
+ type: array
694
+ items:
695
+ $ref: "#/components/schemas/DescriptiveValue"
696
+ identifier:
697
+ description: Identifiers and URIs associated with the contributor entity.
698
+ type: array
699
+ items:
700
+ $ref: "#/components/schemas/DescriptiveValue"
701
+ note:
702
+ description: Other information associated with the contributor.
703
+ type: array
704
+ items:
705
+ $ref: "#/components/schemas/DescriptiveValue"
706
+ valueAt:
707
+ description: URL or other pointer to the location of the contributor information.
708
+ type: string
709
+ valueLanguage:
710
+ # description: Language of the descriptive element value
711
+ $ref: "#/components/schemas/DescriptiveValueLanguage"
584
712
  DescriptiveParallelEvent:
585
713
  description: Value model for multiple representations of information about the same event (e.g. in different languages).
586
714
  type: object
@@ -767,6 +895,9 @@ components:
767
895
  description: The human readable use and reproduction statement that applies
768
896
  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).
769
897
  type: string
898
+ license:
899
+ description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
900
+ type: string
770
901
  DROStructural:
771
902
  description: Structural metadata
772
903
  type: object
@@ -981,7 +1112,22 @@ components:
981
1112
  description: The content type of the Fileset.
982
1113
  type: string
983
1114
  enum:
984
- - 'http://cocina.sul.stanford.edu/models/fileset.jsonld'
1115
+ - 'http://cocina.sul.stanford.edu/models/resources/audio.jsonld'
1116
+ - 'http://cocina.sul.stanford.edu/models/resources/attachment.jsonld'
1117
+ - 'http://cocina.sul.stanford.edu/models/resources/document.jsonld'
1118
+ - 'http://cocina.sul.stanford.edu/models/resources/file.jsonld'
1119
+ - 'http://cocina.sul.stanford.edu/models/resources/image.jsonld'
1120
+ - 'http://cocina.sul.stanford.edu/models/resources/main-augmented.jsonld'
1121
+ - 'http://cocina.sul.stanford.edu/models/resources/main-original.jsonld'
1122
+ - 'http://cocina.sul.stanford.edu/models/resources/media.jsonld'
1123
+ - 'http://cocina.sul.stanford.edu/models/resources/object.jsonld'
1124
+ - 'http://cocina.sul.stanford.edu/models/resources/page.jsonld'
1125
+ - 'http://cocina.sul.stanford.edu/models/resources/permissions.jsonld'
1126
+ - 'http://cocina.sul.stanford.edu/models/resources/preview.jsonld'
1127
+ - 'http://cocina.sul.stanford.edu/models/resources/supplement.jsonld'
1128
+ - 'http://cocina.sul.stanford.edu/models/resources/3d.jsonld'
1129
+ - 'http://cocina.sul.stanford.edu/models/resources/thumb.jsonld'
1130
+ - 'http://cocina.sul.stanford.edu/models/resources/video.jsonld'
985
1131
  externalIdentifier:
986
1132
  type: string
987
1133
  label:
@@ -1026,6 +1172,8 @@ components:
1026
1172
  type: array
1027
1173
  items:
1028
1174
  $ref: '#/components/schemas/CatalogLink'
1175
+ barcode:
1176
+ $ref: '#/components/schemas/Barcode'
1029
1177
  Language:
1030
1178
  description: Languages, scripts, symbolic systems, and notations used in all
1031
1179
  or part of a resource or its descriptive metadata.
@@ -1398,7 +1546,22 @@ components:
1398
1546
  type:
1399
1547
  type: string
1400
1548
  enum:
1401
- - 'http://cocina.sul.stanford.edu/models/fileset.jsonld'
1549
+ - 'http://cocina.sul.stanford.edu/models/resources/audio.jsonld'
1550
+ - 'http://cocina.sul.stanford.edu/models/resources/attachment.jsonld'
1551
+ - 'http://cocina.sul.stanford.edu/models/resources/document.jsonld'
1552
+ - 'http://cocina.sul.stanford.edu/models/resources/file.jsonld'
1553
+ - 'http://cocina.sul.stanford.edu/models/resources/image.jsonld'
1554
+ - 'http://cocina.sul.stanford.edu/models/resources/main-augmented.jsonld'
1555
+ - 'http://cocina.sul.stanford.edu/models/resources/main-original.jsonld'
1556
+ - 'http://cocina.sul.stanford.edu/models/resources/media.jsonld'
1557
+ - 'http://cocina.sul.stanford.edu/models/resources/object.jsonld'
1558
+ - 'http://cocina.sul.stanford.edu/models/resources/page.jsonld'
1559
+ - 'http://cocina.sul.stanford.edu/models/resources/permissions.jsonld'
1560
+ - 'http://cocina.sul.stanford.edu/models/resources/preview.jsonld'
1561
+ - 'http://cocina.sul.stanford.edu/models/resources/supplement.jsonld'
1562
+ - 'http://cocina.sul.stanford.edu/models/resources/3d.jsonld'
1563
+ - 'http://cocina.sul.stanford.edu/models/resources/thumb.jsonld'
1564
+ - 'http://cocina.sul.stanford.edu/models/resources/video.jsonld'
1402
1565
  label:
1403
1566
  type: string
1404
1567
  version:
@@ -1430,6 +1593,8 @@ components:
1430
1593
  type: array
1431
1594
  items:
1432
1595
  $ref: '#/components/schemas/CatalogLink'
1596
+ barcode:
1597
+ $ref: '#/components/schemas/Barcode'
1433
1598
  required:
1434
1599
  - sourceId
1435
1600
  Sequence:
@@ -1509,6 +1674,11 @@ components:
1509
1674
  type: string
1510
1675
  source:
1511
1676
  $ref: "#/components/schemas/Source"
1677
+ StandardBarcode:
1678
+ description: The standard barcode associated with a DRO object, prefixed with 36105
1679
+ type: string
1680
+ pattern: '^36105[0-9]{9}$'
1681
+ example: 36105010362304
1512
1682
  Title:
1513
1683
  type: object
1514
1684
  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.2
4
+ version: 0.57.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-11 00:00:00.000000000 Z
11
+ date: 2021-03-30 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
@@ -325,11 +330,11 @@ 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
337
+ rubygems_version: 3.2.2
333
338
  signing_key:
334
339
  specification_version: 4
335
340
  summary: Data models for the SDR