cocina-models 0.58.2 → 0.61.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) 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 +29 -2
  6. data/lib/cocina/generator/schema_array.rb +1 -1
  7. data/lib/cocina/generator/schema_base.rb +16 -5
  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.rb +11 -19
  11. data/lib/cocina/models/access.rb +10 -11
  12. data/lib/cocina/models/admin_policy.rb +0 -1
  13. data/lib/cocina/models/citation_only_access.rb +15 -0
  14. data/lib/cocina/models/collection.rb +1 -2
  15. data/lib/cocina/models/collection_access.rb +18 -0
  16. data/lib/cocina/models/collection_identification.rb +1 -1
  17. data/lib/cocina/models/controlled_digital_lending_access.rb +16 -0
  18. data/lib/cocina/models/dark_access.rb +15 -0
  19. data/lib/cocina/models/description.rb +1 -1
  20. data/lib/cocina/models/doi.rb +9 -0
  21. data/lib/cocina/models/dro.rb +0 -1
  22. data/lib/cocina/models/dro_access.rb +13 -11
  23. data/lib/cocina/models/embargo.rb +11 -2
  24. data/lib/cocina/models/file_access.rb +10 -7
  25. data/lib/cocina/models/identification.rb +6 -3
  26. data/lib/cocina/models/lane_medical_barcode.rb +9 -0
  27. data/lib/cocina/models/location_based_access.rb +15 -0
  28. data/lib/cocina/models/location_based_download_access.rb +15 -0
  29. data/lib/cocina/models/purl.rb +9 -0
  30. data/lib/cocina/models/related_resource.rb +1 -1
  31. data/lib/cocina/models/request_admin_policy.rb +0 -1
  32. data/lib/cocina/models/request_collection.rb +1 -2
  33. data/lib/cocina/models/request_dro.rb +0 -1
  34. data/lib/cocina/models/request_identification.rb +6 -3
  35. data/lib/cocina/models/stanford_access.rb +15 -0
  36. data/lib/cocina/models/version.rb +1 -1
  37. data/lib/cocina/models/world_access.rb +15 -0
  38. data/openapi.yml +347 -172
  39. metadata +13 -2
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class DarkAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.default('dark').enum('dark').meta(omittable: true)
8
+ # Download access level.
9
+ attribute :download, Types::Strict::String.default('none').enum('none').meta(omittable: true)
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
@@ -12,7 +12,7 @@ module Cocina
12
12
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
13
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
14
14
  attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
15
- # Stanford persistent URL associated with the resource.
15
+ # Stanford persistent URL associated with the related resource. Note this is http, not https.
16
16
  attribute :purl, Types::Strict::String.meta(omittable: true)
17
17
  attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
18
18
  attribute :relatedResource, Types::Strict::Array.of(RelatedResource).meta(omittable: true)
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ DOI = Types::String.constrained(
6
+ format: %r{^10\.25740/druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$}i
7
+ )
8
+ end
9
+ end
@@ -22,7 +22,6 @@ module Cocina
22
22
  'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'].freeze
23
23
 
24
24
  # The content type of the DRO. Selected from an established set of values.
25
- # example: item
26
25
  attribute :type, Types::Strict::String.enum(*DRO::TYPES)
27
26
  # example: druid:bc123df4567
28
27
  attribute :externalIdentifier, Types::Strict::String
@@ -3,24 +3,26 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DROAccess < Struct
6
- attribute :access, Types::Strict::String.default('dark').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)
6
+ # Access level.
7
+ # Validation of this property is relaxed. See the openapi for full validation.
8
+ attribute :access, Types::Strict::String.optional.default('dark').meta(omittable: true)
9
+ # Download access level.
10
+ # Validation of this property is relaxed. See the openapi for full validation.
11
+ attribute :download, Types::Strict::String.optional.default('none').meta(omittable: true)
12
+ # If access is "location-based", which location should have access.
13
+ # Validation of this property is relaxed. See the openapi for full validation.
14
+ attribute :readLocation, Types::Strict::String.optional.meta(omittable: true)
15
+ # Validation of this property is relaxed. See the openapi for full validation.
16
+ attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
9
17
  # The human readable copyright statement that applies
10
18
  # example: Copyright World Trade Organization
11
- attribute :copyright, Types::Strict::String.meta(omittable: true)
19
+ attribute :copyright, Types::Strict::String.optional.meta(omittable: true)
12
20
  attribute :embargo, Embargo.optional.meta(omittable: true)
13
- # 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.
14
-
15
- attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
16
- # 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.
17
-
18
- attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
19
21
  # The human readable use and reproduction statement that applies
20
22
  # example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
21
23
  attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
22
24
  # 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)
25
+ attribute :license, Types::Strict::String.enum('https://www.gnu.org/licenses/agpl.txt', 'https://www.apache.org/licenses/LICENSE-2.0', 'https://opensource.org/licenses/BSD-2-Clause', 'https://opensource.org/licenses/BSD-3-Clause', 'https://creativecommons.org/licenses/by/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode', 'https://creativecommons.org/licenses/by-nd/4.0/legalcode', 'https://creativecommons.org/licenses/by-sa/4.0/legalcode', 'https://creativecommons.org/publicdomain/zero/1.0/legalcode', 'https://opensource.org/licenses/cddl1', 'https://www.eclipse.org/legal/epl-2.0', 'https://www.gnu.org/licenses/gpl-3.0-standalone.html', 'https://www.isc.org/downloads/software-support-policy/isc-license/', 'https://www.gnu.org/licenses/lgpl-3.0-standalone.html', 'https://opensource.org/licenses/MIT', 'https://www.mozilla.org/MPL/2.0/', 'https://opendatacommons.org/licenses/by/1-0/', 'http://opendatacommons.org/licenses/odbl/1.0/', 'https://opendatacommons.org/licenses/odbl/1-0/', 'https://creativecommons.org/publicdomain/mark/1.0/', 'https://opendatacommons.org/licenses/pddl/1-0/', 'https://creativecommons.org/licenses/by/3.0/legalcode', 'https://creativecommons.org/licenses/by-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nd/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-sa/3.0/legalcode', 'https://creativecommons.org/licenses/by-nc-nd/3.0/legalcode', 'http://cocina.sul.stanford.edu/licenses/none').meta(omittable: true)
24
26
  end
25
27
  end
26
28
  end
@@ -3,11 +3,20 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Embargo < Struct
6
+ # Access level.
7
+ # Validation of this property is relaxed. See the openapi for full validation.
8
+ attribute :access, Types::Strict::String.optional.default('dark').meta(omittable: true)
9
+ # Download access level.
10
+ # Validation of this property is relaxed. See the openapi for full validation.
11
+ attribute :download, Types::Strict::String.optional.default('none').meta(omittable: true)
12
+ # If access is "location-based", which location should have access.
13
+ # Validation of this property is relaxed. See the openapi for full validation.
14
+ attribute :readLocation, Types::Strict::String.optional.meta(omittable: true)
15
+ # Validation of this property is relaxed. See the openapi for full validation.
16
+ attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
6
17
  # Date when the Collection is released from an embargo.
7
18
  # example: 2029-06-22T07:00:00.000+00:00
8
19
  attribute :releaseDate, Types::Params::DateTime
9
- # Access level that applies when embargo expires.
10
- attribute :access, Types::Strict::String.enum('world', 'stanford', 'location-based', 'citation-only', 'dark')
11
20
  # The human readable use and reproduction statement that applies when the embargo expires.
12
21
  # example: These materials are in the public domain.
13
22
  attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
@@ -3,14 +3,17 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class FileAccess < Struct
6
- # Access level
7
- attribute :access, Types::Strict::String.default('dark').enum('world', 'stanford', 'location-based', 'citation-only', 'dark').meta(omittable: true)
8
- # Available for controlled digital lending.
9
- attribute :controlledDigitalLending, Types::Strict::Bool.meta(omittable: true)
10
- # Download access level for a file
11
- attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
6
+ # Access level.
7
+ # Validation of this property is relaxed. See the openapi for full validation.
8
+ attribute :access, Types::Strict::String.optional.default('dark').meta(omittable: true)
9
+ # Download access level.
10
+ # Validation of this property is relaxed. See the openapi for full validation.
11
+ attribute :download, Types::Strict::String.optional.default('none').meta(omittable: true)
12
12
  # If access is "location-based", which location should have access.
13
- attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
13
+ # Validation of this property is relaxed. See the openapi for full validation.
14
+ attribute :readLocation, Types::Strict::String.optional.meta(omittable: true)
15
+ # Validation of this property is relaxed. See the openapi for full validation.
16
+ attribute :controlledDigitalLending, Types::Strict::Bool.optional.meta(omittable: true)
14
17
  end
15
18
  end
16
19
  end
@@ -3,13 +3,16 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Identification < 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.meta(omittable: true)
10
- attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
11
- # A barcode
12
- attribute :barcode, Types::Nominal::Any.meta(omittable: true)
13
16
  end
14
17
  end
15
18
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ LaneMedicalBarcode = Types::String.constrained(
6
+ format: /^245[0-9]{8}$/i
7
+ )
8
+ end
9
+ end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class LocationBasedAccess < Struct
6
+ # Access level.
7
+ attribute :access, Types::Strict::String.enum('location-based')
8
+ # Download access level.
9
+ attribute :download, Types::Strict::String.enum('location-based', 'none')
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
@@ -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
@@ -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
@@ -18,7 +18,7 @@ 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.
21
+ # Stanford persistent URL associated with the related resource. Note this is http, not https.
22
22
  attribute :purl, Types::Strict::String.meta(omittable: true)
23
23
  attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
24
24
  attribute :relatedResource, Types::Strict::Array.of(RelatedResource).meta(omittable: true)
@@ -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
@@ -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.meta(omittable: true)
13
16
  end
14
17
  end
15
18
  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
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.58.2'
5
+ VERSION = '0.61.1'
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:
@@ -326,13 +300,19 @@ components:
326
300
  description: 'A barcode'
327
301
  oneOf:
328
302
  - $ref: '#/components/schemas/BusinessBarcode'
303
+ - $ref: '#/components/schemas/LaneMedicalBarcode'
329
304
  - $ref: '#/components/schemas/CatkeyBarcode'
330
305
  - $ref: '#/components/schemas/StandardBarcode'
331
306
  BusinessBarcode:
332
307
  description: The barcode associated with a business library DRO object, prefixed with 2050
333
308
  type: string
334
309
  pattern: '^2050[0-9]{7}$'
335
- 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'
336
316
  CatalogLink:
337
317
  type: object
338
318
  additionalProperties: false
@@ -347,12 +327,39 @@ components:
347
327
  catalogRecordId:
348
328
  description: Record identifier that is unique within the context of the linked record's catalog.
349
329
  type: string
350
- example: 11403803
330
+ example: '11403803'
351
331
  CatkeyBarcode:
352
332
  description: The barcode associated with a DRO object based on catkey, prefixed with 36105
353
333
  type: string
354
334
  pattern: '^[0-9]+-[0-9]+$'
355
- 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
356
363
  Collection:
357
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.
358
365
  type: object
@@ -367,7 +374,6 @@ components:
367
374
  - 'http://cocina.sul.stanford.edu/models/user-collection.jsonld'
368
375
  - 'http://cocina.sul.stanford.edu/models/exhibit.jsonld'
369
376
  - 'http://cocina.sul.stanford.edu/models/series.jsonld'
370
- example: item
371
377
  externalIdentifier:
372
378
  $ref: '#/components/schemas/Druid'
373
379
  label:
@@ -377,7 +383,7 @@ components:
377
383
  description: Version for the Collection within SDR.
378
384
  type: integer
379
385
  access:
380
- $ref: '#/components/schemas/Access'
386
+ $ref: '#/components/schemas/CollectionAccess'
381
387
  administrative:
382
388
  $ref: '#/components/schemas/Administrative'
383
389
  description:
@@ -390,16 +396,40 @@ components:
390
396
  - type
391
397
  - version
392
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
393
423
  CollectionIdentification:
394
424
  type: object
395
425
  additionalProperties: false
396
426
  properties:
397
- sourceId:
398
- $ref: '#/components/schemas/SourceId'
399
427
  catalogLinks:
400
428
  type: array
401
429
  items:
402
430
  $ref: '#/components/schemas/CatalogLink'
431
+ sourceId:
432
+ $ref: '#/components/schemas/SourceId'
403
433
  Contributor:
404
434
  description: Property model for describing agents contributing in some way to
405
435
  the creation and history of the resource.
@@ -442,6 +472,60 @@ components:
442
472
  type: array
443
473
  items:
444
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
445
529
  Description:
446
530
  type: object
447
531
  additionalProperties: false
@@ -496,9 +580,7 @@ components:
496
580
  items:
497
581
  $ref: "#/components/schemas/DescriptiveValue"
498
582
  purl:
499
- description: Stanford persistent URL associated with the resource.
500
- type: string
501
- format: uri
583
+ $ref: "#/components/schemas/Purl"
502
584
  access:
503
585
  $ref: "#/components/schemas/DescriptiveAccessMetadata"
504
586
  relatedResource:
@@ -793,6 +875,11 @@ components:
793
875
  $ref: '#/components/schemas/Standard'
794
876
  # description: An alphabet or other notation used to represent a
795
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'
796
883
  DRO:
797
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.
798
885
  type: object
@@ -817,7 +904,6 @@ components:
817
904
  - 'http://cocina.sul.stanford.edu/models/track.jsonld'
818
905
  - 'http://cocina.sul.stanford.edu/models/webarchive-binary.jsonld'
819
906
  - 'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'
820
- example: item
821
907
  externalIdentifier:
822
908
  $ref: '#/components/schemas/Druid'
823
909
  label:
@@ -848,60 +934,55 @@ components:
848
934
  DROAccess:
849
935
  type: object
850
936
  additionalProperties: false
851
- properties:
852
- access:
853
- type: string
854
- enum:
855
- - 'world'
856
- - 'stanford'
857
- - 'location-based'
858
- - 'citation-only'
859
- - 'dark'
860
- default: 'dark'
861
- controlledDigitalLending:
862
- description: Available for controlled digital lending.
863
- type: boolean
864
- default: false
865
- copyright:
866
- description: The human readable copyright statement that applies
867
- example: Copyright World Trade Organization
868
- type: string
869
- embargo:
870
- $ref: '#/components/schemas/Embargo'
871
- download:
872
- description: >
873
- Download access level. This is used in the transition from Fedora as
874
- a way to set a default download level at registration that is copied
875
- down to all the files.
876
-
877
- type: string
878
- enum:
879
- - 'world'
880
- - 'stanford'
881
- - 'location-based'
882
- - 'none'
883
- default: 'none'
884
- readLocation:
885
- description: >
886
- If access is "location-based", which location should have access.
887
- This is used in the transition from Fedora as a way to set a default
888
- readLocation at registration that is copied down to all the files.
889
-
890
- type: string
891
- enum:
892
- - 'spec'
893
- - 'music'
894
- - 'ars'
895
- - 'art'
896
- - 'hoover'
897
- - 'm&m'
898
- useAndReproductionStatement:
899
- description: The human readable use and reproduction statement that applies
900
- 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).
901
- type: string
902
- license:
903
- description: The license governing reuse of the DRO. Should be an IRI for known licenses (i.e. CC, RightsStatement.org URI, etc.).
904
- 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.
905
986
  DROStructural:
906
987
  description: Structural metadata
907
988
  type: object
@@ -932,28 +1013,21 @@ components:
932
1013
  Embargo:
933
1014
  type: object
934
1015
  additionalProperties: false
935
- properties:
936
- releaseDate:
937
- description: Date when the Collection is released from an embargo.
938
- type: string
939
- format: date-time
940
- example: '2029-06-22T07:00:00.000+00:00'
941
- access:
942
- description: Access level that applies when embargo expires.
943
- type: string
944
- enum:
945
- - world
946
- - stanford
947
- - location-based
948
- - citation-only
949
- - dark
950
- useAndReproductionStatement:
951
- description: The human readable use and reproduction statement that applies when the embargo expires.
952
- example: These materials are in the public domain.
953
- type: string
954
- required:
955
- - releaseDate
956
- - 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
957
1031
  Event:
958
1032
  description: Property model for describing events in the history of the resource.
959
1033
  type: object
@@ -1056,40 +1130,14 @@ components:
1056
1130
  description: Access metadata for files
1057
1131
  type: object
1058
1132
  additionalProperties: false
1059
- properties:
1060
- access:
1061
- description: Access level
1062
- type: string
1063
- enum:
1064
- - 'world'
1065
- - 'stanford'
1066
- - 'location-based'
1067
- - 'citation-only'
1068
- - 'dark'
1069
- default: 'dark'
1070
- controlledDigitalLending:
1071
- description: Available for controlled digital lending.
1072
- type: boolean
1073
- default: false
1074
- download:
1075
- description: Download access level for a file
1076
- type: string
1077
- enum:
1078
- - 'world'
1079
- - 'stanford'
1080
- - 'location-based'
1081
- - 'none'
1082
- default: 'none'
1083
- readLocation:
1084
- description: If access is "location-based", which location should have access.
1085
- type: string
1086
- enum:
1087
- - 'spec'
1088
- - 'music'
1089
- - 'ars'
1090
- - 'art'
1091
- - 'hoover'
1092
- - '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'
1093
1141
  FileAdministrative:
1094
1142
  type: object
1095
1143
  additionalProperties: false
@@ -1170,14 +1218,16 @@ components:
1170
1218
  type: object
1171
1219
  additionalProperties: false
1172
1220
  properties:
1173
- sourceId:
1174
- $ref: '#/components/schemas/SourceId'
1221
+ barcode:
1222
+ $ref: '#/components/schemas/Barcode'
1175
1223
  catalogLinks:
1176
1224
  type: array
1177
1225
  items:
1178
1226
  $ref: '#/components/schemas/CatalogLink'
1179
- barcode:
1180
- $ref: '#/components/schemas/Barcode'
1227
+ doi:
1228
+ $ref: '#/components/schemas/DOI'
1229
+ sourceId:
1230
+ $ref: '#/components/schemas/SourceId'
1181
1231
  Language:
1182
1232
  description: Languages, scripts, symbolic systems, and notations used in all
1183
1233
  or part of a resource or its descriptive metadata.
@@ -1247,6 +1297,72 @@ components:
1247
1297
  valueLanguage:
1248
1298
  # description: present for mapping to additional schemas in the future and for consistency but not otherwise used
1249
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
1250
1366
  MessageDigest:
1251
1367
  description: The output of the message digest algorithm.
1252
1368
  type: object
@@ -1275,6 +1391,12 @@ components:
1275
1391
  width:
1276
1392
  description: Width in pixels
1277
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:\/\/'
1278
1400
  RelatedResource:
1279
1401
  description: Other resource associated with the described resource.
1280
1402
  type: object
@@ -1336,9 +1458,7 @@ components:
1336
1458
  items:
1337
1459
  $ref: "#/components/schemas/DescriptiveValue"
1338
1460
  purl:
1339
- description: Stanford persistent URL associated with the related resource.
1340
- type: string
1341
- format: uri
1461
+ $ref: "#/components/schemas/Purl"
1342
1462
  access:
1343
1463
  $ref: "#/components/schemas/DescriptiveAccessMetadata"
1344
1464
  relatedResource:
@@ -1391,7 +1511,6 @@ components:
1391
1511
  type: string
1392
1512
  enum:
1393
1513
  - 'http://cocina.sul.stanford.edu/models/admin_policy.jsonld'
1394
- example: item
1395
1514
  label:
1396
1515
  type: string
1397
1516
  version:
@@ -1418,13 +1537,12 @@ components:
1418
1537
  - 'http://cocina.sul.stanford.edu/models/user-collection.jsonld'
1419
1538
  - 'http://cocina.sul.stanford.edu/models/exhibit.jsonld'
1420
1539
  - 'http://cocina.sul.stanford.edu/models/series.jsonld'
1421
- example: item
1422
1540
  label:
1423
1541
  type: string
1424
1542
  version:
1425
1543
  type: integer
1426
1544
  access:
1427
- $ref: '#/components/schemas/Access'
1545
+ $ref: '#/components/schemas/CollectionAccess'
1428
1546
  administrative:
1429
1547
  $ref: '#/components/schemas/Administrative'
1430
1548
  description:
@@ -1460,7 +1578,6 @@ components:
1460
1578
  - 'http://cocina.sul.stanford.edu/models/track.jsonld'
1461
1579
  - 'http://cocina.sul.stanford.edu/models/webarchive-binary.jsonld'
1462
1580
  - 'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'
1463
- example: item
1464
1581
  label:
1465
1582
  type: string
1466
1583
  version:
@@ -1591,14 +1708,16 @@ components:
1591
1708
  type: object
1592
1709
  additionalProperties: false
1593
1710
  properties:
1594
- sourceId:
1595
- $ref: '#/components/schemas/SourceId'
1711
+ barcode:
1712
+ $ref: '#/components/schemas/Barcode'
1596
1713
  catalogLinks:
1597
1714
  type: array
1598
1715
  items:
1599
1716
  $ref: '#/components/schemas/CatalogLink'
1600
- barcode:
1601
- $ref: '#/components/schemas/Barcode'
1717
+ doi:
1718
+ $ref: '#/components/schemas/DOI'
1719
+ sourceId:
1720
+ $ref: '#/components/schemas/SourceId'
1602
1721
  required:
1603
1722
  - sourceId
1604
1723
  Sequence:
@@ -1682,7 +1801,7 @@ components:
1682
1801
  description: The standard barcode associated with a DRO object, prefixed with 36105
1683
1802
  type: string
1684
1803
  pattern: '^36105[0-9]{9}$'
1685
- example: 36105010362304
1804
+ example: '36105010362304'
1686
1805
  Title:
1687
1806
  type: object
1688
1807
  additionalProperties: false
@@ -1704,3 +1823,59 @@ components:
1704
1823
  - type: object
1705
1824
  required:
1706
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