cocina-models 0.15.0 → 0.16.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3ee3417af99eea03235071ba77599819e998ed2ac7195d852ff55cfa1fd98605
4
- data.tar.gz: 83381e6e15652ec933099ca02baaf394cd22d6ed55e72e7a68c62dc2d583f8e3
3
+ metadata.gz: 1be949cfe01f8591a3672f1aa22abd38d318334fd516d032eafc686ed59dec0a
4
+ data.tar.gz: de24e56fc74e0e1beb891d68020f12b75075015557310be867775b6727ee722b
5
5
  SHA512:
6
- metadata.gz: a8e8632bfe52e7c8c10fd3e26ae739066a4029081c97d5c9546be83df8960b41920be45ec2bd1d3218e33a923ba9f94d4ea382c4ce8714bed869df4583c10a72
7
- data.tar.gz: 7dd784ab41884b915103010c642cacf85c6db7ac58ebd27db9645fade4307d76e4b85b255a997f5618e977ec8732c632c914ab2789af4730dc324263faff5b5f
6
+ metadata.gz: 04edda64c833c0b8a3646c2d7b845a7741220809c7b3e6b6a6451a59c9dbc1b0df6370ab72d814c54b72b4e855d772152a0278dc1f99821bd20e7e00cb34ce97
7
+ data.tar.gz: e514ee482591acf73c3cb13ecc69cd20d368c720715f56086d0515d5925e7164d3200ec90b2310bc14a4d4b1822edff45a9f7df43875da13da612faf1ae45c63
@@ -4,7 +4,7 @@
4
4
  "title": "Digital Repository Collection",
5
5
  "description": "A group of Digital Repository Objects that indicate some type of conceptual grouping within the domain that is worth reusing across the system.",
6
6
  "type": "object",
7
- "required": ["@context", "@type", "externalIdentifier", "label", "internalIdentifier", "version", "administrative", "access", "identification", "structural"],
7
+ "required": ["@context", "@type", "externalIdentifier", "label", "internalIdentifier", "version", "administrative", "access", "description", "identification", "structural"],
8
8
  "properties": {
9
9
  "@context": {
10
10
  "description": "URI for the JSON-LD context definitions.",
@@ -33,6 +33,10 @@
33
33
  "description": "The Agent (User, Group, Application, Department, other) that deposited the Collection into SDR.",
34
34
  "$ref": "/Agent"
35
35
  },
36
+ "description": {
37
+ "description": "Descriptive metadata for the DRO.",
38
+ "$ref": "/Description"
39
+ },
36
40
  "externalIdentifier": {
37
41
  "description": "Identifier for the resource within the SDR architecture but outside of the repository. DRUID or UUID depending on resource type. Constant across resource versions. What clients will use calling the repository. Same as `identification.identifier`",
38
42
  "type": "string"
@@ -130,7 +134,7 @@
130
134
  "description": "Tags for release",
131
135
  "type": "array",
132
136
  "items": {
133
- "$ref": "ReleaseTag.json"
137
+ "$ref": "/ReleaseTag"
134
138
  }
135
139
  },
136
140
  "sdrPreserve": {
data/docs/maps/DRO.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "title": "Digital Repository Object",
5
5
  "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.",
6
6
  "type": "object",
7
- "required": ["@context", "@type", "externalIdentifier", "label", "internalIdentifier", "version", "administrative", "access", "identification", "structural"],
7
+ "required": ["@context", "@type", "externalIdentifier", "label", "internalIdentifier", "version", "administrative", "access", "description", "identification", "structural"],
8
8
  "properties": {
9
9
  "@context": {
10
10
  "description": "URI for the JSON-LD context definitions.",
@@ -144,7 +144,7 @@
144
144
  "description": "Tags for release",
145
145
  "type": "array",
146
146
  "items": {
147
- "$ref": "ReleaseTag.json"
147
+ "$ref": "/ReleaseTag"
148
148
  }
149
149
  },
150
150
  "sdrPreserve": {
@@ -160,6 +160,10 @@
160
160
  }
161
161
  }
162
162
  },
163
+ "description": {
164
+ "description": "Descriptive metadata for the DRO.",
165
+ "$ref": "/Description"
166
+ },
163
167
  "identification": {
164
168
  "description": "Identifying information for the DRO.",
165
169
  "type": "object",
@@ -0,0 +1,17 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-06/schema#",
3
+ "id": "http://cocina.sul.stanford.edu/schemas/Description",
4
+ "title": "Description",
5
+ "description": "The description of a work",
6
+ "type": "object",
7
+ "required": ["title"],
8
+ "properties": {
9
+ "title": {
10
+ "description": "The title of the item.",
11
+ "type": "array",
12
+ "items": {
13
+ "$ref": "/Title"
14
+ }
15
+ }
16
+ }
17
+ }
@@ -1,5 +1,6 @@
1
1
  {
2
2
  "$schema": "http://json-schema.org/draft-06/schema#",
3
+ "id": "http://cocina.sul.stanford.edu/schemas/ReleaseTag",
3
4
  "title": "Release Tag",
4
5
  "description": "A tag that indicates the item or collection should be released.",
5
6
  "type": "object",
@@ -28,11 +29,11 @@
28
29
  },
29
30
  "who": {
30
31
  "description": "Who did this release",
31
- "type": "string",
32
+ "type": "string"
32
33
  },
33
34
  "release": {
34
35
  "description": "Should it be released or withdrawn. Release is coded as true and withdraw as false",
35
36
  "type": "boolean"
36
- },
37
+ }
37
38
  }
38
39
  }
@@ -0,0 +1,18 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-06/schema#",
3
+ "id": "http://cocina.sul.stanford.edu/schemas/Title",
4
+ "title": "Title",
5
+ "description": "A title of a work",
6
+ "type": "object",
7
+ "required": ["titleFull", "primary"],
8
+ "properties": {
9
+ "primary": {
10
+ "description": "Is this the primary title for the object",
11
+ "type": "boolean"
12
+ },
13
+ "titleFull": {
14
+ "description": "The full title for the object",
15
+ "type": "string"
16
+ }
17
+ }
18
+ }
data/docs/schema.json CHANGED
@@ -45,6 +45,7 @@
45
45
  "version",
46
46
  "administrative",
47
47
  "access",
48
+ "description",
48
49
  "identification",
49
50
  "structural"
50
51
  ],
@@ -84,6 +85,10 @@
84
85
  "description": "The Agent (User, Group, Application, Department, other) that deposited the Collection into SDR.",
85
86
  "$ref": "#/definitions/Agent"
86
87
  },
88
+ "description": {
89
+ "description": "Descriptive metadata for the DRO.",
90
+ "$ref": "#/definitions/Description"
91
+ },
87
92
  "externalIdentifier": {
88
93
  "description": "Identifier for the resource within the SDR architecture but outside of the repository. DRUID or UUID depending on resource type. Constant across resource versions. What clients will use calling the repository. Same as `identification.identifier`",
89
94
  "type": [
@@ -238,6 +243,15 @@
238
243
  "string"
239
244
  ]
240
245
  },
246
+ "releaseTags": {
247
+ "description": "Tags for release",
248
+ "type": [
249
+ "array"
250
+ ],
251
+ "items": {
252
+ "$ref": "#/definitions/ReleaseTag"
253
+ }
254
+ },
241
255
  "sdrPreserve": {
242
256
  "description": "If this resource should be sent to Preservation.",
243
257
  "type": [
@@ -415,6 +429,7 @@
415
429
  "version",
416
430
  "administrative",
417
431
  "access",
432
+ "description",
418
433
  "identification",
419
434
  "structural"
420
435
  ],
@@ -624,6 +639,15 @@
624
639
  "string"
625
640
  ]
626
641
  },
642
+ "releaseTags": {
643
+ "description": "Tags for release",
644
+ "type": [
645
+ "array"
646
+ ],
647
+ "items": {
648
+ "$ref": "#/definitions/ReleaseTag"
649
+ }
650
+ },
627
651
  "sdrPreserve": {
628
652
  "description": "If this resource should be sent to Preservation.",
629
653
  "type": [
@@ -641,6 +665,10 @@
641
665
  }
642
666
  }
643
667
  },
668
+ "description": {
669
+ "description": "Descriptive metadata for the DRO.",
670
+ "$ref": "#/definitions/Description"
671
+ },
644
672
  "identification": {
645
673
  "description": "Identifying information for the DRO.",
646
674
  "type": [
@@ -798,6 +826,12 @@
798
826
  ]
799
827
  }
800
828
  },
829
+ "isMemberOf": {
830
+ "description": "Collection that this DRO is a member of",
831
+ "type": [
832
+ "string"
833
+ ]
834
+ },
801
835
  "isTargetOf": {
802
836
  "description": "An Annotation instance that applies to the DRO.",
803
837
  "type": [
@@ -817,6 +851,28 @@
817
851
  }
818
852
  }
819
853
  },
854
+ "Description": {
855
+ "$schema": "http://json-schema.org/draft-06/schema#",
856
+ "title": "Description",
857
+ "description": "The description of a work",
858
+ "type": [
859
+ "object"
860
+ ],
861
+ "required": [
862
+ "title"
863
+ ],
864
+ "properties": {
865
+ "title": {
866
+ "description": "The title of the item.",
867
+ "type": [
868
+ "array"
869
+ ],
870
+ "items": {
871
+ "$ref": "#/definitions/Title"
872
+ }
873
+ }
874
+ }
875
+ },
820
876
  "File": {
821
877
  "$schema": "http://json-schema.org/draft-06/schema#",
822
878
  "title": "File",
@@ -983,7 +1039,7 @@
983
1039
  ],
984
1040
  "properties": {
985
1041
  "access": {
986
- "description": "Access level for the File.",
1042
+ "description": "Access level for the File. If \"dark\" this won't go into public xml contentMetadata.",
987
1043
  "type": [
988
1044
  "string"
989
1045
  ],
@@ -1359,6 +1415,62 @@
1359
1415
  }
1360
1416
  }
1361
1417
  },
1418
+ "ReleaseTag": {
1419
+ "$schema": "http://json-schema.org/draft-06/schema#",
1420
+ "title": "Release Tag",
1421
+ "description": "A tag that indicates the item or collection should be released.",
1422
+ "type": [
1423
+ "object"
1424
+ ],
1425
+ "required": [
1426
+ "to",
1427
+ "what",
1428
+ "date",
1429
+ "who",
1430
+ "release"
1431
+ ],
1432
+ "properties": {
1433
+ "to": {
1434
+ "description": "What platform is it released to",
1435
+ "type": [
1436
+ "string"
1437
+ ],
1438
+ "enum": [
1439
+ "Searchworks",
1440
+ "Earthworks"
1441
+ ]
1442
+ },
1443
+ "what": {
1444
+ "description": "What is being released. This item or the whole collection.",
1445
+ "type": [
1446
+ "string"
1447
+ ],
1448
+ "enum": [
1449
+ "self",
1450
+ "collection"
1451
+ ]
1452
+ },
1453
+ "date": {
1454
+ "description": "When did this action happen",
1455
+ "type": [
1456
+ "string"
1457
+ ],
1458
+ "format": "date-time"
1459
+ },
1460
+ "who": {
1461
+ "description": "Who did this release",
1462
+ "type": [
1463
+ "string"
1464
+ ]
1465
+ },
1466
+ "release": {
1467
+ "description": "Should it be released or withdrawn. Release is coded as true and withdraw as false",
1468
+ "type": [
1469
+ "boolean"
1470
+ ]
1471
+ }
1472
+ }
1473
+ },
1362
1474
  "Sequence": {
1363
1475
  "$schema": "http://json-schema.org/draft-06/schema#",
1364
1476
  "title": "Resource Sequence",
@@ -1413,6 +1525,32 @@
1413
1525
  }
1414
1526
  }
1415
1527
  }
1528
+ },
1529
+ "Title": {
1530
+ "$schema": "http://json-schema.org/draft-06/schema#",
1531
+ "title": "Title",
1532
+ "description": "A title of a work",
1533
+ "type": [
1534
+ "object"
1535
+ ],
1536
+ "required": [
1537
+ "titleFull",
1538
+ "primary"
1539
+ ],
1540
+ "properties": {
1541
+ "primary": {
1542
+ "description": "Is this the primary title for the object",
1543
+ "type": [
1544
+ "boolean"
1545
+ ]
1546
+ },
1547
+ "titleFull": {
1548
+ "description": "The full title for the object",
1549
+ "type": [
1550
+ "string"
1551
+ ]
1552
+ }
1553
+ }
1416
1554
  }
1417
1555
  },
1418
1556
  "properties": {
@@ -1425,14 +1563,23 @@
1425
1563
  "DRO": {
1426
1564
  "$ref": "#/definitions/DRO"
1427
1565
  },
1566
+ "Description": {
1567
+ "$ref": "#/definitions/Description"
1568
+ },
1428
1569
  "File": {
1429
1570
  "$ref": "#/definitions/File"
1430
1571
  },
1431
1572
  "Fileset": {
1432
1573
  "$ref": "#/definitions/Fileset"
1433
1574
  },
1575
+ "ReleaseTag": {
1576
+ "$ref": "#/definitions/ReleaseTag"
1577
+ },
1434
1578
  "Sequence": {
1435
1579
  "$ref": "#/definitions/Sequence"
1580
+ },
1581
+ "Title": {
1582
+ "$ref": "#/definitions/Title"
1436
1583
  }
1437
1584
  },
1438
1585
  "description": "Hello world prmd API",
data/docs/schema.md CHANGED
@@ -36,12 +36,14 @@ A group of Digital Repository Objects that indicate some type of conceptual grou
36
36
  | **administrative:isDescribedBy** | *string* | PURL/XML file that is a traditional representation of the metadata for the Collection. | `"example"` |
37
37
  | **administrative:lastUpdated** | *date-time* | When the resource in SDR was last updated. | `"2015-01-01T12:00:00Z"` |
38
38
  | **administrative:partOfProject** | *string* | Administrative or Internal project this resource is a part of. | `"example"` |
39
+ | **administrative:releaseTags** | *array* | Tags for release | `[{"to":"Searchworks","what":"self","date":"2015-01-01T12:00:00Z","who":"example","release":true}]` |
39
40
  | **administrative:remediatedBy** | *array* | The Agent (User, Group, Application, Department, other) that remediated a Collection in SDR. | `[{"name":"example","sunetID":"example"}]` |
40
41
  | **administrative:sdrPreserve** | *boolean* | If this resource should be sent to Preservation. | `true` |
41
42
  | **citation** | *string* | Citation for the resource, including identifier, label, version, and a persistent URL to the object with SDR at the very least. | `"example"` |
42
43
  | **dedupeIdentifier** | *string* | Identifier retrieved from identification.sourceId that stands for analog or source identifier that this resource is a digital representation of. | `"example"` |
43
44
  | **depositor:name** | *string* | Primary label or name for an Agent. | `"example"` |
44
45
  | **depositor:sunetID** | *string* | Stanford University NetID for the Agent. | `"example"` |
46
+ | **description:title** | *array* | The title of the item. | `[{"primary":true,"titleFull":"example"}]` |
45
47
  | **externalIdentifier** | *string* | Identifier for the resource within the SDR architecture but outside of the repository. DRUID or UUID depending on resource type. Constant across resource versions. What clients will use calling the repository. Same as `identification.identifier` | `"example"` |
46
48
  | **followingVersion** | *string* | Following version for the Collection within SDR. | `"example"` |
47
49
  | **identification:DOI** | *string* | Digital Object Identifier (DOI) for the Collection within this repository. | `"example"` |
@@ -90,12 +92,14 @@ Domain-defined abstraction of a 'work'. Digital Repository Objects' abstraction
90
92
  | **administrative:isDescribedBy** | *string* | Pointer to the PURL/XML file that is a traditional representation of the metadata for the DRO. | `"example"` |
91
93
  | **administrative:lastUpdated** | *date-time* | When the resource in SDR was last updated. | `"2015-01-01T12:00:00Z"` |
92
94
  | **administrative:partOfProject** | *string* | Administrative or Internal project this resource is a part of. | `"example"` |
95
+ | **administrative:releaseTags** | *array* | Tags for release | `[{"to":"Searchworks","what":"self","date":"2015-01-01T12:00:00Z","who":"example","release":true}]` |
93
96
  | **administrative:remediatedBy** | *array* | The Agent (User, Group, Application, Department, other) that remediated a DRO in SDR. | `[{"name":"example","sunetID":"example"}]` |
94
97
  | **administrative:sdrPreserve** | *boolean* | If this resource should be sent to Preservation. | `true` |
95
98
  | **citation** | *string* | Citation for the resource, including identifier, label, version, and a persistent URL to the object with SDR at the very least. | `"example"` |
96
99
  | **dedupeIdentifier** | *string* | Identifier retrieved from identification.sourceId that stands for analog or source identifier that this resource is a digital representation of. | `"example"` |
97
100
  | **depositor:name** | *string* | Primary label or name for an Agent. | `"example"` |
98
101
  | **depositor:sunetID** | *string* | Stanford University NetID for the Agent. | `"example"` |
102
+ | **description:title** | *array* | The title of the item. | `[{"primary":true,"titleFull":"example"}]` |
99
103
  | **externalIdentifier** | *string* | Identifier for the resource within the SDR architecture but outside of the repository. DRUID or UUID depending on resource type. Constant across resource versions. What clients will use calling the repository. Same as `identification.identifier` | `"example"` |
100
104
  | **followingVersion** | *string* | Following version for the Object within SDR. | `"example"` |
101
105
  | **identification:catalogLinks/catalog** | *string* | Catalog that is the source of the linked record. | `"example"` |
@@ -118,10 +122,23 @@ Domain-defined abstraction of a 'work'. Digital Repository Objects' abstraction
118
122
  | **structural:hasAgreement** | *string* | Agreement that covers the deposit of the DRO into SDR. | `"example"` |
119
123
  | **structural:hasMember** | *array* | Component or 'children' digital repository objects that are a part or portion of this 'parent' or aggregate DRO. | `[null]` |
120
124
  | **structural:hasMemberOrders** | *array* | Provided sequences or orderings of members of the Object, including some metadata about each sequence (i.e. sequence label, sequence type, if the sequence is primary, etc.). | `[{"@context":"example","@type":"http://cocina.sul.stanford.edu/models/sequence.jsonld","label":"example","startMember":"example","members":[null]}]` |
125
+ | **structural:isMemberOf** | *string* | Collection that this DRO is a member of | `"example"` |
121
126
  | **structural:isTargetOf** | *string* | An Annotation instance that applies to the DRO. | `"example"` |
122
127
  | **version** | *integer* | Version for the DRO within SDR. | `42` |
123
128
 
124
129
 
130
+ ## <a name="resource-Description">Description</a>
131
+
132
+
133
+ The description of a work
134
+
135
+ ### Attributes
136
+
137
+ | Name | Type | Description | Example |
138
+ | ------- | ------- | ------- | ------- |
139
+ | **title** | *array* | The title of the item. | `[{"primary":true,"titleFull":"example"}]` |
140
+
141
+
125
142
  ## <a name="resource-File">File</a>
126
143
 
127
144
 
@@ -133,7 +150,7 @@ Binaries that are the basis of what our domain manages. Binaries here do not inc
133
150
  | ------- | ------- | ------- | ------- |
134
151
  | **@context** | *string* | URI for the JSON-LD context definitions. | `"example"` |
135
152
  | **@type** | *string* | The content type of the File.<br/> **one of:**`"http://cocina.sul.stanford.edu/models/file.jsonld"` | `"http://cocina.sul.stanford.edu/models/file.jsonld"` |
136
- | **access:access** | *string* | Access level for the File.<br/> **one of:**`"world"` or `"stanford"` or `"location-based"` or `"citation-only"` or `"dark"` | `"world"` |
153
+ | **access:access** | *string* | Access level for the File. If "dark" this won't go into public xml contentMetadata.<br/> **one of:**`"world"` or `"stanford"` or `"location-based"` or `"citation-only"` or `"dark"` | `"world"` |
137
154
  | **access:download** | *string* | Download level for the File binary.<br/> **one of:**`"world"` or `"stanford"` or `"location-based"` or `"citation-only"` or `"dark"` | `"world"` |
138
155
  | **administrative:created** | *date-time* | When the resource in SDR was created. | `"2015-01-01T12:00:00Z"` |
139
156
  | **administrative:deleted** | *boolean* | If the resource has been deleted (but not purged). | `true` |
@@ -202,6 +219,22 @@ Relevant groupings of Files. Also called a File Grouping.
202
219
  | **version** | *integer* | Version for the Fileset within SDR. | `42` |
203
220
 
204
221
 
222
+ ## <a name="resource-ReleaseTag">Release Tag</a>
223
+
224
+
225
+ A tag that indicates the item or collection should be released.
226
+
227
+ ### Attributes
228
+
229
+ | Name | Type | Description | Example |
230
+ | ------- | ------- | ------- | ------- |
231
+ | **date** | *date-time* | When did this action happen | `"2015-01-01T12:00:00Z"` |
232
+ | **release** | *boolean* | Should it be released or withdrawn. Release is coded as true and withdraw as false | `true` |
233
+ | **to** | *string* | What platform is it released to<br/> **one of:**`"Searchworks"` or `"Earthworks"` | `"Searchworks"` |
234
+ | **what** | *string* | What is being released. This item or the whole collection.<br/> **one of:**`"self"` or `"collection"` | `"self"` |
235
+ | **who** | *string* | Who did this release | `"example"` |
236
+
237
+
205
238
  ## <a name="resource-Sequence">Resource Sequence</a>
206
239
 
207
240
 
@@ -218,3 +251,16 @@ A sequence or ordering of resources within a Collection or Object.
218
251
  | **startMember** | *string* | Identifier for the first member of the sequence. | `"example"` |
219
252
 
220
253
 
254
+ ## <a name="resource-Title">Title</a>
255
+
256
+
257
+ A title of a work
258
+
259
+ ### Attributes
260
+
261
+ | Name | Type | Description | Example |
262
+ | ------- | ------- | ------- | ------- |
263
+ | **primary** | *boolean* | Is this the primary title for the object | `true` |
264
+ | **titleFull** | *string* | The full title for the object | `"example"` |
265
+
266
+
@@ -82,6 +82,9 @@ module Cocina
82
82
  attribute :version, Types::Coercible::Integer
83
83
  attribute(:access, Access.default { Access.new })
84
84
  attribute(:administrative, Administrative.default { Administrative.new })
85
+ # Allowing description to be omittable for now (until rolled out to consumers),
86
+ # but I think it's actually required for every DRO
87
+ attribute :description, Description.optional.default(nil)
85
88
  attribute(:identification, Identification.default { Identification.new })
86
89
  attribute(:structural, Structural.default { Structural.new })
87
90
 
@@ -95,6 +98,7 @@ module Cocina
95
98
 
96
99
  # params[:access] = Access.from_dynamic(dyn['access']) if dyn['access']
97
100
  params[:administrative] = Administrative.from_dynamic(dyn['administrative']) if dyn['administrative']
101
+ params[:description] = Description.from_dynamic(dyn.fetch('description'))
98
102
  AdminPolicy.new(params)
99
103
  end
100
104
 
@@ -51,6 +51,9 @@ module Cocina
51
51
  attribute :version, Types::Coercible::Integer
52
52
  attribute(:access, Access.default { Access.new })
53
53
  attribute(:administrative, Administrative.default { Administrative.new })
54
+ # Allowing description to be omittable for now (until rolled out to consumers),
55
+ # but I think it's actually required for every DRO
56
+ attribute :description, Description.optional.default(nil)
54
57
  attribute(:identification, Identification.default { Identification.new })
55
58
  attribute(:structural, Structural.default { Structural.new })
56
59
 
@@ -64,7 +67,7 @@ module Cocina
64
67
 
65
68
  # params[:access] = Access.from_dynamic(dyn['access']) if dyn['access']
66
69
  params[:administrative] = Administrative.from_dynamic(dyn['administrative']) if dyn['administrative']
67
-
70
+ params[:description] = Description.from_dynamic(dyn.fetch('description'))
68
71
  Collection.new(params)
69
72
  end
70
73
 
@@ -0,0 +1,30 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json'
4
+
5
+ module Cocina
6
+ module Models
7
+ # Descriptive metadata. See http://sul-dlss.github.io/cocina-models/maps/Description.json
8
+ class Description < Dry::Struct
9
+ # Title element. See http://sul-dlss.github.io/cocina-models/maps/Title.json
10
+ class Title < Dry::Struct
11
+ attribute :primary, Types::Strict::Bool
12
+ attribute :titleFull, Types::Strict::String
13
+
14
+ def self.from_dynamic(dyn)
15
+ Title.new(primary: dyn['primary'],
16
+ titleFull: dyn['titleFull'])
17
+ end
18
+ end
19
+
20
+ attribute :title, Types::Strict::Array.of(Title)
21
+
22
+ def self.from_dynamic(dyn)
23
+ params = {
24
+ title: dyn.fetch('title').map { |title| Title.from_dynamic(title) }
25
+ }
26
+ Description.new(params)
27
+ end
28
+ end
29
+ end
30
+ end
@@ -74,6 +74,9 @@ module Cocina
74
74
  attribute :version, Types::Coercible::Integer
75
75
  attribute(:access, Access.default { Access.new })
76
76
  attribute(:administrative, Administrative.default { Administrative.new })
77
+ # Allowing description to be omittable for now (until rolled out to consumers),
78
+ # but I think it's actually required for every DRO
79
+ attribute :description, Description.optional.default(nil)
77
80
  attribute(:identification, Identification.default { Identification.new })
78
81
  attribute(:structural, Structural.default { Structural.new })
79
82
 
@@ -88,7 +91,7 @@ module Cocina
88
91
  params[:access] = Access.from_dynamic(dyn['access']) if dyn['access']
89
92
  params[:administrative] = Administrative.from_dynamic(dyn['administrative']) if dyn['administrative']
90
93
  params[:structural] = Structural.from_dynamic(dyn['structural']) if dyn['structural']
91
-
94
+ params[:description] = Description.from_dynamic(dyn.fetch('description'))
92
95
  DRO.new(params)
93
96
  end
94
97
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.15.0'
5
+ VERSION = '0.16.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cocina-models
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.15.0
4
+ version: 0.16.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-02-05 00:00:00.000000000 Z
11
+ date: 2020-02-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: dry-struct
@@ -161,11 +161,13 @@ files:
161
161
  - docs/maps/Agent.json
162
162
  - docs/maps/Collection.json
163
163
  - docs/maps/DRO.json
164
+ - docs/maps/Description.json
164
165
  - docs/maps/File.json
165
166
  - docs/maps/Fileset.json
166
167
  - docs/maps/README.md
167
168
  - docs/maps/ReleaseTag.json
168
169
  - docs/maps/Sequence.json
170
+ - docs/maps/Title.json
169
171
  - docs/meta.json
170
172
  - docs/sampleETD/foxml-export.xml
171
173
  - docs/sampleETD/foxml.xml
@@ -177,6 +179,7 @@ files:
177
179
  - lib/cocina/models/admin_policy.rb
178
180
  - lib/cocina/models/checkable.rb
179
181
  - lib/cocina/models/collection.rb
182
+ - lib/cocina/models/description.rb
180
183
  - lib/cocina/models/dro.rb
181
184
  - lib/cocina/models/file.rb
182
185
  - lib/cocina/models/file_set.rb
@@ -202,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
202
205
  - !ruby/object:Gem::Version
203
206
  version: '0'
204
207
  requirements: []
205
- rubygems_version: 3.0.6
208
+ rubygems_version: 3.0.3
206
209
  signing_key:
207
210
  specification_version: 4
208
211
  summary: Data models for the SDR