cocina-models 0.30.0 → 0.34.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +51 -0
  3. data/.github/pull_request_template.md +8 -1
  4. data/.rubocop.yml +56 -1
  5. data/README.md +11 -14
  6. data/cocina-models.gemspec +3 -3
  7. data/docs/index.html +20 -0
  8. data/docs/maps/DRO.json +1 -1
  9. data/exe/generator +1 -1
  10. data/lib/cocina/generator.rb +0 -11
  11. data/lib/cocina/generator/generator.rb +1 -1
  12. data/lib/cocina/generator/schema.rb +29 -8
  13. data/lib/cocina/generator/schema_array.rb +5 -1
  14. data/lib/cocina/generator/schema_base.rb +22 -0
  15. data/lib/cocina/generator/schema_value.rb +3 -25
  16. data/lib/cocina/models.rb +7 -5
  17. data/lib/cocina/models/access.rb +4 -0
  18. data/lib/cocina/models/admin_policy.rb +1 -1
  19. data/lib/cocina/models/admin_policy_administrative.rb +1 -1
  20. data/lib/cocina/models/administrative.rb +1 -1
  21. data/lib/cocina/models/applies_to.rb +9 -0
  22. data/lib/cocina/models/collection.rb +1 -1
  23. data/lib/cocina/models/contributor.rb +14 -0
  24. data/lib/cocina/models/description.rb +17 -1
  25. data/lib/cocina/models/descriptive_admin_metadata.rb +12 -0
  26. data/lib/cocina/models/descriptive_basic_value.rb +21 -0
  27. data/lib/cocina/models/descriptive_structured_value.rb +9 -0
  28. data/lib/cocina/models/descriptive_value.rb +23 -0
  29. data/lib/cocina/models/descriptive_value_required.rb +23 -0
  30. data/lib/cocina/models/dro.rb +2 -2
  31. data/lib/cocina/models/dro_access.rb +7 -1
  32. data/lib/cocina/models/event.rb +15 -0
  33. data/lib/cocina/models/file.rb +1 -1
  34. data/lib/cocina/models/request_admin_policy.rb +1 -1
  35. data/lib/cocina/models/request_collection.rb +2 -2
  36. data/lib/cocina/models/request_dro.rb +4 -4
  37. data/lib/cocina/models/request_identification.rb +11 -0
  38. data/lib/cocina/models/sequence.rb +1 -0
  39. data/lib/cocina/models/source.rb +14 -0
  40. data/lib/cocina/models/validator.rb +12 -6
  41. data/lib/cocina/models/version.rb +1 -1
  42. data/openapi.yml +350 -20
  43. metadata +23 -18
  44. data/.travis.yml +0 -23
  45. data/docs/README.md +0 -9
  46. data/docs/_config.yml +0 -1
  47. data/docs/meta.json +0 -9
  48. data/docs/schema.json +0 -1654
  49. data/docs/schema.md +0 -268
  50. data/lib/cocina/models/title.rb +0 -12
@@ -5,6 +5,10 @@ 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
+ # Download access level for a file
9
+ attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
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').meta(omittable: true)
8
12
  end
9
13
  end
10
14
  end
@@ -17,7 +17,7 @@ module Cocina
17
17
  attribute :description, Description.optional.meta(omittable: true)
18
18
 
19
19
  def self.new(attributes = default_attributes, safe = false, validate = true, &block)
20
- Validator.validate(self, attributes.with_indifferent_access) if validate
20
+ Validator.validate(self, attributes.with_indifferent_access) if validate && name
21
21
  super(attributes, safe, &block)
22
22
  end
23
23
  end
@@ -5,7 +5,7 @@ module Cocina
5
5
  class AdminPolicyAdministrative < Struct
6
6
  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)
7
7
  attribute :registrationWorkflow, Types::Strict::String.meta(omittable: true)
8
- attribute :hasAdminPolicy, Types::Strict::String.meta(omittable: true)
8
+ attribute :hasAdminPolicy, Types::Strict::String
9
9
  end
10
10
  end
11
11
  end
@@ -4,7 +4,7 @@ module Cocina
4
4
  module Models
5
5
  class Administrative < Struct
6
6
  # example: druid:bc123df4567
7
- attribute :hasAdminPolicy, Types::Strict::String.meta(omittable: true)
7
+ attribute :hasAdminPolicy, Types::Strict::String
8
8
  attribute :releaseTags, Types::Strict::Array.of(ReleaseTag).meta(omittable: true)
9
9
  # Administrative or Internal project this resource is a part of
10
10
  # example: Google Books
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class AppliesTo < Struct
6
+ attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
7
+ end
8
+ end
9
+ end
@@ -26,7 +26,7 @@ module Cocina
26
26
  attribute :identification, CollectionIdentification.optional.meta(omittable: true)
27
27
 
28
28
  def self.new(attributes = default_attributes, safe = false, validate = true, &block)
29
- Validator.validate(self, attributes.with_indifferent_access) if validate
29
+ Validator.validate(self, attributes.with_indifferent_access) if validate && name
30
30
  super(attributes, safe, &block)
31
31
  end
32
32
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class Contributor < 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.
10
+ attribute :status, Types::Strict::String.meta(omittable: true)
11
+ attribute :role, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
12
+ end
13
+ end
14
+ end
@@ -3,7 +3,23 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Description < Struct
6
- attribute :title, Types::Strict::Array.of(Title).default([].freeze)
6
+ attribute :title, Types::Strict::Array.of(DescriptiveValueRequired).default([].freeze)
7
+ attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
8
+ attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
9
+ attribute :form, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
10
+ attribute :language, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
11
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
12
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
+ # Stanford persistent URL associated with the resource.
14
+ attribute :purl, Types::Strict::String.meta(omittable: true)
15
+ attribute :url, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
16
+ attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
17
+ attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
18
+
19
+ def self.new(attributes = default_attributes, safe = false, validate = true, &block)
20
+ Validator.validate(self, attributes.with_indifferent_access) if validate && name
21
+ super(attributes, safe, &block)
22
+ end
7
23
  end
8
24
  end
9
25
  end
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class DescriptiveAdminMetadata < Struct
6
+ attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
7
+ attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
8
+ attribute :language, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
9
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,21 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class DescriptiveBasicValue < Struct
6
+ # String value of the descriptive element.
7
+ attribute :value, Types::Strict::String.meta(omittable: true)
8
+ # Type of value provided by the descriptive element.
9
+ attribute :type, Types::Strict::String.meta(omittable: true)
10
+ # Status of the descriptive element relative to other instances of the element.
11
+ attribute :status, Types::Strict::String.meta(omittable: true)
12
+ # Code value of the descriptive element.
13
+ attribute :code, Types::Strict::String.meta(omittable: true)
14
+ # URI value of the descriptive element.
15
+ attribute :uri, Types::Strict::String.meta(omittable: true)
16
+ attribute :standard, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
17
+ attribute :encoding, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
18
+ attribute :source, Source.optional.meta(omittable: true)
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class DescriptiveStructuredValue < Struct
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class DescriptiveValue < Struct
6
+ # String value of the descriptive element.
7
+ attribute :value, Types::Strict::String.meta(omittable: true)
8
+ # Type of value provided by the descriptive element.
9
+ attribute :type, Types::Strict::String.meta(omittable: true)
10
+ # Status of the descriptive element relative to other instances of the element.
11
+ attribute :status, Types::Strict::String.meta(omittable: true)
12
+ # Code value of the descriptive element.
13
+ attribute :code, Types::Strict::String.meta(omittable: true)
14
+ # URI value of the descriptive element.
15
+ attribute :uri, Types::Strict::String.meta(omittable: true)
16
+ attribute :standard, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
17
+ attribute :encoding, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
18
+ attribute :source, Source.optional.meta(omittable: true)
19
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
20
+ attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
21
+ end
22
+ end
23
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class DescriptiveValueRequired < Struct
6
+ # String value of the descriptive element.
7
+ attribute :value, Types::Strict::String.meta(omittable: true)
8
+ # Type of value provided by the descriptive element.
9
+ attribute :type, Types::Strict::String.meta(omittable: true)
10
+ # Status of the descriptive element relative to other instances of the element.
11
+ attribute :status, Types::Strict::String.meta(omittable: true)
12
+ # Code value of the descriptive element.
13
+ attribute :code, Types::Strict::String.meta(omittable: true)
14
+ # URI value of the descriptive element.
15
+ attribute :uri, Types::Strict::String.meta(omittable: true)
16
+ attribute :standard, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
17
+ attribute :encoding, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
18
+ attribute :source, Source.optional.meta(omittable: true)
19
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
20
+ attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
21
+ end
22
+ end
23
+ end
@@ -31,14 +31,14 @@ module Cocina
31
31
  # Version for the DRO within SDR.
32
32
  attribute :version, Types::Strict::Integer
33
33
  attribute(:access, DROAccess.default { DROAccess.new })
34
- attribute :administrative, Administrative.optional.meta(omittable: true)
34
+ attribute(:administrative, Administrative.default { Administrative.new })
35
35
  attribute :description, Description.optional.meta(omittable: true)
36
36
  attribute :identification, Identification.optional.meta(omittable: true)
37
37
  attribute :structural, DROStructural.optional.meta(omittable: true)
38
38
  attribute :geographic, Geographic.optional.meta(omittable: true)
39
39
 
40
40
  def self.new(attributes = default_attributes, safe = false, validate = true, &block)
41
- Validator.validate(self, attributes.with_indifferent_access) if validate
41
+ Validator.validate(self, attributes.with_indifferent_access) if validate && name
42
42
  super(attributes, safe, &block)
43
43
  end
44
44
  end
@@ -7,10 +7,16 @@ module Cocina
7
7
  # The human readable copyright statement that applies
8
8
  # example: Copyright World Trade Organization
9
9
  attribute :copyright, Types::Strict::String.meta(omittable: true)
10
+ attribute :embargo, Embargo.optional.meta(omittable: true)
11
+ # 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.
12
+
13
+ attribute :download, Types::Strict::String.default('none').enum('world', 'stanford', 'location-based', 'none').meta(omittable: true)
14
+ # 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.
15
+
16
+ attribute :readLocation, Types::Strict::String.enum('spec', 'music', 'ars', 'art', 'hoover', 'm&m').meta(omittable: true)
10
17
  # The human readable use and reproduction statement that applies
11
18
  # example: Property rights reside with the repository. Literary rights reside with the creators of the documents or their heirs. To obtain permission to publish or reproduce, please contact the Public Services Librarian of the Dept. of Special Collections (http://library.stanford.edu/spc).
12
19
  attribute :useAndReproductionStatement, Types::Strict::String.meta(omittable: true)
13
- attribute :embargo, Embargo.optional.meta(omittable: true)
14
20
  end
15
21
  end
16
22
  end
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class Event < Struct
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
7
+ # Description of the event (creation, publication, etc.).
8
+ attribute :type, Types::Strict::String.meta(omittable: true)
9
+ attribute :date, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
10
+ attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
11
+ attribute :location, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
12
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
+ end
14
+ end
15
+ end
@@ -14,7 +14,7 @@ module Cocina
14
14
  # Primary processing label (can be same as title) for a File.
15
15
  attribute :label, Types::Strict::String
16
16
  # Filename for a file. Can be same as label.
17
- attribute :filename, Types::Strict::String.meta(omittable: true)
17
+ attribute :filename, Types::Strict::String
18
18
  # Size of the File (binary) in bytes.
19
19
  attribute :size, Types::Strict::Integer.meta(omittable: true)
20
20
  # Version for the File within SDR.
@@ -15,7 +15,7 @@ module Cocina
15
15
  attribute :description, Description.optional.meta(omittable: true)
16
16
 
17
17
  def self.new(attributes = default_attributes, safe = false, validate = true, &block)
18
- Validator.validate(self, attributes.with_indifferent_access) if validate
18
+ Validator.validate(self, attributes.with_indifferent_access) if validate && name
19
19
  super(attributes, safe, &block)
20
20
  end
21
21
  end
@@ -16,12 +16,12 @@ module Cocina
16
16
  attribute :label, Types::Strict::String
17
17
  attribute :version, Types::Strict::Integer
18
18
  attribute(:access, Access.default { Access.new })
19
- attribute :administrative, Administrative.optional.meta(omittable: true)
19
+ attribute(:administrative, Administrative.default { Administrative.new })
20
20
  attribute :description, Description.optional.meta(omittable: true)
21
21
  attribute :identification, CollectionIdentification.optional.meta(omittable: true)
22
22
 
23
23
  def self.new(attributes = default_attributes, safe = false, validate = true, &block)
24
- Validator.validate(self, attributes.with_indifferent_access) if validate
24
+ Validator.validate(self, attributes.with_indifferent_access) if validate && name
25
25
  super(attributes, safe, &block)
26
26
  end
27
27
  end
@@ -25,15 +25,15 @@ module Cocina
25
25
  attribute :type, Types::Strict::String.enum(*RequestDRO::TYPES)
26
26
  attribute :label, Types::Strict::String
27
27
  attribute :version, Types::Strict::Integer
28
- attribute :access, DROAccess.optional.meta(omittable: true)
29
- attribute :administrative, Administrative.optional.meta(omittable: true)
28
+ attribute(:access, DROAccess.default { DROAccess.new })
29
+ attribute(:administrative, Administrative.default { Administrative.new })
30
30
  attribute :description, Description.optional.meta(omittable: true)
31
- attribute :identification, Identification.optional.meta(omittable: true)
31
+ attribute(:identification, RequestIdentification.default { RequestIdentification.new })
32
32
  attribute :structural, RequestDROStructural.optional.meta(omittable: true)
33
33
  attribute :geographic, Geographic.optional.meta(omittable: true)
34
34
 
35
35
  def self.new(attributes = default_attributes, safe = false, validate = true, &block)
36
- Validator.validate(self, attributes.with_indifferent_access) if validate
36
+ Validator.validate(self, attributes.with_indifferent_access) if validate && name
37
37
  super(attributes, safe, &block)
38
38
  end
39
39
  end
@@ -0,0 +1,11 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class RequestIdentification < Struct
6
+ # example: sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026
7
+ attribute :sourceId, Types::Strict::String
8
+ attribute :catalogLinks, Types::Strict::Array.of(CatalogLink).meta(omittable: true)
9
+ end
10
+ end
11
+ end
@@ -3,6 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class Sequence < Struct
6
+ attribute :members, Types::Strict::Array.of(Types::Strict::String).meta(omittable: true)
6
7
  # The direction that a sequence of canvases should be displayed to the user
7
8
  attribute :viewingDirection, Types::Strict::String.enum('right-to-left', 'left-to-right').meta(omittable: true)
8
9
  end
@@ -0,0 +1,14 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class Source < Struct
6
+ # Code representing the value source.
7
+ attribute :code, Types::Strict::String.meta(omittable: true)
8
+ # URI for the value source.
9
+ attribute :uri, Types::Strict::String.meta(omittable: true)
10
+ # String describing the value source.
11
+ attribute :value, Types::Strict::String.meta(omittable: true)
12
+ end
13
+ end
14
+ end
@@ -4,12 +4,6 @@ module Cocina
4
4
  module Models
5
5
  # Perform validation against openapi
6
6
  class Validator
7
- # rubocop:disable Style/ClassVars
8
- def self.root
9
- @@root ||= OpenAPIParser.parse(YAML.load_file('openapi.yml'))
10
- end
11
- # rubocop:enable Style/ClassVars
12
-
13
7
  def self.validate(clazz, attributes)
14
8
  method_name = clazz.name.split('::').last
15
9
  request_operation = root.request_operation(:post, "/validate/#{method_name}")
@@ -17,6 +11,18 @@ module Cocina
17
11
  rescue OpenAPIParser::OpenAPIError => e
18
12
  raise ValidationError, e.message
19
13
  end
14
+
15
+ # rubocop:disable Style/ClassVars
16
+ def self.root
17
+ @@root ||= OpenAPIParser.parse(YAML.load_file(openapi_path))
18
+ end
19
+ # rubocop:enable Style/ClassVars
20
+ private_class_method :root
21
+
22
+ def self.openapi_path
23
+ ::File.expand_path('../../../openapi.yml', __dir__)
24
+ end
25
+ private_class_method :openapi_path
20
26
  end
21
27
  end
22
28
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.30.0'
5
+ VERSION = '0.34.0'
6
6
  end
7
7
  end
@@ -79,12 +79,24 @@ paths:
79
79
  responses:
80
80
  '200':
81
81
  description: noop
82
-
82
+ /validate/Description:
83
+ post:
84
+ summary: Validate a Description
85
+ requestBody:
86
+ required: true
87
+ content:
88
+ application/json:
89
+ schema:
90
+ $ref: '#/components/schemas/Description'
91
+ responses:
92
+ '200':
93
+ description: noop
83
94
  components:
84
95
  schemas:
85
96
  Access:
86
97
  description: Access metadata
87
98
  type: object
99
+ additionalProperties: false
88
100
  properties:
89
101
  access:
90
102
  description: Access level
@@ -96,8 +108,28 @@ components:
96
108
  - 'citation-only'
97
109
  - 'dark'
98
110
  default: 'dark'
111
+ download:
112
+ description: Download access level for a file
113
+ type: string
114
+ enum:
115
+ - 'world'
116
+ - 'stanford'
117
+ - 'location-based'
118
+ - 'none'
119
+ default: 'none'
120
+ readLocation:
121
+ description: If access is "location-based", which location should have access.
122
+ type: string
123
+ enum:
124
+ - 'spec'
125
+ - 'music'
126
+ - 'ars'
127
+ - 'art'
128
+ - 'hoover'
129
+ - 'm&m'
99
130
  Administrative:
100
131
  type: object
132
+ additionalProperties: false
101
133
  properties:
102
134
  hasAdminPolicy:
103
135
  $ref: '#/components/schemas/Druid'
@@ -110,8 +142,11 @@ components:
110
142
  description: Administrative or Internal project this resource is a part of
111
143
  example: Google Books
112
144
  type: string
145
+ required:
146
+ - hasAdminPolicy
113
147
  AdminPolicy:
114
148
  type: object
149
+ additionalProperties: false
115
150
  properties:
116
151
  type:
117
152
  type: string
@@ -129,13 +164,14 @@ components:
129
164
  description:
130
165
  $ref: '#/components/schemas/Description'
131
166
  required:
167
+ - administrative
132
168
  - externalIdentifier
133
169
  - label
134
170
  - type
135
171
  - version
136
- - administrative
137
172
  AdminPolicyAdministrative:
138
173
  type: object
174
+ additionalProperties: false
139
175
  properties:
140
176
  defaultObjectRights:
141
177
  type: string
@@ -144,8 +180,21 @@ components:
144
180
  type: string
145
181
  hasAdminPolicy:
146
182
  type: string
183
+ required:
184
+ - hasAdminPolicy
185
+ AppliesTo:
186
+ description: Property model for indicating the parts, aspects, or versions of the resource to which a
187
+ descriptive element is applicable.
188
+ type: object
189
+ additionalProperties: false
190
+ properties:
191
+ appliesTo:
192
+ type: array
193
+ items:
194
+ $ref: "#/components/schemas/DescriptiveBasicValue"
147
195
  CatalogLink:
148
196
  type: object
197
+ additionalProperties: false
149
198
  required:
150
199
  - catalog
151
200
  - catalogRecordId
@@ -161,6 +210,7 @@ components:
161
210
  Collection:
162
211
  description: A group of Digital Repository Objects that indicate some type of conceptual grouping within the domain that is worth reusing across the system.
163
212
  type: object
213
+ additionalProperties: false
164
214
  properties:
165
215
  type:
166
216
  description: The content type of the Collection. Selected from an established set of values.
@@ -196,24 +246,183 @@ components:
196
246
  - access
197
247
  CollectionIdentification:
198
248
  type: object
249
+ additionalProperties: false
199
250
  properties:
200
251
  catalogLinks:
201
252
  type: array
202
253
  items:
203
254
  $ref: '#/components/schemas/CatalogLink'
255
+ Contributor:
256
+ description: Property model for describing agents contributing in some way to
257
+ the creation and history of the resource
258
+ type: object
259
+ additionalProperties: false
260
+ properties:
261
+ name:
262
+ description: Names associated with a contributor.
263
+ type: array
264
+ items:
265
+ $ref: "#/components/schemas/DescriptiveValue"
266
+ type:
267
+ description: Entity type of the contributor (person, organization, etc.).
268
+ type: string
269
+ status:
270
+ description: Status of the contributor relative to other parallel contributors.
271
+ type: string
272
+ role:
273
+ description: Relationships of the contributor to the resource or to an event
274
+ in its history.
275
+ type: array
276
+ items:
277
+ $ref: "#/components/schemas/DescriptiveValue"
278
+ DescriptiveAdminMetadata:
279
+ description: Information about this description of the resource.
280
+ type: object
281
+ additionalProperties: false
282
+ properties:
283
+ contributor:
284
+ type: array
285
+ items:
286
+ $ref: "#/components/schemas/Contributor"
287
+ event:
288
+ type: array
289
+ items:
290
+ $ref: "#/components/schemas/Event"
291
+ language:
292
+ type: array
293
+ items:
294
+ $ref: "#/components/schemas/DescriptiveValue"
295
+ note:
296
+ type: array
297
+ items:
298
+ $ref: "#/components/schemas/DescriptiveValue"
299
+ DescriptiveBasicValue:
300
+ description: Value model for descriptive elements without recursive properties.
301
+ type: object
302
+ additionalProperties: false
303
+ properties:
304
+ value:
305
+ description: String value of the descriptive element.
306
+ type: string
307
+ type:
308
+ description: Type of value provided by the descriptive element.
309
+ type: string
310
+ status:
311
+ description: Status of the descriptive element relative to other instances
312
+ of the element.
313
+ type: string
314
+ code:
315
+ description: Code value of the descriptive element.
316
+ type: string
317
+ uri:
318
+ description: URI value of the descriptive element.
319
+ type: string
320
+ format: uri
321
+ standard:
322
+ description: Descriptive or content standard to which the value conforms.
323
+ type: array
324
+ items:
325
+ type: string
326
+ encoding:
327
+ description: Encoding schema, standard, or syntax to which the value conforms.
328
+ type: array
329
+ items:
330
+ type: string
331
+ source:
332
+ $ref: "#/components/schemas/Source"
333
+ DescriptiveStructuredValue:
334
+ description: Value model for descriptive elements structured as typed values.
335
+ type: object
336
+ additionalProperties: false
337
+ properties:
338
+ structuredValue:
339
+ type: array
340
+ items:
341
+ $ref: "#/components/schemas/DescriptiveBasicValue"
342
+ DescriptiveValue:
343
+ description: Default value model for descriptive elements.
344
+ type: object
345
+ additionalProperties: false
346
+ allOf:
347
+ - $ref: "#/components/schemas/DescriptiveBasicValue"
348
+ - $ref: "#/components/schemas/DescriptiveStructuredValue"
349
+ - $ref: "#/components/schemas/AppliesTo"
350
+ DescriptiveValueRequired:
351
+ type: object
352
+ additionalProperties: false
353
+ allOf:
354
+ - $ref: "#/components/schemas/DescriptiveValue"
355
+ - anyOf:
356
+ - type: object
357
+ required:
358
+ - value
359
+ - type: object
360
+ required:
361
+ - structuredValue
204
362
  Description:
205
- description: Descriptive metadata
206
363
  type: object
364
+ additionalProperties: false
207
365
  properties:
208
366
  title:
367
+ description: Titles of the resource.
368
+ type: array
369
+ minItems: 1
370
+ items:
371
+ $ref: "#/components/schemas/DescriptiveValueRequired"
372
+ contributor:
373
+ description: Agents contributing in some way to the creation and history of the
374
+ resource.
375
+ type: array
376
+ items:
377
+ $ref: "#/components/schemas/Contributor"
378
+ event:
379
+ description: Events in the history of the resource.
380
+ type: array
381
+ items:
382
+ $ref: "#/components/schemas/Event"
383
+ form:
384
+ description: Characteristics of the resource's physical, digital, and intellectual
385
+ form and genre.
386
+ type: array
387
+ items:
388
+ $ref: "#/components/schemas/DescriptiveValue"
389
+ language:
390
+ description: Languages, scripts, and notations used in all or part of a resource.
391
+ type: array
392
+ items:
393
+ $ref: "#/components/schemas/DescriptiveValue"
394
+ note:
395
+ description: Additional information relevant to a resource.
396
+ type: array
397
+ items:
398
+ $ref: "#/components/schemas/DescriptiveValue"
399
+ identifier:
400
+ description: Unique strings associated with the resource.
401
+ type: array
402
+ items:
403
+ $ref: "#/components/schemas/DescriptiveValue"
404
+ purl:
405
+ description: Stanford persistent URL associated with the resource.
406
+ type: string
407
+ format: uri
408
+ url:
409
+ description: URLs where the resource may be accessed in full or part.
410
+ type: array
411
+ items:
412
+ $ref: "#/components/schemas/DescriptiveValue"
413
+ marcEncodedData:
414
+ description: Data about the resource represented in MARC fixed fields and codes.
209
415
  type: array
210
416
  items:
211
- $ref: '#/components/schemas/Title'
417
+ $ref: "#/components/schemas/DescriptiveValue"
418
+ adminMetadata:
419
+ $ref: "#/components/schemas/DescriptiveAdminMetadata"
212
420
  required:
213
421
  - title
214
422
  DRO:
215
423
  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.
216
424
  type: object
425
+ additionalProperties: false
217
426
  properties:
218
427
  type:
219
428
  description: The content type of the DRO. Selected from an established set of values.
@@ -256,13 +465,15 @@ components:
256
465
  geographic:
257
466
  $ref: '#/components/schemas/Geographic'
258
467
  required:
468
+ - access
469
+ - administrative
259
470
  - externalIdentifier
260
471
  - label
261
472
  - type
262
473
  - version
263
- - access
264
474
  DROAccess:
265
475
  type: object
476
+ additionalProperties: false
266
477
  properties:
267
478
  access:
268
479
  type: string
@@ -277,15 +488,43 @@ components:
277
488
  description: The human readable copyright statement that applies
278
489
  example: Copyright World Trade Organization
279
490
  type: string
491
+ embargo:
492
+ $ref: '#/components/schemas/Embargo'
493
+ download:
494
+ description: >
495
+ Download access level. This is used in the transition from Fedora as
496
+ a way to set a default download level at registration that is copied
497
+ down to all the files.
498
+
499
+ type: string
500
+ enum:
501
+ - 'world'
502
+ - 'stanford'
503
+ - 'location-based'
504
+ - 'none'
505
+ default: 'none'
506
+ readLocation:
507
+ description: >
508
+ If access is "location-based", which location should have access.
509
+ This is used in the transition from Fedora as a way to set a default
510
+ readLocation at registration that is copied down to all the files.
511
+
512
+ type: string
513
+ enum:
514
+ - 'spec'
515
+ - 'music'
516
+ - 'ars'
517
+ - 'art'
518
+ - 'hoover'
519
+ - 'm&m'
280
520
  useAndReproductionStatement:
281
521
  description: The human readable use and reproduction statement that applies
282
522
  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).
283
523
  type: string
284
- embargo:
285
- $ref: '#/components/schemas/Embargo'
286
524
  DROStructural:
287
525
  description: Structural metadata
288
526
  type: object
527
+ additionalProperties: false
289
528
  properties:
290
529
  contains:
291
530
  description: Filesets that contain the digital representations (Files)
@@ -308,6 +547,7 @@ components:
308
547
  example: 'druid:bc123df4567'
309
548
  Embargo:
310
549
  type: object
550
+ additionalProperties: false
311
551
  properties:
312
552
  releaseDate:
313
553
  description: Date when the Collection is released from an embargo.
@@ -330,9 +570,42 @@ components:
330
570
  required:
331
571
  - releaseDate
332
572
  - access
573
+ Event:
574
+ description: Property model for describing events in the history of the resource.
575
+ type: object
576
+ additionalProperties: false
577
+ allOf:
578
+ - $ref: "#/components/schemas/DescriptiveStructuredValue"
579
+ - type: object
580
+ additionalProperties: false
581
+ properties:
582
+ type:
583
+ description: Description of the event (creation, publication, etc.).
584
+ type: string
585
+ date:
586
+ description: Dates associated with the event.
587
+ type: array
588
+ items:
589
+ $ref: "#/components/schemas/DescriptiveValue"
590
+ contributor:
591
+ description: Contributors associated with the event.
592
+ type: array
593
+ items:
594
+ $ref: "#/components/schemas/Contributor"
595
+ location:
596
+ description: Locations associated with the event.
597
+ type: array
598
+ items:
599
+ $ref: "#/components/schemas/DescriptiveValue"
600
+ note:
601
+ description: Other information about the event.
602
+ type: array
603
+ items:
604
+ $ref: "#/components/schemas/DescriptiveValue"
333
605
  File:
334
606
  description: Binaries that are the basis of what our domain manages. Binaries here do not include metadata files generated for the domain's own management purposes.
335
607
  type: object
608
+ additionalProperties: false
336
609
  properties:
337
610
  type:
338
611
  description: The content type of the File.
@@ -373,6 +646,7 @@ components:
373
646
  required:
374
647
  - externalIdentifier
375
648
  - label
649
+ - filename
376
650
  - type
377
651
  - version
378
652
  - access
@@ -380,6 +654,7 @@ components:
380
654
  - hasMessageDigests
381
655
  FileAdministrative:
382
656
  type: object
657
+ additionalProperties: false
383
658
  properties:
384
659
  sdrPreserve:
385
660
  type: boolean
@@ -393,6 +668,7 @@ components:
393
668
  FileSet:
394
669
  description: Relevant groupings of Files. Also called a File Grouping.
395
670
  type: object
671
+ additionalProperties: false
396
672
  properties:
397
673
  type:
398
674
  description: The content type of the Fileset.
@@ -417,6 +693,7 @@ components:
417
693
  FileSetStructural:
418
694
  description: Structural metadata
419
695
  type: object
696
+ additionalProperties: false
420
697
  properties:
421
698
  contains:
422
699
  type: array
@@ -425,6 +702,7 @@ components:
425
702
  Geographic:
426
703
  description: Geographic metadata
427
704
  type: object
705
+ additionalProperties: false
428
706
  properties:
429
707
  iso19139:
430
708
  description: Geographic ISO 19139 XML metadata
@@ -433,9 +711,17 @@ components:
433
711
  - iso19139
434
712
  Identification:
435
713
  type: object
714
+ additionalProperties: false
436
715
  properties:
437
716
  sourceId:
438
717
  type: string
718
+ description: >
719
+ Unique identifier in some other system. This is because a large proportion of what is deposited in SDR,
720
+ historically and currently, are representations of objects that are also represented in other systems.
721
+ For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed
722
+ in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers
723
+ and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to
724
+ look for the original item if you're looking at its SDR representation.
439
725
  example: 'sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026'
440
726
  catalogLinks:
441
727
  type: array
@@ -444,6 +730,7 @@ components:
444
730
  MessageDigest:
445
731
  description: The output of the message digest algorithm.
446
732
  type: object
733
+ additionalProperties: false
447
734
  properties:
448
735
  type:
449
736
  description: The algorithm that was used
@@ -460,6 +747,7 @@ components:
460
747
  Presentation:
461
748
  description: Presentation data for the File.
462
749
  type: object
750
+ additionalProperties: false
463
751
  properties:
464
752
  height:
465
753
  description: Height in pixels
@@ -470,6 +758,7 @@ components:
470
758
  ReleaseTag:
471
759
  description: A tag that indicates the item or collection should be released.
472
760
  type: object
761
+ additionalProperties: false
473
762
  required:
474
763
  - release
475
764
  properties:
@@ -497,6 +786,7 @@ components:
497
786
  RequestAdminPolicy:
498
787
  description: Same as an AdminPolicy, but doesn't have an externalIdentifier as one will be created
499
788
  type: object
789
+ additionalProperties: false
500
790
  properties:
501
791
  type:
502
792
  type: string
@@ -512,13 +802,14 @@ components:
512
802
  description:
513
803
  $ref: '#/components/schemas/Description'
514
804
  required:
805
+ - administrative
515
806
  - label
516
807
  - type
517
808
  - version
518
- - administrative
519
809
  RequestCollection:
520
810
  description: Same as a Collection, but doesn't have an externalIdentifier as one will be created
521
811
  type: object
812
+ additionalProperties: false
522
813
  properties:
523
814
  type:
524
815
  type: string
@@ -542,13 +833,15 @@ components:
542
833
  identification:
543
834
  $ref: '#/components/schemas/CollectionIdentification'
544
835
  required:
836
+ - access
837
+ - administrative
545
838
  - label
546
839
  - type
547
840
  - version
548
- - access
549
841
  RequestDRO:
550
842
  description: A request to create a DRO. This has the same general structure as a DRO but doesn't have externalIdentifier and doesn't require the access subschema. If no access subschema is provided, these values will be inherited from the AdminPolicy.
551
843
  type: object
844
+ additionalProperties: false
552
845
  properties:
553
846
  type:
554
847
  type: string
@@ -580,18 +873,22 @@ components:
580
873
  description:
581
874
  $ref: '#/components/schemas/Description'
582
875
  identification:
583
- $ref: '#/components/schemas/Identification'
876
+ $ref: '#/components/schemas/RequestIdentification'
584
877
  structural:
585
878
  $ref: '#/components/schemas/RequestDROStructural'
586
879
  geographic:
587
880
  $ref: '#/components/schemas/Geographic'
588
881
  required:
882
+ - access
883
+ - administrative
884
+ - identification
589
885
  - label
590
886
  - type
591
887
  - version
592
888
  RequestDROStructural:
593
889
  description: Structural metadata
594
890
  type: object
891
+ additionalProperties: false
595
892
  properties:
596
893
  contains:
597
894
  type: array
@@ -607,6 +904,7 @@ components:
607
904
  type: string
608
905
  RequestFile:
609
906
  type: object
907
+ additionalProperties: false
610
908
  properties:
611
909
  type:
612
910
  type: string
@@ -646,6 +944,7 @@ components:
646
944
  - hasMessageDigests
647
945
  RequestFileSet:
648
946
  type: object
947
+ additionalProperties: false
649
948
  properties:
650
949
  type:
651
950
  type: string
@@ -665,31 +964,62 @@ components:
665
964
  RequestFileSetStructural:
666
965
  description: Structural metadata
667
966
  type: object
967
+ additionalProperties: false
668
968
  properties:
669
969
  contains:
670
970
  type: array
671
971
  items:
672
972
  $ref: '#/components/schemas/RequestFile'
973
+ RequestIdentification:
974
+ description: Same as a Identification, but requires a sourceId.
975
+ type: object
976
+ additionalProperties: false
977
+ properties:
978
+ sourceId:
979
+ type: string
980
+ description: >
981
+ Unique identifier in some other system. This is because a large proportion of what is deposited in SDR,
982
+ historically and currently, are representations of objects that are also represented in other systems.
983
+ For example, digitized paper and A/V collections have physical manifestations, and those physical objects are managed
984
+ in systems that have their own identifiers. Similarly, books have barcodes, archival materials have collection numbers
985
+ and physical locations, etc. The sourceId allows determining if an item has been deposited before and where to
986
+ look for the original item if you're looking at its SDR representation.
987
+ example: 'sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026'
988
+ catalogLinks:
989
+ type: array
990
+ items:
991
+ $ref: '#/components/schemas/CatalogLink'
992
+ required:
993
+ - sourceId
673
994
  Sequence:
674
995
  description: A sequence or ordering of resources within a Collection or Object.
675
996
  type: object
997
+ additionalProperties: false
676
998
  properties:
999
+ members:
1000
+ description: "Identifiers for Members in their stated Order for the Sequence."
1001
+ type: array
1002
+ items:
1003
+ type: string
677
1004
  viewingDirection:
678
1005
  description: The direction that a sequence of canvases should be displayed to the user
679
1006
  type: string
680
1007
  enum:
681
1008
  - right-to-left
682
1009
  - left-to-right
683
- Title:
684
- description: The title of the object.
1010
+ Source:
1011
+ description: Property model for indicating the vocabulary, authority, or other
1012
+ origin for a term, code, or identifier.
685
1013
  type: object
1014
+ additionalProperties: false
686
1015
  properties:
687
- primary:
688
- description: Is this the primary title for the object
689
- type: boolean
690
- titleFull:
691
- description: The full title for the object
1016
+ code:
1017
+ description: Code representing the value source.
1018
+ type: string
1019
+ uri:
1020
+ description: URI for the value source.
1021
+ type: string
1022
+ format: uri
1023
+ value:
1024
+ description: String describing the value source.
692
1025
  type: string
693
- required:
694
- - primary
695
- - titleFull