cocina-models 0.58.1 → 0.61.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +2 -0
  3. data/.rubocop_todo.yml +5 -5
  4. data/README.md +34 -24
  5. data/lib/cocina/generator/schema.rb +30 -2
  6. data/lib/cocina/generator/schema_array.rb +1 -1
  7. data/lib/cocina/generator/schema_base.rb +18 -8
  8. data/lib/cocina/generator/schema_ref.rb +1 -1
  9. data/lib/cocina/generator/schema_value.rb +2 -2
  10. data/lib/cocina/models/access.rb +10 -11
  11. data/lib/cocina/models/admin_policy.rb +0 -1
  12. data/lib/cocina/models/admin_policy_administrative.rb +3 -3
  13. data/lib/cocina/models/admin_policy_default_access.rb +3 -3
  14. data/lib/cocina/models/administrative.rb +1 -1
  15. data/lib/cocina/models/citation_only_access.rb +15 -0
  16. data/lib/cocina/models/collection.rb +1 -2
  17. data/lib/cocina/models/collection_access.rb +18 -0
  18. data/lib/cocina/models/collection_identification.rb +2 -2
  19. data/lib/cocina/models/contributor.rb +3 -3
  20. data/lib/cocina/models/controlled_digital_lending_access.rb +16 -0
  21. data/lib/cocina/models/dark_access.rb +15 -0
  22. data/lib/cocina/models/description.rb +3 -3
  23. data/lib/cocina/models/descriptive_basic_value.rb +8 -8
  24. data/lib/cocina/models/descriptive_parallel_contributor.rb +3 -3
  25. data/lib/cocina/models/descriptive_parallel_event.rb +2 -2
  26. data/lib/cocina/models/descriptive_value.rb +8 -8
  27. data/lib/cocina/models/descriptive_value_language.rb +4 -4
  28. data/lib/cocina/models/doi.rb +9 -0
  29. data/lib/cocina/models/dro.rb +0 -1
  30. data/lib/cocina/models/dro_access.rb +12 -10
  31. data/lib/cocina/models/dro_structural.rb +1 -1
  32. data/lib/cocina/models/embargo.rb +12 -3
  33. data/lib/cocina/models/event.rb +2 -2
  34. data/lib/cocina/models/file.rb +3 -3
  35. data/lib/cocina/models/file_access.rb +10 -7
  36. data/lib/cocina/models/identification.rb +7 -4
  37. data/lib/cocina/models/lane_medical_barcode.rb +9 -0
  38. data/lib/cocina/models/language.rb +7 -7
  39. data/lib/cocina/models/location_based_access.rb +15 -0
  40. data/lib/cocina/models/location_based_download_access.rb +15 -0
  41. data/lib/cocina/models/presentation.rb +2 -2
  42. data/lib/cocina/models/purl.rb +9 -0
  43. data/lib/cocina/models/related_resource.rb +7 -7
  44. data/lib/cocina/models/release_tag.rb +4 -4
  45. data/lib/cocina/models/request_admin_policy.rb +0 -1
  46. data/lib/cocina/models/request_collection.rb +1 -2
  47. data/lib/cocina/models/request_dro.rb +0 -1
  48. data/lib/cocina/models/request_dro_structural.rb +1 -1
  49. data/lib/cocina/models/request_file.rb +4 -4
  50. data/lib/cocina/models/request_identification.rb +6 -3
  51. data/lib/cocina/models/sequence.rb +1 -1
  52. data/lib/cocina/models/source.rb +4 -4
  53. data/lib/cocina/models/standard.rb +4 -4
  54. data/lib/cocina/models/stanford_access.rb +15 -0
  55. data/lib/cocina/models/title.rb +8 -8
  56. data/lib/cocina/models/version.rb +1 -1
  57. data/lib/cocina/models/world_access.rb +15 -0
  58. data/openapi.yml +351 -172
  59. metadata +13 -2
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class LocationBasedDownloadAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.enum('stanford', 'world')
8
+ # Download access level.
9
+ attribute :download, Types::Strict::String.enum('location-based')
10
+ # If access is "location-based", which location should have access.
11
+ attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m')
12
+ attribute :controlledDigitalLending, Types::Strict::Bool.enum(false).meta(omittable: true)
13
+ end
14
+ end
15
+ end
@@ -4,9 +4,9 @@ module Cocina
4
4
  module Models
5
5
  class Presentation < Struct
6
6
  # Height in pixels
7
- attribute :height, Types::Strict::Integer.optional.meta(omittable: true)
7
+ attribute :height, Types::Strict::Integer.meta(omittable: true)
8
8
  # Width in pixels
9
- attribute :width, Types::Strict::Integer.optional.meta(omittable: true)
9
+ attribute :width, Types::Strict::Integer.meta(omittable: true)
10
10
  end
11
11
  end
12
12
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ Purl = Types::String.constrained(
6
+ format: %r{^http://}i
7
+ )
8
+ end
9
+ end
@@ -4,11 +4,11 @@ module Cocina
4
4
  module Models
5
5
  class RelatedResource < Struct
6
6
  # The relationship of the related resource to the described resource.
7
- attribute :type, Types::Strict::String.optional.meta(omittable: true)
7
+ attribute :type, Types::Strict::String.meta(omittable: true)
8
8
  # Status of the related resource relative to other related resources.
9
- attribute :status, Types::Strict::String.optional.meta(omittable: true)
9
+ attribute :status, Types::Strict::String.meta(omittable: true)
10
10
  # The preferred display label to use for the related resource in access systems.
11
- attribute :displayLabel, Types::Strict::String.optional.meta(omittable: true)
11
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
12
12
  attribute :title, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
14
14
  attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
@@ -18,15 +18,15 @@ module Cocina
18
18
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
19
19
  attribute :standard, Standard.optional.meta(omittable: true)
20
20
  attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
21
- # Stanford persistent URL associated with the related resource.
22
- attribute :purl, Types::Strict::String.optional.meta(omittable: true)
21
+ # Stanford persistent URL associated with the related resource. Note this is http, not https.
22
+ attribute :purl, Types::Strict::String.meta(omittable: true)
23
23
  attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
24
24
  attribute :relatedResource, Types::Strict::Array.of(RelatedResource).meta(omittable: true)
25
25
  attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
26
26
  # The version of the related resource.
27
- attribute :version, Types::Strict::String.optional.meta(omittable: true)
27
+ attribute :version, Types::Strict::String.meta(omittable: true)
28
28
  # URL or other pointer to the location of the related resource information.
29
- attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
29
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
30
30
  end
31
31
  end
32
32
  end
@@ -5,15 +5,15 @@ module Cocina
5
5
  class ReleaseTag < Struct
6
6
  # Who did this release
7
7
  # example: petucket
8
- attribute :who, Types::Strict::String.optional.meta(omittable: true)
8
+ attribute :who, Types::Strict::String.meta(omittable: true)
9
9
  # What is being released. This item or the whole collection.
10
10
  # example: self
11
- attribute :what, Types::Strict::String.optional.enum('self', 'collection').meta(omittable: true)
11
+ attribute :what, Types::Strict::String.enum('self', 'collection').meta(omittable: true)
12
12
  # When did this action happen
13
- attribute :date, Types::Params::DateTime.optional.meta(omittable: true)
13
+ attribute :date, Types::Params::DateTime.meta(omittable: true)
14
14
  # What platform is it released to
15
15
  # example: Searchworks
16
- attribute :to, Types::Strict::String.optional.meta(omittable: true)
16
+ attribute :to, Types::Strict::String.meta(omittable: true)
17
17
  attribute :release, Types::Strict::Bool.default(false)
18
18
  end
19
19
  end
@@ -7,7 +7,6 @@ module Cocina
7
7
 
8
8
  TYPES = ['http://cocina.sul.stanford.edu/models/admin_policy.jsonld'].freeze
9
9
 
10
- # example: item
11
10
  attribute :type, Types::Strict::String.enum(*RequestAdminPolicy::TYPES)
12
11
  attribute :label, Types::Strict::String
13
12
  attribute :version, Types::Strict::Integer
@@ -11,11 +11,10 @@ module Cocina
11
11
  'http://cocina.sul.stanford.edu/models/exhibit.jsonld',
12
12
  'http://cocina.sul.stanford.edu/models/series.jsonld'].freeze
13
13
 
14
- # example: item
15
14
  attribute :type, Types::Strict::String.enum(*RequestCollection::TYPES)
16
15
  attribute :label, Types::Strict::String
17
16
  attribute :version, Types::Strict::Integer
18
- attribute(:access, Access.default { Access.new })
17
+ attribute(:access, CollectionAccess.default { CollectionAccess.new })
19
18
  attribute(:administrative, Administrative.default { Administrative.new })
20
19
  attribute :description, Description.optional.meta(omittable: true)
21
20
  attribute :identification, CollectionIdentification.optional.meta(omittable: true)
@@ -21,7 +21,6 @@ module Cocina
21
21
  'http://cocina.sul.stanford.edu/models/webarchive-binary.jsonld',
22
22
  'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'].freeze
23
23
 
24
- # example: item
25
24
  attribute :type, Types::Strict::String.enum(*RequestDRO::TYPES)
26
25
  attribute :label, Types::Strict::String
27
26
  attribute :version, Types::Strict::Integer
@@ -6,7 +6,7 @@ module Cocina
6
6
  attribute :contains, Types::Strict::Array.of(RequestFileSet).meta(omittable: true)
7
7
  attribute :hasMemberOrders, Types::Strict::Array.of(Sequence).meta(omittable: true)
8
8
  attribute :isMemberOf, Types::Strict::Array.of(Druid).meta(omittable: true)
9
- attribute :hasAgreement, Types::Strict::String.optional.meta(omittable: true)
9
+ attribute :hasAgreement, Types::Strict::String.meta(omittable: true)
10
10
  end
11
11
  end
12
12
  end
@@ -10,11 +10,11 @@ module Cocina
10
10
  attribute :type, Types::Strict::String.enum(*RequestFile::TYPES)
11
11
  attribute :label, Types::Strict::String
12
12
  attribute :filename, Types::Strict::String
13
- attribute :size, Types::Strict::Integer.optional.meta(omittable: true)
13
+ attribute :size, Types::Strict::Integer.meta(omittable: true)
14
14
  attribute :version, Types::Strict::Integer
15
- attribute :hasMimeType, Types::Strict::String.optional.meta(omittable: true)
16
- attribute :externalIdentifier, Types::Strict::String.optional.meta(omittable: true)
17
- attribute :use, Types::Strict::String.optional.meta(omittable: true)
15
+ attribute :hasMimeType, Types::Strict::String.meta(omittable: true)
16
+ attribute :externalIdentifier, Types::Strict::String.meta(omittable: true)
17
+ attribute :use, Types::Strict::String.meta(omittable: true)
18
18
  attribute :hasMessageDigests, Types::Strict::Array.of(MessageDigest).default([].freeze)
19
19
  attribute(:access, FileAccess.default { FileAccess.new })
20
20
  attribute(:administrative, FileAdministrative.default { FileAdministrative.new })
@@ -3,13 +3,16 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class RequestIdentification < Struct
6
+ # A barcode
7
+ attribute :barcode, Types::Nominal::Any.meta(omittable: true)
8
+ attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
9
+ # Digital Object Identifier (https://www.doi.org)
10
+ # example: 10.25740/druid:bc123df4567
11
+ attribute :doi, Types::Strict::String.meta(omittable: true)
6
12
  # 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
13
 
8
14
  # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
9
15
  attribute :sourceId, Types::Strict::String
10
- attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
11
- # A barcode
12
- attribute :barcode, Types::Nominal::Any.optional.meta(omittable: true)
13
16
  end
14
17
  end
15
18
  end
@@ -5,7 +5,7 @@ module Cocina
5
5
  class Sequence < Struct
6
6
  attribute :members, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
7
7
  # The direction that a sequence of canvases should be displayed to the user
8
- attribute :viewingDirection, Types::Strict::String.optional.enum('right-to-left', 'left-to-right').meta(omittable: true)
8
+ attribute :viewingDirection, Types::Strict::String.enum('right-to-left', 'left-to-right').meta(omittable: true)
9
9
  end
10
10
  end
11
11
  end
@@ -4,14 +4,14 @@ module Cocina
4
4
  module Models
5
5
  class Source < Struct
6
6
  # Code representing the value source.
7
- attribute :code, Types::Strict::String.optional.meta(omittable: true)
7
+ attribute :code, Types::Strict::String.meta(omittable: true)
8
8
  # URI for the value source.
9
- attribute :uri, Types::Strict::String.optional.meta(omittable: true)
9
+ attribute :uri, Types::Strict::String.meta(omittable: true)
10
10
  # String describing the value source.
11
- attribute :value, Types::Strict::String.optional.meta(omittable: true)
11
+ attribute :value, Types::Strict::String.meta(omittable: true)
12
12
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  # The version of the value source.
14
- attribute :version, Types::Strict::String.optional.meta(omittable: true)
14
+ attribute :version, Types::Strict::String.meta(omittable: true)
15
15
  end
16
16
  end
17
17
  end
@@ -4,14 +4,14 @@ module Cocina
4
4
  module Models
5
5
  class Standard < Struct
6
6
  # Code representing the standard or encoding.
7
- attribute :code, Types::Strict::String.optional.meta(omittable: true)
7
+ attribute :code, Types::Strict::String.meta(omittable: true)
8
8
  # URI for the standard or encoding.
9
- attribute :uri, Types::Strict::String.optional.meta(omittable: true)
9
+ attribute :uri, Types::Strict::String.meta(omittable: true)
10
10
  # String describing the standard or encoding.
11
- attribute :value, Types::Strict::String.optional.meta(omittable: true)
11
+ attribute :value, Types::Strict::String.meta(omittable: true)
12
12
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  # The version of the standard or encoding.
14
- attribute :version, Types::Strict::String.optional.meta(omittable: true)
14
+ attribute :version, Types::Strict::String.meta(omittable: true)
15
15
  attribute :source, Source.optional.meta(omittable: true)
16
16
  end
17
17
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class StanfordAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.enum('stanford')
8
+ # Download access level.
9
+ attribute :download, Types::Strict::String.enum('stanford')
10
+ # If access is "location-based", which location should have access.
11
+ attribute :readLocation, Types::Strict::String.optional.enum('').meta(omittable: true)
12
+ attribute :controlledDigitalLending, Types::Strict::Bool.enum(false).meta(omittable: true)
13
+ end
14
+ end
15
+ end
@@ -7,27 +7,27 @@ module Cocina
7
7
  attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
8
8
  attribute :groupedValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
9
9
  # String or integer value of the descriptive element.
10
- attribute :value, Types::Nominal::Any.optional.meta(omittable: true)
10
+ attribute :value, Types::Nominal::Any.meta(omittable: true)
11
11
  # Type of value provided by the descriptive element.
12
- attribute :type, Types::Strict::String.optional.meta(omittable: true)
12
+ attribute :type, Types::Strict::String.meta(omittable: true)
13
13
  # Status of the descriptive element value relative to other instances of the element.
14
- attribute :status, Types::Strict::String.optional.meta(omittable: true)
14
+ attribute :status, Types::Strict::String.meta(omittable: true)
15
15
  # Code value of the descriptive element.
16
- attribute :code, Types::Strict::String.optional.meta(omittable: true)
16
+ attribute :code, Types::Strict::String.meta(omittable: true)
17
17
  # URI value of the descriptive element.
18
- attribute :uri, Types::Strict::String.optional.meta(omittable: true)
18
+ attribute :uri, Types::Strict::String.meta(omittable: true)
19
19
  attribute :standard, Standard.optional.meta(omittable: true)
20
20
  attribute :encoding, Standard.optional.meta(omittable: true)
21
21
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
22
22
  attribute :source, Source.optional.meta(omittable: true)
23
23
  # The preferred display label to use for the descriptive element in access systems.
24
- attribute :displayLabel, Types::Strict::String.optional.meta(omittable: true)
24
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
25
25
  # A term providing information about the circumstances of the statement (e.g., approximate dates).
26
- attribute :qualifier, Types::Strict::String.optional.meta(omittable: true)
26
+ attribute :qualifier, Types::Strict::String.meta(omittable: true)
27
27
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
28
28
  attribute :valueLanguage, DescriptiveValueLanguage.optional.meta(omittable: true)
29
29
  # URL or other pointer to the location of the value of the descriptive element.
30
- attribute :valueAt, Types::Strict::String.optional.meta(omittable: true)
30
+ attribute :valueAt, Types::Strict::String.meta(omittable: true)
31
31
  attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
32
32
  end
33
33
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.58.1'
5
+ VERSION = '0.61.0'
6
6
  end
7
7
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class WorldAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.enum('world')
8
+ # Download access level.
9
+ attribute :download, Types::Strict::String.enum('none', 'stanford', 'world')
10
+ # If access is "location-based", which location should have access.
11
+ attribute :readLocation, Types::Strict::String.optional.enum('').meta(omittable: true)
12
+ attribute :controlledDigitalLending, Types::Strict::Bool.enum(false).meta(omittable: true)
13
+ end
14
+ end
15
+ end
data/openapi.yml CHANGED
@@ -94,41 +94,16 @@ paths:
94
94
  components:
95
95
  schemas:
96
96
  Access:
97
- description: Access metadata for collections
98
97
  type: object
99
- additionalProperties: false
100
- properties:
101
- access:
102
- description: Access level
103
- type: string
104
- enum:
105
- - 'world'
106
- - 'stanford'
107
- - 'location-based'
108
- - 'citation-only'
109
- - 'dark'
110
- default: 'dark'
111
- copyright:
112
- description: The human readable copyright statement that applies
113
- example: Copyright World Trade Organization
114
- type: string
115
- readLocation:
116
- description: If access is "location-based", which location should have access.
117
- type: string
118
- enum:
119
- - 'spec'
120
- - 'music'
121
- - 'ars'
122
- - 'art'
123
- - 'hoover'
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
98
+ oneOf:
99
+ # Being first, makes DarkAccess the default.
100
+ - $ref: '#/components/schemas/DarkAccess'
101
+ - $ref: '#/components/schemas/CitationOnlyAccess'
102
+ - $ref: '#/components/schemas/ControlledDigitalLendingAccess'
103
+ - $ref: '#/components/schemas/LocationBasedAccess'
104
+ - $ref: '#/components/schemas/LocationBasedDownloadAccess'
105
+ - $ref: '#/components/schemas/StanfordAccess'
106
+ - $ref: '#/components/schemas/WorldAccess'
132
107
  AccessRole:
133
108
  description: Access role conferred by an AdminPolicy to objects within it. (used by Argo)
134
109
  type: object
@@ -201,7 +176,6 @@ components:
201
176
  type: string
202
177
  enum:
203
178
  - 'http://cocina.sul.stanford.edu/models/admin_policy.jsonld'
204
- example: item
205
179
  externalIdentifier:
206
180
  $ref: '#/components/schemas/Druid'
207
181
  label:
@@ -275,6 +249,7 @@ components:
275
249
  description: The human readable copyright statement that applies
276
250
  example: Copyright World Trade Organization
277
251
  type: string
252
+ nullable: true
278
253
  download:
279
254
  description: >
280
255
  Download access level. This is used in the transition from Fedora as
@@ -294,6 +269,7 @@ components:
294
269
  readLocation at registration that is copied down to all the files.
295
270
 
296
271
  type: string
272
+ nullable: true
297
273
  enum:
298
274
  - 'spec'
299
275
  - 'music'
@@ -305,9 +281,11 @@ components:
305
281
  description: The human readable use and reproduction statement that applies
306
282
  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
283
  type: string
284
+ nullable: true
308
285
  license:
309
286
  description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
310
287
  type: string
288
+ nullable: true
311
289
  AppliesTo:
312
290
  description: Property model for indicating the parts, aspects, or versions of the resource to which a
313
291
  descriptive element is applicable.
@@ -322,13 +300,19 @@ components:
322
300
  description: 'A barcode'
323
301
  oneOf:
324
302
  - $ref: '#/components/schemas/BusinessBarcode'
303
+ - $ref: '#/components/schemas/LaneMedicalBarcode'
325
304
  - $ref: '#/components/schemas/CatkeyBarcode'
326
305
  - $ref: '#/components/schemas/StandardBarcode'
327
306
  BusinessBarcode:
328
307
  description: The barcode associated with a business library DRO object, prefixed with 2050
329
308
  type: string
330
309
  pattern: '^2050[0-9]{7}$'
331
- example: 20503740296
310
+ example: '20503740296'
311
+ LaneMedicalBarcode:
312
+ description: The barcode associated with a Lane Medical Library DRO object, prefixed with 245
313
+ type: string
314
+ pattern: '^245[0-9]{8}$'
315
+ example: '24503259768'
332
316
  CatalogLink:
333
317
  type: object
334
318
  additionalProperties: false
@@ -343,12 +327,39 @@ components:
343
327
  catalogRecordId:
344
328
  description: Record identifier that is unique within the context of the linked record's catalog.
345
329
  type: string
346
- example: 11403803
330
+ example: '11403803'
347
331
  CatkeyBarcode:
348
332
  description: The barcode associated with a DRO object based on catkey, prefixed with 36105
349
333
  type: string
350
334
  pattern: '^[0-9]+-[0-9]+$'
351
- example: 6772719-1001
335
+ example: '6772719-1001'
336
+ CitationOnlyAccess:
337
+ type: object
338
+ properties:
339
+ access:
340
+ description: Access level.
341
+ type: string
342
+ enum:
343
+ - citation-only
344
+ download:
345
+ description: Download access level.
346
+ type: string
347
+ enum:
348
+ - 'none'
349
+ readLocation:
350
+ description: If access is "location-based", which location should have access.
351
+ type: string
352
+ nullable: true
353
+ enum:
354
+ - null
355
+ controlledDigitalLending:
356
+ type: boolean
357
+ default: false
358
+ enum:
359
+ - false
360
+ required:
361
+ - access
362
+ - download
352
363
  Collection:
353
364
  description: A group of Digital Repository Objects that indicate some type of conceptual grouping within the domain that is worth reusing across the system.
354
365
  type: object
@@ -363,7 +374,6 @@ components:
363
374
  - 'http://cocina.sul.stanford.edu/models/user-collection.jsonld'
364
375
  - 'http://cocina.sul.stanford.edu/models/exhibit.jsonld'
365
376
  - 'http://cocina.sul.stanford.edu/models/series.jsonld'
366
- example: item
367
377
  externalIdentifier:
368
378
  $ref: '#/components/schemas/Druid'
369
379
  label:
@@ -373,7 +383,7 @@ components:
373
383
  description: Version for the Collection within SDR.
374
384
  type: integer
375
385
  access:
376
- $ref: '#/components/schemas/Access'
386
+ $ref: '#/components/schemas/CollectionAccess'
377
387
  administrative:
378
388
  $ref: '#/components/schemas/Administrative'
379
389
  description:
@@ -386,16 +396,40 @@ components:
386
396
  - type
387
397
  - version
388
398
  - access
399
+ CollectionAccess:
400
+ description: Access metadata for collections
401
+ type: object
402
+ additionalProperties: false
403
+ properties:
404
+ access:
405
+ description: Access level
406
+ type: string
407
+ enum:
408
+ - 'world'
409
+ - 'dark'
410
+ default: 'dark'
411
+ copyright:
412
+ description: The human readable copyright statement that applies
413
+ example: Copyright World Trade Organization
414
+ type: string
415
+ nullable: true
416
+ useAndReproductionStatement:
417
+ description: The human readable use and reproduction statement that applies
418
+ 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).
419
+ type: string
420
+ license:
421
+ description: The license governing reuse of the Collection. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
422
+ type: string
389
423
  CollectionIdentification:
390
424
  type: object
391
425
  additionalProperties: false
392
426
  properties:
393
- sourceId:
394
- $ref: '#/components/schemas/SourceId'
395
427
  catalogLinks:
396
428
  type: array
397
429
  items:
398
430
  $ref: '#/components/schemas/CatalogLink'
431
+ sourceId:
432
+ $ref: '#/components/schemas/SourceId'
399
433
  Contributor:
400
434
  description: Property model for describing agents contributing in some way to
401
435
  the creation and history of the resource.
@@ -438,6 +472,60 @@ components:
438
472
  type: array
439
473
  items:
440
474
  $ref: "#/components/schemas/DescriptiveParallelContributor"
475
+ ControlledDigitalLendingAccess:
476
+ type: object
477
+ properties:
478
+ access:
479
+ description: Access level.
480
+ type: string
481
+ enum:
482
+ - stanford
483
+ download:
484
+ description: Download access level.
485
+ type: string
486
+ enum:
487
+ - none
488
+ readLocation:
489
+ description: If access is "location-based", which location should have access.
490
+ type: string
491
+ nullable: true
492
+ enum:
493
+ - null
494
+ controlledDigitalLending:
495
+ description: Available for controlled digital lending.
496
+ type: boolean
497
+ default: false
498
+ required:
499
+ - access
500
+ - download
501
+ - controlledDigitalLending
502
+ DarkAccess:
503
+ type: object
504
+ properties:
505
+ access:
506
+ description: Access level.
507
+ type: string
508
+ default: 'dark'
509
+ enum:
510
+ - dark
511
+ download:
512
+ description: Download access level.
513
+ type: string
514
+ default: 'none'
515
+ enum:
516
+ - 'none'
517
+ readLocation:
518
+ description: If access is "location-based", which location should have access.
519
+ type: string
520
+ nullable: true
521
+ default: null
522
+ enum:
523
+ - null
524
+ controlledDigitalLending:
525
+ type: boolean
526
+ default: false
527
+ enum:
528
+ - false
441
529
  Description:
442
530
  type: object
443
531
  additionalProperties: false
@@ -492,9 +580,7 @@ components:
492
580
  items:
493
581
  $ref: "#/components/schemas/DescriptiveValue"
494
582
  purl:
495
- description: Stanford persistent URL associated with the resource.
496
- type: string
497
- format: uri
583
+ $ref: "#/components/schemas/Purl"
498
584
  access:
499
585
  $ref: "#/components/schemas/DescriptiveAccessMetadata"
500
586
  relatedResource:
@@ -789,6 +875,11 @@ components:
789
875
  $ref: '#/components/schemas/Standard'
790
876
  # description: An alphabet or other notation used to represent a
791
877
  # language or other symbolic system of the descriptive element value.
878
+ DOI:
879
+ type: string
880
+ description: Digital Object Identifier (https://www.doi.org)
881
+ pattern: '^10\.25740\/druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$'
882
+ example: '10.25740/druid:bc123df4567'
792
883
  DRO:
793
884
  description: Domain-defined abstraction of a 'work'. Digital Repository Objects' abstraction is describable for our domain’s purposes, i.e. for management needs within our system.
794
885
  type: object
@@ -813,7 +904,6 @@ components:
813
904
  - 'http://cocina.sul.stanford.edu/models/track.jsonld'
814
905
  - 'http://cocina.sul.stanford.edu/models/webarchive-binary.jsonld'
815
906
  - 'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'
816
- example: item
817
907
  externalIdentifier:
818
908
  $ref: '#/components/schemas/Druid'
819
909
  label:
@@ -844,60 +934,55 @@ components:
844
934
  DROAccess:
845
935
  type: object
846
936
  additionalProperties: false
847
- properties:
848
- access:
849
- type: string
850
- enum:
851
- - 'world'
852
- - 'stanford'
853
- - 'location-based'
854
- - 'citation-only'
855
- - 'dark'
856
- default: 'dark'
857
- controlledDigitalLending:
858
- description: Available for controlled digital lending.
859
- type: boolean
860
- default: false
861
- copyright:
862
- description: The human readable copyright statement that applies
863
- example: Copyright World Trade Organization
864
- type: string
865
- embargo:
866
- $ref: '#/components/schemas/Embargo'
867
- download:
868
- description: >
869
- Download access level. This is used in the transition from Fedora as
870
- a way to set a default download level at registration that is copied
871
- down to all the files.
872
-
873
- type: string
874
- enum:
875
- - 'world'
876
- - 'stanford'
877
- - 'location-based'
878
- - 'none'
879
- default: 'none'
880
- readLocation:
881
- description: >
882
- If access is "location-based", which location should have access.
883
- This is used in the transition from Fedora as a way to set a default
884
- readLocation at registration that is copied down to all the files.
885
-
886
- type: string
887
- enum:
888
- - 'spec'
889
- - 'music'
890
- - 'ars'
891
- - 'art'
892
- - 'hoover'
893
- - 'm&m'
894
- useAndReproductionStatement:
895
- description: The human readable use and reproduction statement that applies
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).
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
937
+ allOf:
938
+ - $ref: "#/components/schemas/Access"
939
+ - type: object
940
+ properties:
941
+ copyright:
942
+ description: The human readable copyright statement that applies
943
+ example: Copyright World Trade Organization
944
+ type: string
945
+ nullable: true
946
+ embargo:
947
+ $ref: '#/components/schemas/Embargo'
948
+ useAndReproductionStatement:
949
+ description: The human readable use and reproduction statement that applies
950
+ 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).
951
+ type: string
952
+ license:
953
+ description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
954
+ type: string
955
+ enum:
956
+ - 'https://www.gnu.org/licenses/agpl.txt'
957
+ - 'https://www.apache.org/licenses/LICENSE-2.0'
958
+ - 'https://opensource.org/licenses/BSD-2-Clause'
959
+ - 'https://opensource.org/licenses/BSD-3-Clause'
960
+ - 'https://creativecommons.org/licenses/by/4.0/legalcode'
961
+ - 'https://creativecommons.org/licenses/by-nc/4.0/legalcode'
962
+ - 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode'
963
+ - 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode'
964
+ - 'https://creativecommons.org/licenses/by-nd/4.0/legalcode'
965
+ - 'https://creativecommons.org/licenses/by-sa/4.0/legalcode'
966
+ - 'https://creativecommons.org/publicdomain/zero/1.0/legalcode'
967
+ - 'https://opensource.org/licenses/cddl1'
968
+ - 'https://www.eclipse.org/legal/epl-2.0'
969
+ - 'https://www.gnu.org/licenses/gpl-3.0-standalone.html'
970
+ - 'https://www.isc.org/downloads/software-support-policy/isc-license/'
971
+ - 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html'
972
+ - 'https://opensource.org/licenses/MIT'
973
+ - 'https://www.mozilla.org/MPL/2.0/'
974
+ - 'https://opendatacommons.org/licenses/by/1-0/'
975
+ - 'http://opendatacommons.org/licenses/odbl/1.0/' # Non cannonical, but in some of our data
976
+ - 'https://opendatacommons.org/licenses/odbl/1-0/'
977
+ - 'https://creativecommons.org/publicdomain/mark/1.0/'
978
+ - 'https://opendatacommons.org/licenses/pddl/1-0/'
979
+ - 'https://creativecommons.org/licenses/by/3.0/legalcode'
980
+ - 'https://creativecommons.org/licenses/by-sa/3.0/legalcode'
981
+ - 'https://creativecommons.org/licenses/by-nd/3.0/legalcode'
982
+ - 'https://creativecommons.org/licenses/by-nc/3.0/legalcode'
983
+ - 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode'
984
+ - 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode'
985
+ - 'http://cocina.sul.stanford.edu/licenses/none' # Only used in some legacy ETDs and not actually permitted per the Project Chimera docs.
901
986
  DROStructural:
902
987
  description: Structural metadata
903
988
  type: object
@@ -928,28 +1013,21 @@ components:
928
1013
  Embargo:
929
1014
  type: object
930
1015
  additionalProperties: false
931
- properties:
932
- releaseDate:
933
- description: Date when the Collection is released from an embargo.
934
- type: string
935
- format: date-time
936
- example: '2029-06-22T07:00:00.000+00:00'
937
- access:
938
- description: Access level that applies when embargo expires.
939
- type: string
940
- enum:
941
- - world
942
- - stanford
943
- - location-based
944
- - citation-only
945
- - dark
946
- useAndReproductionStatement:
947
- description: The human readable use and reproduction statement that applies when the embargo expires.
948
- example: These materials are in the public domain.
949
- type: string
950
- required:
951
- - releaseDate
952
- - access
1016
+ allOf:
1017
+ - $ref: "#/components/schemas/Access"
1018
+ - type: object
1019
+ properties:
1020
+ releaseDate:
1021
+ description: Date when the Collection is released from an embargo.
1022
+ type: string
1023
+ format: date-time
1024
+ example: '2029-06-22T07:00:00.000+00:00'
1025
+ useAndReproductionStatement:
1026
+ description: The human readable use and reproduction statement that applies when the embargo expires.
1027
+ example: These materials are in the public domain.
1028
+ type: string
1029
+ required:
1030
+ - releaseDate
953
1031
  Event:
954
1032
  description: Property model for describing events in the history of the resource.
955
1033
  type: object
@@ -1052,40 +1130,14 @@ components:
1052
1130
  description: Access metadata for files
1053
1131
  type: object
1054
1132
  additionalProperties: false
1055
- properties:
1056
- access:
1057
- description: Access level
1058
- type: string
1059
- enum:
1060
- - 'world'
1061
- - 'stanford'
1062
- - 'location-based'
1063
- - 'citation-only'
1064
- - 'dark'
1065
- default: 'dark'
1066
- controlledDigitalLending:
1067
- description: Available for controlled digital lending.
1068
- type: boolean
1069
- default: false
1070
- download:
1071
- description: Download access level for a file
1072
- type: string
1073
- enum:
1074
- - 'world'
1075
- - 'stanford'
1076
- - 'location-based'
1077
- - 'none'
1078
- default: 'none'
1079
- readLocation:
1080
- description: If access is "location-based", which location should have access.
1081
- type: string
1082
- enum:
1083
- - 'spec'
1084
- - 'music'
1085
- - 'ars'
1086
- - 'art'
1087
- - 'hoover'
1088
- - 'm&m'
1133
+ oneOf:
1134
+ # Being first, makes DarkAccess the default.
1135
+ - $ref: '#/components/schemas/DarkAccess'
1136
+ - $ref: '#/components/schemas/ControlledDigitalLendingAccess'
1137
+ - $ref: '#/components/schemas/LocationBasedAccess'
1138
+ - $ref: '#/components/schemas/LocationBasedDownloadAccess'
1139
+ - $ref: '#/components/schemas/StanfordAccess'
1140
+ - $ref: '#/components/schemas/WorldAccess'
1089
1141
  FileAdministrative:
1090
1142
  type: object
1091
1143
  additionalProperties: false
@@ -1166,14 +1218,16 @@ components:
1166
1218
  type: object
1167
1219
  additionalProperties: false
1168
1220
  properties:
1169
- sourceId:
1170
- $ref: '#/components/schemas/SourceId'
1221
+ barcode:
1222
+ $ref: '#/components/schemas/Barcode'
1171
1223
  catalogLinks:
1172
1224
  type: array
1173
1225
  items:
1174
1226
  $ref: '#/components/schemas/CatalogLink'
1175
- barcode:
1176
- $ref: '#/components/schemas/Barcode'
1227
+ doi:
1228
+ $ref: '#/components/schemas/DOI'
1229
+ sourceId:
1230
+ $ref: '#/components/schemas/SourceId'
1177
1231
  Language:
1178
1232
  description: Languages, scripts, symbolic systems, and notations used in all
1179
1233
  or part of a resource or its descriptive metadata.
@@ -1243,6 +1297,72 @@ components:
1243
1297
  valueLanguage:
1244
1298
  # description: present for mapping to additional schemas in the future and for consistency but not otherwise used
1245
1299
  $ref: "#/components/schemas/DescriptiveValueLanguage"
1300
+ LocationBasedAccess:
1301
+ type: object
1302
+ properties:
1303
+ access:
1304
+ description: Access level.
1305
+ type: string
1306
+ enum:
1307
+ - location-based
1308
+ download:
1309
+ description: Download access level.
1310
+ type: string
1311
+ enum:
1312
+ - location-based
1313
+ - none
1314
+ readLocation:
1315
+ description: If access is "location-based", which location should have access.
1316
+ type: string
1317
+ enum:
1318
+ - 'spec'
1319
+ - 'music'
1320
+ - 'ars'
1321
+ - 'art'
1322
+ - 'hoover'
1323
+ - 'm&m'
1324
+ controlledDigitalLending:
1325
+ type: boolean
1326
+ default: false
1327
+ enum:
1328
+ - false
1329
+ required:
1330
+ - access
1331
+ - download
1332
+ - readLocation
1333
+ LocationBasedDownloadAccess:
1334
+ type: object
1335
+ properties:
1336
+ access:
1337
+ description: Access level.
1338
+ type: string
1339
+ enum:
1340
+ - stanford
1341
+ - world
1342
+ download:
1343
+ description: Download access level.
1344
+ type: string
1345
+ enum:
1346
+ - location-based
1347
+ readLocation:
1348
+ description: If access is "location-based", which location should have access.
1349
+ type: string
1350
+ enum:
1351
+ - 'spec'
1352
+ - 'music'
1353
+ - 'ars'
1354
+ - 'art'
1355
+ - 'hoover'
1356
+ - 'm&m'
1357
+ controlledDigitalLending:
1358
+ type: boolean
1359
+ default: false
1360
+ enum:
1361
+ - false
1362
+ required:
1363
+ - access
1364
+ - download
1365
+ - readLocation
1246
1366
  MessageDigest:
1247
1367
  description: The output of the message digest algorithm.
1248
1368
  type: object
@@ -1271,6 +1391,12 @@ components:
1271
1391
  width:
1272
1392
  description: Width in pixels
1273
1393
  type: integer
1394
+ Purl:
1395
+ description: Stanford persistent URL associated with the related resource. Note this is http, not https.
1396
+ type: string
1397
+ format: uri
1398
+ # Canonical URI is http, even though this redirects to https.
1399
+ pattern: '^http:\/\/'
1274
1400
  RelatedResource:
1275
1401
  description: Other resource associated with the described resource.
1276
1402
  type: object
@@ -1332,9 +1458,7 @@ components:
1332
1458
  items:
1333
1459
  $ref: "#/components/schemas/DescriptiveValue"
1334
1460
  purl:
1335
- description: Stanford persistent URL associated with the related resource.
1336
- type: string
1337
- format: uri
1461
+ $ref: "#/components/schemas/Purl"
1338
1462
  access:
1339
1463
  $ref: "#/components/schemas/DescriptiveAccessMetadata"
1340
1464
  relatedResource:
@@ -1387,7 +1511,6 @@ components:
1387
1511
  type: string
1388
1512
  enum:
1389
1513
  - 'http://cocina.sul.stanford.edu/models/admin_policy.jsonld'
1390
- example: item
1391
1514
  label:
1392
1515
  type: string
1393
1516
  version:
@@ -1414,13 +1537,12 @@ components:
1414
1537
  - 'http://cocina.sul.stanford.edu/models/user-collection.jsonld'
1415
1538
  - 'http://cocina.sul.stanford.edu/models/exhibit.jsonld'
1416
1539
  - 'http://cocina.sul.stanford.edu/models/series.jsonld'
1417
- example: item
1418
1540
  label:
1419
1541
  type: string
1420
1542
  version:
1421
1543
  type: integer
1422
1544
  access:
1423
- $ref: '#/components/schemas/Access'
1545
+ $ref: '#/components/schemas/CollectionAccess'
1424
1546
  administrative:
1425
1547
  $ref: '#/components/schemas/Administrative'
1426
1548
  description:
@@ -1456,7 +1578,6 @@ components:
1456
1578
  - 'http://cocina.sul.stanford.edu/models/track.jsonld'
1457
1579
  - 'http://cocina.sul.stanford.edu/models/webarchive-binary.jsonld'
1458
1580
  - 'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'
1459
- example: item
1460
1581
  label:
1461
1582
  type: string
1462
1583
  version:
@@ -1587,14 +1708,16 @@ components:
1587
1708
  type: object
1588
1709
  additionalProperties: false
1589
1710
  properties:
1590
- sourceId:
1591
- $ref: '#/components/schemas/SourceId'
1711
+ barcode:
1712
+ $ref: '#/components/schemas/Barcode'
1592
1713
  catalogLinks:
1593
1714
  type: array
1594
1715
  items:
1595
1716
  $ref: '#/components/schemas/CatalogLink'
1596
- barcode:
1597
- $ref: '#/components/schemas/Barcode'
1717
+ doi:
1718
+ $ref: '#/components/schemas/DOI'
1719
+ sourceId:
1720
+ $ref: '#/components/schemas/SourceId'
1598
1721
  required:
1599
1722
  - sourceId
1600
1723
  Sequence:
@@ -1678,7 +1801,7 @@ components:
1678
1801
  description: The standard barcode associated with a DRO object, prefixed with 36105
1679
1802
  type: string
1680
1803
  pattern: '^36105[0-9]{9}$'
1681
- example: 36105010362304
1804
+ example: '36105010362304'
1682
1805
  Title:
1683
1806
  type: object
1684
1807
  additionalProperties: false
@@ -1700,3 +1823,59 @@ components:
1700
1823
  - type: object
1701
1824
  required:
1702
1825
  - valueAt
1826
+ StanfordAccess:
1827
+ type: object
1828
+ properties:
1829
+ access:
1830
+ description: Access level.
1831
+ type: string
1832
+ enum:
1833
+ - stanford
1834
+ download:
1835
+ description: Download access level.
1836
+ type: string
1837
+ enum:
1838
+ - stanford
1839
+ readLocation:
1840
+ description: If access is "location-based", which location should have access.
1841
+ type: string
1842
+ nullable: true
1843
+ enum:
1844
+ - null
1845
+ controlledDigitalLending:
1846
+ type: boolean
1847
+ default: false
1848
+ enum:
1849
+ - false
1850
+ required:
1851
+ - access
1852
+ - download
1853
+ WorldAccess:
1854
+ type: object
1855
+ properties:
1856
+ access:
1857
+ description: Access level.
1858
+ type: string
1859
+ enum:
1860
+ - world
1861
+ download:
1862
+ description: Download access level.
1863
+ type: string
1864
+ enum:
1865
+ - none
1866
+ - stanford
1867
+ - world
1868
+ readLocation:
1869
+ description: If access is "location-based", which location should have access.
1870
+ type: string
1871
+ nullable: true
1872
+ enum:
1873
+ - null
1874
+ controlledDigitalLending:
1875
+ type: boolean
1876
+ default: false
1877
+ enum:
1878
+ - false
1879
+ required:
1880
+ - access
1881
+ - download