cocina-models 0.29.0 → 0.30.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +10 -3
- data/README.md +11 -0
- data/cocina-models.gemspec +5 -0
- data/exe/generator +9 -0
- data/lib/cocina/generator.rb +18 -0
- data/lib/cocina/generator/generator.rb +80 -0
- data/lib/cocina/generator/schema.rb +84 -0
- data/lib/cocina/generator/schema_array.rb +20 -0
- data/lib/cocina/generator/schema_base.rb +49 -0
- data/lib/cocina/generator/schema_ref.rb +16 -0
- data/lib/cocina/generator/schema_value.rb +60 -0
- data/lib/cocina/generator/vocab.rb +63 -0
- data/lib/cocina/models.rb +51 -25
- data/lib/cocina/models/access.rb +10 -0
- data/lib/cocina/models/admin_policy.rb +13 -56
- data/lib/cocina/models/admin_policy_administrative.rb +11 -0
- data/lib/cocina/models/administrative.rb +14 -0
- data/lib/cocina/models/catalog_link.rb +4 -1
- data/lib/cocina/models/collection.rb +21 -31
- data/lib/cocina/models/collection_identification.rb +9 -0
- data/lib/cocina/models/description.rb +1 -8
- data/lib/cocina/models/dro.rb +34 -70
- data/lib/cocina/models/dro_access.rb +16 -0
- data/lib/cocina/models/dro_structural.rb +14 -0
- data/lib/cocina/models/embargo.rb +16 -0
- data/lib/cocina/models/file.rb +20 -36
- data/lib/cocina/models/file_administrative.rb +10 -0
- data/lib/cocina/models/file_set.rb +8 -15
- data/lib/cocina/models/file_set_structural.rb +9 -0
- data/lib/cocina/models/geographic.rb +10 -0
- data/lib/cocina/models/identification.rb +11 -0
- data/lib/cocina/models/message_digest.rb +17 -0
- data/lib/cocina/models/presentation.rb +12 -0
- data/lib/cocina/models/release_tag.rb +12 -7
- data/lib/cocina/models/request_admin_policy.rb +15 -3
- data/lib/cocina/models/request_collection.rb +21 -4
- data/lib/cocina/models/request_dro.rb +32 -11
- data/lib/cocina/models/request_dro_structural.rb +13 -0
- data/lib/cocina/models/request_file.rb +15 -6
- data/lib/cocina/models/request_file_set.rb +7 -9
- data/lib/cocina/models/request_file_set_structural.rb +9 -0
- data/lib/cocina/models/sequence.rb +2 -5
- data/lib/cocina/models/title.rb +12 -0
- data/lib/cocina/models/validator.rb +22 -0
- data/lib/cocina/models/version.rb +1 -1
- data/lib/cocina/models/vocab.rb +45 -60
- data/openapi.yml +695 -0
- metadata +101 -9
- data/lib/cocina/models/admin_policy_attributes.rb +0 -21
- data/lib/cocina/models/collection_attributes.rb +0 -22
- data/lib/cocina/models/dro_attributes.rb +0 -22
- data/lib/cocina/models/file_attributes.rb +0 -25
- data/lib/cocina/models/file_set_attributes.rb +0 -16
- data/lib/cocina/models/types.rb +0 -10
@@ -2,12 +2,9 @@
|
|
2
2
|
|
3
3
|
module Cocina
|
4
4
|
module Models
|
5
|
-
# Metadata for a sequence. See http://sul-dlss.github.io/cocina-models/maps/Sequence.json
|
6
5
|
class Sequence < Struct
|
7
|
-
|
8
|
-
|
9
|
-
'top-to-bottom',
|
10
|
-
'bottom-to-top').optional
|
6
|
+
# The direction that a sequence of canvases should be displayed to the user
|
7
|
+
attribute :viewingDirection, Types::Strict::String.enum('right-to-left', 'left-to-right').meta(omittable: true)
|
11
8
|
end
|
12
9
|
end
|
13
10
|
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
class Title < Struct
|
6
|
+
# Is this the primary title for the object
|
7
|
+
attribute :primary, Types::Strict::Bool.default(false)
|
8
|
+
# The full title for the object
|
9
|
+
attribute :titleFull, Types::Strict::String
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Cocina
|
4
|
+
module Models
|
5
|
+
# Perform validation against openapi
|
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
|
+
def self.validate(clazz, attributes)
|
14
|
+
method_name = clazz.name.split('::').last
|
15
|
+
request_operation = root.request_operation(:post, "/validate/#{method_name}")
|
16
|
+
request_operation.validate_request_body('application/json', attributes)
|
17
|
+
rescue OpenAPIParser::OpenAPIError => e
|
18
|
+
raise ValidationError, e.message
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/cocina/models/vocab.rb
CHANGED
@@ -4,111 +4,96 @@ module Cocina
|
|
4
4
|
module Models
|
5
5
|
# A digital repository object. See http://sul-dlss.github.io/cocina-models/maps/DRO.json
|
6
6
|
class Vocab
|
7
|
-
|
8
|
-
|
9
|
-
|
7
|
+
def self.three_dimensional
|
8
|
+
'http://cocina.sul.stanford.edu/models/3d.jsonld'
|
9
|
+
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
"#{ROOT}object.jsonld"
|
11
|
+
def self.admin_policy
|
12
|
+
'http://cocina.sul.stanford.edu/models/admin_policy.jsonld'
|
14
13
|
end
|
15
14
|
|
16
15
|
def self.agreement
|
17
|
-
|
16
|
+
'http://cocina.sul.stanford.edu/models/agreement.jsonld'
|
18
17
|
end
|
19
18
|
|
20
|
-
def self.
|
21
|
-
|
19
|
+
def self.book
|
20
|
+
'http://cocina.sul.stanford.edu/models/book.jsonld'
|
22
21
|
end
|
23
22
|
|
24
|
-
def self.
|
25
|
-
|
23
|
+
def self.collection
|
24
|
+
'http://cocina.sul.stanford.edu/models/collection.jsonld'
|
26
25
|
end
|
27
26
|
|
28
|
-
def self.
|
29
|
-
|
27
|
+
def self.curated_collection
|
28
|
+
'http://cocina.sul.stanford.edu/models/curated-collection.jsonld'
|
30
29
|
end
|
31
30
|
|
32
|
-
def self.
|
33
|
-
|
31
|
+
def self.document
|
32
|
+
'http://cocina.sul.stanford.edu/models/document.jsonld'
|
34
33
|
end
|
35
34
|
|
36
|
-
def self.
|
37
|
-
|
35
|
+
def self.exhibit
|
36
|
+
'http://cocina.sul.stanford.edu/models/exhibit.jsonld'
|
38
37
|
end
|
39
38
|
|
40
|
-
def self.
|
41
|
-
|
39
|
+
def self.file
|
40
|
+
'http://cocina.sul.stanford.edu/models/file.jsonld'
|
42
41
|
end
|
43
42
|
|
44
|
-
def self.
|
45
|
-
|
43
|
+
def self.fileset
|
44
|
+
'http://cocina.sul.stanford.edu/models/fileset.jsonld'
|
46
45
|
end
|
47
46
|
|
48
|
-
def self.
|
49
|
-
|
47
|
+
def self.geo
|
48
|
+
'http://cocina.sul.stanford.edu/models/geo.jsonld'
|
50
49
|
end
|
51
50
|
|
52
|
-
def self.
|
53
|
-
|
51
|
+
def self.image
|
52
|
+
'http://cocina.sul.stanford.edu/models/image.jsonld'
|
54
53
|
end
|
55
54
|
|
56
|
-
|
57
|
-
|
58
|
-
"#{ROOT}media.jsonld"
|
55
|
+
def self.manuscript
|
56
|
+
'http://cocina.sul.stanford.edu/models/manuscript.jsonld'
|
59
57
|
end
|
60
58
|
|
61
|
-
def self.
|
62
|
-
|
59
|
+
def self.map
|
60
|
+
'http://cocina.sul.stanford.edu/models/map.jsonld'
|
63
61
|
end
|
64
62
|
|
65
|
-
def self.
|
66
|
-
|
63
|
+
def self.media
|
64
|
+
'http://cocina.sul.stanford.edu/models/media.jsonld'
|
67
65
|
end
|
68
66
|
|
69
|
-
def self.
|
70
|
-
|
67
|
+
def self.object
|
68
|
+
'http://cocina.sul.stanford.edu/models/object.jsonld'
|
71
69
|
end
|
72
70
|
|
73
|
-
|
74
|
-
|
75
|
-
def self.file
|
76
|
-
"#{ROOT}file.jsonld"
|
71
|
+
def self.page
|
72
|
+
'http://cocina.sul.stanford.edu/models/page.jsonld'
|
77
73
|
end
|
78
74
|
|
79
|
-
|
80
|
-
|
81
|
-
def self.fileset
|
82
|
-
"#{ROOT}fileset.jsonld"
|
75
|
+
def self.photograph
|
76
|
+
'http://cocina.sul.stanford.edu/models/photograph.jsonld'
|
83
77
|
end
|
84
78
|
|
85
|
-
|
86
|
-
|
87
|
-
# The most generic type of collection
|
88
|
-
def self.collection
|
89
|
-
"#{ROOT}collection.jsonld"
|
79
|
+
def self.series
|
80
|
+
'http://cocina.sul.stanford.edu/models/series.jsonld'
|
90
81
|
end
|
91
82
|
|
92
|
-
def self.
|
93
|
-
|
83
|
+
def self.track
|
84
|
+
'http://cocina.sul.stanford.edu/models/track.jsonld'
|
94
85
|
end
|
95
86
|
|
96
87
|
def self.user_collection
|
97
|
-
|
98
|
-
end
|
99
|
-
|
100
|
-
def self.exhibit
|
101
|
-
"#{ROOT}exhibit.jsonld"
|
88
|
+
'http://cocina.sul.stanford.edu/models/user-collection.jsonld'
|
102
89
|
end
|
103
90
|
|
104
|
-
def self.
|
105
|
-
|
91
|
+
def self.webarchive_binary
|
92
|
+
'http://cocina.sul.stanford.edu/models/webarchive-binary.jsonld'
|
106
93
|
end
|
107
94
|
|
108
|
-
|
109
|
-
|
110
|
-
def self.admin_policy
|
111
|
-
"#{ROOT}admin_policy.jsonld"
|
95
|
+
def self.webarchive_seed
|
96
|
+
'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'
|
112
97
|
end
|
113
98
|
end
|
114
99
|
end
|
data/openapi.yml
ADDED
@@ -0,0 +1,695 @@
|
|
1
|
+
openapi: 3.0.0
|
2
|
+
info:
|
3
|
+
description: Specification for Cocina Models
|
4
|
+
version: 1.0.0
|
5
|
+
title: Cocina Models
|
6
|
+
license:
|
7
|
+
name: Apache 2.0
|
8
|
+
url: 'http://www.apache.org/licenses/LICENSE-2.0.html'
|
9
|
+
paths:
|
10
|
+
/validate/DRO:
|
11
|
+
post:
|
12
|
+
summary: Validate a DRO
|
13
|
+
requestBody:
|
14
|
+
required: true
|
15
|
+
content:
|
16
|
+
application/json:
|
17
|
+
schema:
|
18
|
+
$ref: '#/components/schemas/DRO'
|
19
|
+
responses:
|
20
|
+
'200':
|
21
|
+
description: noop
|
22
|
+
/validate/RequestDRO:
|
23
|
+
post:
|
24
|
+
summary: Validate a Request DRO
|
25
|
+
requestBody:
|
26
|
+
required: true
|
27
|
+
content:
|
28
|
+
application/json:
|
29
|
+
schema:
|
30
|
+
$ref: '#/components/schemas/RequestDRO'
|
31
|
+
responses:
|
32
|
+
'200':
|
33
|
+
description: noop
|
34
|
+
/validate/Collection:
|
35
|
+
post:
|
36
|
+
summary: Validate a Collection
|
37
|
+
requestBody:
|
38
|
+
required: true
|
39
|
+
content:
|
40
|
+
application/json:
|
41
|
+
schema:
|
42
|
+
$ref: '#/components/schemas/Collection'
|
43
|
+
responses:
|
44
|
+
'200':
|
45
|
+
description: noop
|
46
|
+
/validate/RequestCollection:
|
47
|
+
post:
|
48
|
+
summary: Validate a Request Collection
|
49
|
+
requestBody:
|
50
|
+
required: true
|
51
|
+
content:
|
52
|
+
application/json:
|
53
|
+
schema:
|
54
|
+
$ref: '#/components/schemas/RequestCollection'
|
55
|
+
responses:
|
56
|
+
'200':
|
57
|
+
description: noop
|
58
|
+
/validate/AdminPolicy:
|
59
|
+
post:
|
60
|
+
summary: Validate an AdminPolicy
|
61
|
+
requestBody:
|
62
|
+
required: true
|
63
|
+
content:
|
64
|
+
application/json:
|
65
|
+
schema:
|
66
|
+
$ref: '#/components/schemas/AdminPolicy'
|
67
|
+
responses:
|
68
|
+
'200':
|
69
|
+
description: noop
|
70
|
+
/validate/RequestAdminPolicy:
|
71
|
+
post:
|
72
|
+
summary: Validate a Request AdminPolicy
|
73
|
+
requestBody:
|
74
|
+
required: true
|
75
|
+
content:
|
76
|
+
application/json:
|
77
|
+
schema:
|
78
|
+
$ref: '#/components/schemas/RequestAdminPolicy'
|
79
|
+
responses:
|
80
|
+
'200':
|
81
|
+
description: noop
|
82
|
+
|
83
|
+
components:
|
84
|
+
schemas:
|
85
|
+
Access:
|
86
|
+
description: Access metadata
|
87
|
+
type: object
|
88
|
+
properties:
|
89
|
+
access:
|
90
|
+
description: Access level
|
91
|
+
type: string
|
92
|
+
enum:
|
93
|
+
- 'world'
|
94
|
+
- 'stanford'
|
95
|
+
- 'location-based'
|
96
|
+
- 'citation-only'
|
97
|
+
- 'dark'
|
98
|
+
default: 'dark'
|
99
|
+
Administrative:
|
100
|
+
type: object
|
101
|
+
properties:
|
102
|
+
hasAdminPolicy:
|
103
|
+
$ref: '#/components/schemas/Druid'
|
104
|
+
releaseTags:
|
105
|
+
description: Tags for release
|
106
|
+
type: array
|
107
|
+
items:
|
108
|
+
$ref: '#/components/schemas/ReleaseTag'
|
109
|
+
partOfProject:
|
110
|
+
description: Administrative or Internal project this resource is a part of
|
111
|
+
example: Google Books
|
112
|
+
type: string
|
113
|
+
AdminPolicy:
|
114
|
+
type: object
|
115
|
+
properties:
|
116
|
+
type:
|
117
|
+
type: string
|
118
|
+
enum:
|
119
|
+
- 'http://cocina.sul.stanford.edu/models/admin_policy.jsonld'
|
120
|
+
example: item
|
121
|
+
externalIdentifier:
|
122
|
+
$ref: '#/components/schemas/Druid'
|
123
|
+
label:
|
124
|
+
type: string
|
125
|
+
version:
|
126
|
+
type: integer
|
127
|
+
administrative:
|
128
|
+
$ref: '#/components/schemas/AdminPolicyAdministrative'
|
129
|
+
description:
|
130
|
+
$ref: '#/components/schemas/Description'
|
131
|
+
required:
|
132
|
+
- externalIdentifier
|
133
|
+
- label
|
134
|
+
- type
|
135
|
+
- version
|
136
|
+
- administrative
|
137
|
+
AdminPolicyAdministrative:
|
138
|
+
type: object
|
139
|
+
properties:
|
140
|
+
defaultObjectRights:
|
141
|
+
type: string
|
142
|
+
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>
|
143
|
+
registrationWorkflow:
|
144
|
+
type: string
|
145
|
+
hasAdminPolicy:
|
146
|
+
type: string
|
147
|
+
CatalogLink:
|
148
|
+
type: object
|
149
|
+
required:
|
150
|
+
- catalog
|
151
|
+
- catalogRecordId
|
152
|
+
properties:
|
153
|
+
catalog:
|
154
|
+
description: Catalog that is the source of the linked record.
|
155
|
+
type: string
|
156
|
+
example: symphony
|
157
|
+
catalogRecordId:
|
158
|
+
description: Record identifier that is unique within the context of the linked record's catalog.
|
159
|
+
type: string
|
160
|
+
example: 11403803
|
161
|
+
Collection:
|
162
|
+
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
|
+
type: object
|
164
|
+
properties:
|
165
|
+
type:
|
166
|
+
description: The content type of the Collection. Selected from an established set of values.
|
167
|
+
type: string
|
168
|
+
enum:
|
169
|
+
- 'http://cocina.sul.stanford.edu/models/collection.jsonld'
|
170
|
+
- 'http://cocina.sul.stanford.edu/models/curated-collection.jsonld'
|
171
|
+
- 'http://cocina.sul.stanford.edu/models/user-collection.jsonld'
|
172
|
+
- 'http://cocina.sul.stanford.edu/models/exhibit.jsonld'
|
173
|
+
- 'http://cocina.sul.stanford.edu/models/series.jsonld'
|
174
|
+
example: item
|
175
|
+
externalIdentifier:
|
176
|
+
$ref: '#/components/schemas/Druid'
|
177
|
+
label:
|
178
|
+
description: Primary processing label (can be same as title) for a Collection.
|
179
|
+
type: string
|
180
|
+
version:
|
181
|
+
description: Version for the Collection within SDR.
|
182
|
+
type: integer
|
183
|
+
access:
|
184
|
+
$ref: '#/components/schemas/Access'
|
185
|
+
administrative:
|
186
|
+
$ref: '#/components/schemas/Administrative'
|
187
|
+
description:
|
188
|
+
$ref: '#/components/schemas/Description'
|
189
|
+
identification:
|
190
|
+
$ref: '#/components/schemas/CollectionIdentification'
|
191
|
+
required:
|
192
|
+
- externalIdentifier
|
193
|
+
- label
|
194
|
+
- type
|
195
|
+
- version
|
196
|
+
- access
|
197
|
+
CollectionIdentification:
|
198
|
+
type: object
|
199
|
+
properties:
|
200
|
+
catalogLinks:
|
201
|
+
type: array
|
202
|
+
items:
|
203
|
+
$ref: '#/components/schemas/CatalogLink'
|
204
|
+
Description:
|
205
|
+
description: Descriptive metadata
|
206
|
+
type: object
|
207
|
+
properties:
|
208
|
+
title:
|
209
|
+
type: array
|
210
|
+
items:
|
211
|
+
$ref: '#/components/schemas/Title'
|
212
|
+
required:
|
213
|
+
- title
|
214
|
+
DRO:
|
215
|
+
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
|
+
type: object
|
217
|
+
properties:
|
218
|
+
type:
|
219
|
+
description: The content type of the DRO. Selected from an established set of values.
|
220
|
+
type: string
|
221
|
+
enum:
|
222
|
+
- 'http://cocina.sul.stanford.edu/models/object.jsonld'
|
223
|
+
- 'http://cocina.sul.stanford.edu/models/3d.jsonld'
|
224
|
+
- 'http://cocina.sul.stanford.edu/models/agreement.jsonld'
|
225
|
+
- 'http://cocina.sul.stanford.edu/models/book.jsonld'
|
226
|
+
- 'http://cocina.sul.stanford.edu/models/document.jsonld'
|
227
|
+
- 'http://cocina.sul.stanford.edu/models/geo.jsonld'
|
228
|
+
- 'http://cocina.sul.stanford.edu/models/image.jsonld'
|
229
|
+
- 'http://cocina.sul.stanford.edu/models/page.jsonld'
|
230
|
+
- 'http://cocina.sul.stanford.edu/models/photograph.jsonld'
|
231
|
+
- 'http://cocina.sul.stanford.edu/models/manuscript.jsonld'
|
232
|
+
- 'http://cocina.sul.stanford.edu/models/map.jsonld'
|
233
|
+
- 'http://cocina.sul.stanford.edu/models/media.jsonld'
|
234
|
+
- 'http://cocina.sul.stanford.edu/models/track.jsonld'
|
235
|
+
- 'http://cocina.sul.stanford.edu/models/webarchive-binary.jsonld'
|
236
|
+
- 'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'
|
237
|
+
example: item
|
238
|
+
externalIdentifier:
|
239
|
+
$ref: '#/components/schemas/Druid'
|
240
|
+
label:
|
241
|
+
description: Primary processing label (can be same as title) for a DRO.
|
242
|
+
type: string
|
243
|
+
version:
|
244
|
+
description: Version for the DRO within SDR.
|
245
|
+
type: integer
|
246
|
+
access:
|
247
|
+
$ref: '#/components/schemas/DROAccess'
|
248
|
+
administrative:
|
249
|
+
$ref: '#/components/schemas/Administrative'
|
250
|
+
description:
|
251
|
+
$ref: '#/components/schemas/Description'
|
252
|
+
identification:
|
253
|
+
$ref: '#/components/schemas/Identification'
|
254
|
+
structural:
|
255
|
+
$ref: '#/components/schemas/DROStructural'
|
256
|
+
geographic:
|
257
|
+
$ref: '#/components/schemas/Geographic'
|
258
|
+
required:
|
259
|
+
- externalIdentifier
|
260
|
+
- label
|
261
|
+
- type
|
262
|
+
- version
|
263
|
+
- access
|
264
|
+
DROAccess:
|
265
|
+
type: object
|
266
|
+
properties:
|
267
|
+
access:
|
268
|
+
type: string
|
269
|
+
enum:
|
270
|
+
- 'world'
|
271
|
+
- 'stanford'
|
272
|
+
- 'location-based'
|
273
|
+
- 'citation-only'
|
274
|
+
- 'dark'
|
275
|
+
default: 'dark'
|
276
|
+
copyright:
|
277
|
+
description: The human readable copyright statement that applies
|
278
|
+
example: Copyright World Trade Organization
|
279
|
+
type: string
|
280
|
+
useAndReproductionStatement:
|
281
|
+
description: The human readable use and reproduction statement that applies
|
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).
|
283
|
+
type: string
|
284
|
+
embargo:
|
285
|
+
$ref: '#/components/schemas/Embargo'
|
286
|
+
DROStructural:
|
287
|
+
description: Structural metadata
|
288
|
+
type: object
|
289
|
+
properties:
|
290
|
+
contains:
|
291
|
+
description: Filesets that contain the digital representations (Files)
|
292
|
+
type: array
|
293
|
+
items:
|
294
|
+
$ref: '#/components/schemas/FileSet'
|
295
|
+
hasMemberOrders:
|
296
|
+
description: Provided sequences or orderings of members, including some metadata about each sequence (i.e. sequence label, sequence type, if the sequence is primary, etc.).
|
297
|
+
type: array
|
298
|
+
items:
|
299
|
+
$ref: '#/components/schemas/Sequence'
|
300
|
+
isMemberOf:
|
301
|
+
$ref: '#/components/schemas/Druid'
|
302
|
+
hasAgreement:
|
303
|
+
description: Agreement that covers the deposit of the DRO into SDR.
|
304
|
+
type: string
|
305
|
+
Druid:
|
306
|
+
type: string
|
307
|
+
pattern: '^druid:[b-df-hjkmnp-tv-z]{2}[0-9]{3}[b-df-hjkmnp-tv-z]{2}[0-9]{4}$'
|
308
|
+
example: 'druid:bc123df4567'
|
309
|
+
Embargo:
|
310
|
+
type: object
|
311
|
+
properties:
|
312
|
+
releaseDate:
|
313
|
+
description: Date when the Collection is released from an embargo.
|
314
|
+
type: string
|
315
|
+
format: date-time
|
316
|
+
example: '2029-06-22T07:00:00.000+00:00'
|
317
|
+
access:
|
318
|
+
description: Access level that applies when embargo expires.
|
319
|
+
type: string
|
320
|
+
enum:
|
321
|
+
- world
|
322
|
+
- stanford
|
323
|
+
- location-based
|
324
|
+
- citation-only
|
325
|
+
- dark
|
326
|
+
useAndReproductionStatement:
|
327
|
+
description: The human readable use and reproduction statement that applies when the embargo expires.
|
328
|
+
example: These materials are in the public domain.
|
329
|
+
type: string
|
330
|
+
required:
|
331
|
+
- releaseDate
|
332
|
+
- access
|
333
|
+
File:
|
334
|
+
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
|
+
type: object
|
336
|
+
properties:
|
337
|
+
type:
|
338
|
+
description: The content type of the File.
|
339
|
+
type: string
|
340
|
+
enum:
|
341
|
+
- 'http://cocina.sul.stanford.edu/models/file.jsonld'
|
342
|
+
externalIdentifier:
|
343
|
+
description: Identifier for the resource within the SDR architecture but outside of the repository. UUID. Constant across resource versions. What clients will use calling the repository.
|
344
|
+
type: string
|
345
|
+
label:
|
346
|
+
description: Primary processing label (can be same as title) for a File.
|
347
|
+
type: string
|
348
|
+
filename:
|
349
|
+
description: Filename for a file. Can be same as label.
|
350
|
+
type: string
|
351
|
+
size:
|
352
|
+
description: Size of the File (binary) in bytes.
|
353
|
+
type: integer
|
354
|
+
version:
|
355
|
+
description: Version for the File within SDR.
|
356
|
+
type: integer
|
357
|
+
hasMimeType:
|
358
|
+
description: MIME Type of the File.
|
359
|
+
type: string
|
360
|
+
use:
|
361
|
+
description: Use for the File.
|
362
|
+
type: string
|
363
|
+
hasMessageDigests:
|
364
|
+
type: array
|
365
|
+
items:
|
366
|
+
$ref: '#/components/schemas/MessageDigest'
|
367
|
+
access:
|
368
|
+
$ref: '#/components/schemas/Access'
|
369
|
+
administrative:
|
370
|
+
$ref: '#/components/schemas/FileAdministrative'
|
371
|
+
presentation:
|
372
|
+
$ref: '#/components/schemas/Presentation'
|
373
|
+
required:
|
374
|
+
- externalIdentifier
|
375
|
+
- label
|
376
|
+
- type
|
377
|
+
- version
|
378
|
+
- access
|
379
|
+
- administrative
|
380
|
+
- hasMessageDigests
|
381
|
+
FileAdministrative:
|
382
|
+
type: object
|
383
|
+
properties:
|
384
|
+
sdrPreserve:
|
385
|
+
type: boolean
|
386
|
+
default: true
|
387
|
+
shelve:
|
388
|
+
type: boolean
|
389
|
+
default: false
|
390
|
+
required:
|
391
|
+
- sdrPreserve
|
392
|
+
- shelve
|
393
|
+
FileSet:
|
394
|
+
description: Relevant groupings of Files. Also called a File Grouping.
|
395
|
+
type: object
|
396
|
+
properties:
|
397
|
+
type:
|
398
|
+
description: The content type of the Fileset.
|
399
|
+
type: string
|
400
|
+
enum:
|
401
|
+
- 'http://cocina.sul.stanford.edu/models/fileset.jsonld'
|
402
|
+
externalIdentifier:
|
403
|
+
type: string
|
404
|
+
label:
|
405
|
+
description: Primary processing label for a Fileset.
|
406
|
+
type: string
|
407
|
+
version:
|
408
|
+
description: Version for the Fileset within SDR.
|
409
|
+
type: integer
|
410
|
+
structural:
|
411
|
+
$ref: '#/components/schemas/FileSetStructural'
|
412
|
+
required:
|
413
|
+
- externalIdentifier
|
414
|
+
- label
|
415
|
+
- type
|
416
|
+
- version
|
417
|
+
FileSetStructural:
|
418
|
+
description: Structural metadata
|
419
|
+
type: object
|
420
|
+
properties:
|
421
|
+
contains:
|
422
|
+
type: array
|
423
|
+
items:
|
424
|
+
$ref: '#/components/schemas/File'
|
425
|
+
Geographic:
|
426
|
+
description: Geographic metadata
|
427
|
+
type: object
|
428
|
+
properties:
|
429
|
+
iso19139:
|
430
|
+
description: Geographic ISO 19139 XML metadata
|
431
|
+
type: string
|
432
|
+
required:
|
433
|
+
- iso19139
|
434
|
+
Identification:
|
435
|
+
type: object
|
436
|
+
properties:
|
437
|
+
sourceId:
|
438
|
+
type: string
|
439
|
+
example: 'sul:PC0170_s3_Fiesta_Bowl_2012-01-02_210609_2026'
|
440
|
+
catalogLinks:
|
441
|
+
type: array
|
442
|
+
items:
|
443
|
+
$ref: '#/components/schemas/CatalogLink'
|
444
|
+
MessageDigest:
|
445
|
+
description: The output of the message digest algorithm.
|
446
|
+
type: object
|
447
|
+
properties:
|
448
|
+
type:
|
449
|
+
description: The algorithm that was used
|
450
|
+
type: string
|
451
|
+
enum:
|
452
|
+
- md5
|
453
|
+
- sha1
|
454
|
+
digest:
|
455
|
+
description: The digest value Base64 encoded
|
456
|
+
type: string
|
457
|
+
required:
|
458
|
+
- type
|
459
|
+
- digest
|
460
|
+
Presentation:
|
461
|
+
description: Presentation data for the File.
|
462
|
+
type: object
|
463
|
+
properties:
|
464
|
+
height:
|
465
|
+
description: Height in pixels
|
466
|
+
type: integer
|
467
|
+
width:
|
468
|
+
description: Width in pixels
|
469
|
+
type: integer
|
470
|
+
ReleaseTag:
|
471
|
+
description: A tag that indicates the item or collection should be released.
|
472
|
+
type: object
|
473
|
+
required:
|
474
|
+
- release
|
475
|
+
properties:
|
476
|
+
who:
|
477
|
+
description: Who did this release
|
478
|
+
type: string
|
479
|
+
example: petucket
|
480
|
+
what:
|
481
|
+
description: What is being released. This item or the whole collection.
|
482
|
+
type: string
|
483
|
+
enum:
|
484
|
+
- self
|
485
|
+
- collection
|
486
|
+
example: self
|
487
|
+
date:
|
488
|
+
description: When did this action happen
|
489
|
+
type: string
|
490
|
+
format: date-time
|
491
|
+
to:
|
492
|
+
description: What platform is it released to
|
493
|
+
type: string
|
494
|
+
example: Searchworks
|
495
|
+
release:
|
496
|
+
type: boolean
|
497
|
+
RequestAdminPolicy:
|
498
|
+
description: Same as an AdminPolicy, but doesn't have an externalIdentifier as one will be created
|
499
|
+
type: object
|
500
|
+
properties:
|
501
|
+
type:
|
502
|
+
type: string
|
503
|
+
enum:
|
504
|
+
- 'http://cocina.sul.stanford.edu/models/admin_policy.jsonld'
|
505
|
+
example: item
|
506
|
+
label:
|
507
|
+
type: string
|
508
|
+
version:
|
509
|
+
type: integer
|
510
|
+
administrative:
|
511
|
+
$ref: '#/components/schemas/AdminPolicyAdministrative'
|
512
|
+
description:
|
513
|
+
$ref: '#/components/schemas/Description'
|
514
|
+
required:
|
515
|
+
- label
|
516
|
+
- type
|
517
|
+
- version
|
518
|
+
- administrative
|
519
|
+
RequestCollection:
|
520
|
+
description: Same as a Collection, but doesn't have an externalIdentifier as one will be created
|
521
|
+
type: object
|
522
|
+
properties:
|
523
|
+
type:
|
524
|
+
type: string
|
525
|
+
enum:
|
526
|
+
- 'http://cocina.sul.stanford.edu/models/collection.jsonld'
|
527
|
+
- 'http://cocina.sul.stanford.edu/models/curated-collection.jsonld'
|
528
|
+
- 'http://cocina.sul.stanford.edu/models/user-collection.jsonld'
|
529
|
+
- 'http://cocina.sul.stanford.edu/models/exhibit.jsonld'
|
530
|
+
- 'http://cocina.sul.stanford.edu/models/series.jsonld'
|
531
|
+
example: item
|
532
|
+
label:
|
533
|
+
type: string
|
534
|
+
version:
|
535
|
+
type: integer
|
536
|
+
access:
|
537
|
+
$ref: '#/components/schemas/Access'
|
538
|
+
administrative:
|
539
|
+
$ref: '#/components/schemas/Administrative'
|
540
|
+
description:
|
541
|
+
$ref: '#/components/schemas/Description'
|
542
|
+
identification:
|
543
|
+
$ref: '#/components/schemas/CollectionIdentification'
|
544
|
+
required:
|
545
|
+
- label
|
546
|
+
- type
|
547
|
+
- version
|
548
|
+
- access
|
549
|
+
RequestDRO:
|
550
|
+
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
|
+
type: object
|
552
|
+
properties:
|
553
|
+
type:
|
554
|
+
type: string
|
555
|
+
enum:
|
556
|
+
- 'http://cocina.sul.stanford.edu/models/object.jsonld'
|
557
|
+
- 'http://cocina.sul.stanford.edu/models/3d.jsonld'
|
558
|
+
- 'http://cocina.sul.stanford.edu/models/agreement.jsonld'
|
559
|
+
- 'http://cocina.sul.stanford.edu/models/book.jsonld'
|
560
|
+
- 'http://cocina.sul.stanford.edu/models/document.jsonld'
|
561
|
+
- 'http://cocina.sul.stanford.edu/models/geo.jsonld'
|
562
|
+
- 'http://cocina.sul.stanford.edu/models/image.jsonld'
|
563
|
+
- 'http://cocina.sul.stanford.edu/models/page.jsonld'
|
564
|
+
- 'http://cocina.sul.stanford.edu/models/photograph.jsonld'
|
565
|
+
- 'http://cocina.sul.stanford.edu/models/manuscript.jsonld'
|
566
|
+
- 'http://cocina.sul.stanford.edu/models/map.jsonld'
|
567
|
+
- 'http://cocina.sul.stanford.edu/models/media.jsonld'
|
568
|
+
- 'http://cocina.sul.stanford.edu/models/track.jsonld'
|
569
|
+
- 'http://cocina.sul.stanford.edu/models/webarchive-binary.jsonld'
|
570
|
+
- 'http://cocina.sul.stanford.edu/models/webarchive-seed.jsonld'
|
571
|
+
example: item
|
572
|
+
label:
|
573
|
+
type: string
|
574
|
+
version:
|
575
|
+
type: integer
|
576
|
+
access:
|
577
|
+
$ref: '#/components/schemas/DROAccess'
|
578
|
+
administrative:
|
579
|
+
$ref: '#/components/schemas/Administrative'
|
580
|
+
description:
|
581
|
+
$ref: '#/components/schemas/Description'
|
582
|
+
identification:
|
583
|
+
$ref: '#/components/schemas/Identification'
|
584
|
+
structural:
|
585
|
+
$ref: '#/components/schemas/RequestDROStructural'
|
586
|
+
geographic:
|
587
|
+
$ref: '#/components/schemas/Geographic'
|
588
|
+
required:
|
589
|
+
- label
|
590
|
+
- type
|
591
|
+
- version
|
592
|
+
RequestDROStructural:
|
593
|
+
description: Structural metadata
|
594
|
+
type: object
|
595
|
+
properties:
|
596
|
+
contains:
|
597
|
+
type: array
|
598
|
+
items:
|
599
|
+
$ref: '#/components/schemas/RequestFileSet'
|
600
|
+
hasMemberOrders:
|
601
|
+
type: array
|
602
|
+
items:
|
603
|
+
$ref: '#/components/schemas/Sequence'
|
604
|
+
isMemberOf:
|
605
|
+
$ref: '#/components/schemas/Druid'
|
606
|
+
hasAgreement:
|
607
|
+
type: string
|
608
|
+
RequestFile:
|
609
|
+
type: object
|
610
|
+
properties:
|
611
|
+
type:
|
612
|
+
type: string
|
613
|
+
enum:
|
614
|
+
- 'http://cocina.sul.stanford.edu/models/file.jsonld'
|
615
|
+
label:
|
616
|
+
type: string
|
617
|
+
filename:
|
618
|
+
type: string
|
619
|
+
size:
|
620
|
+
type: integer
|
621
|
+
version:
|
622
|
+
type: integer
|
623
|
+
hasMimeType:
|
624
|
+
type: string
|
625
|
+
externalIdentifier:
|
626
|
+
type: string
|
627
|
+
use:
|
628
|
+
type: string
|
629
|
+
hasMessageDigests:
|
630
|
+
type: array
|
631
|
+
items:
|
632
|
+
$ref: '#/components/schemas/MessageDigest'
|
633
|
+
access:
|
634
|
+
$ref: '#/components/schemas/Access'
|
635
|
+
administrative:
|
636
|
+
$ref: '#/components/schemas/FileAdministrative'
|
637
|
+
presentation:
|
638
|
+
$ref: '#/components/schemas/Presentation'
|
639
|
+
required:
|
640
|
+
- label
|
641
|
+
- type
|
642
|
+
- version
|
643
|
+
- filename
|
644
|
+
- access
|
645
|
+
- administrative
|
646
|
+
- hasMessageDigests
|
647
|
+
RequestFileSet:
|
648
|
+
type: object
|
649
|
+
properties:
|
650
|
+
type:
|
651
|
+
type: string
|
652
|
+
enum:
|
653
|
+
- 'http://cocina.sul.stanford.edu/models/fileset.jsonld'
|
654
|
+
label:
|
655
|
+
type: string
|
656
|
+
version:
|
657
|
+
type: integer
|
658
|
+
structural:
|
659
|
+
$ref: '#/components/schemas/RequestFileSetStructural'
|
660
|
+
required:
|
661
|
+
- label
|
662
|
+
- type
|
663
|
+
- version
|
664
|
+
- structural
|
665
|
+
RequestFileSetStructural:
|
666
|
+
description: Structural metadata
|
667
|
+
type: object
|
668
|
+
properties:
|
669
|
+
contains:
|
670
|
+
type: array
|
671
|
+
items:
|
672
|
+
$ref: '#/components/schemas/RequestFile'
|
673
|
+
Sequence:
|
674
|
+
description: A sequence or ordering of resources within a Collection or Object.
|
675
|
+
type: object
|
676
|
+
properties:
|
677
|
+
viewingDirection:
|
678
|
+
description: The direction that a sequence of canvases should be displayed to the user
|
679
|
+
type: string
|
680
|
+
enum:
|
681
|
+
- right-to-left
|
682
|
+
- left-to-right
|
683
|
+
Title:
|
684
|
+
description: The title of the object.
|
685
|
+
type: object
|
686
|
+
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
|
692
|
+
type: string
|
693
|
+
required:
|
694
|
+
- primary
|
695
|
+
- titleFull
|