cocina-models 0.73.0 → 0.73.3

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: b929b4e87bdb86010e2915c19628cb96dcafd101805e3c2dcee7ce56554d492f
4
- data.tar.gz: 7aa988aa05b14e1e0521369ae1124acb0e4433195d7cd0011b239d63fa01b97b
3
+ metadata.gz: 57046023e6e82e42ba14eeaf854834fb7c58f1393f44cd8a45aef3830e2725fa
4
+ data.tar.gz: 5f756bf134c45dc0dd3bc0d1f27b7cb8bb1d1c69cb614160d8ee766ee442044e
5
5
  SHA512:
6
- metadata.gz: a3ab493e7a4f41d48a1d583b695a6689bb5dac3117fd03d343c75ab7407a25df58755899b28a171fcdc3425a6a204582a4f112f31e51d70ef3ac766bd27d4107
7
- data.tar.gz: 45f9b2c0d9fd7b9e9d542f12d20e90ef0aacf536fa6477f691888e8a60dfcef96efce4a5c62793f8cd7eb7e27c30286360e036413bc975ff5bf316b271adf40f
6
+ metadata.gz: 5516df72a6cbfd795b460e19e8f3b54db34aadbf35a6b3c3da400da8751657782e37babadcf4c06f0ee02158ed0e4b82998f969a5a3b0d2b4b1f729683ee38fc
7
+ data.tar.gz: 50bf4417aaaa1e5190fe239c68f83b75666295d914ec6c829ef3f703586a47b22046da53effa40b44daeb03d123358d3ed6e7da4dbbcd68f74b4e7c22402c475
data/README.md CHANGED
@@ -31,6 +31,11 @@ exe/generator generate_schema DRO
31
31
  exe/generator generate_vocab
32
32
  ```
33
33
 
34
+ ### Descriptive documentation
35
+ ```
36
+ exe/generator generate_descriptive_docs
37
+ ```
38
+
34
39
  ## Testing
35
40
 
36
41
  The generator is tested via its output when run against `openapi.yml`, viz., the Cocina model classes. Thus, `generate` should be run after any changes to `openapi.yml`.
@@ -148,6 +148,7 @@ event.date:
148
148
  description: The addition of a resource to a set of other resources.
149
149
  - value: copyright
150
150
  description: The activity by which a resource may be considered subject to copyright law.
151
+ - value: coverage
151
152
  - value: creation
152
153
  description: The coming into being of a resource.
153
154
  - value: degree conferral
@@ -200,7 +201,7 @@ event.note:
200
201
  form:
201
202
  - value: carrier
202
203
  - value: data format
203
- - value: digital original
204
+ - value: digital origin
204
205
  - value: extent
205
206
  - value: form
206
207
  - value: genre
@@ -213,45 +214,6 @@ form:
213
214
  - value: resource type
214
215
  - value: technique
215
216
  - value: type
216
- form.note:
217
- - value: additions
218
- - value: arrangement
219
- - value: binding
220
- - value: codicology
221
- - value: collation
222
- - value: colophon
223
- - value: condition
224
- - value: decoNote
225
- status: deprecated
226
- use: decoration
227
- - value: decoration
228
- - value: dimensions
229
- - value: explicit
230
- - value: foliation
231
- - value: genre type
232
- - value: hand note
233
- - value: handNote
234
- status: deprecated
235
- use: hand note
236
- - value: incipit
237
- - value: instrumentation
238
- - value: layout
239
- - value: material
240
- - value: medium of performance
241
- - value: provenance
242
- - value: reassembly
243
- - value: reproduction
244
- - value: research
245
- - value: rubric
246
- - value: secfol
247
- status: deprecated
248
- use: second folio
249
- - value: second folio
250
- - value: secondFolio
251
- status: deprecated
252
- use: second folio
253
- - value: unit
254
- - value: writing
255
217
  form.structuredValue:
256
218
  - value: type
257
219
  - value: subtype
@@ -281,6 +243,8 @@ identifier:
281
243
  code: arxiv
282
244
  - value: case identifier
283
245
  - value: case number
246
+ - value: CSt
247
+ - value: CStRLIN
284
248
  - value: document number
285
249
  - value: DOI
286
250
  code: doi
@@ -314,6 +278,7 @@ identifier:
314
278
  - value: music publisher
315
279
  code: music-publisher
316
280
  - value: OCLC
281
+ - value: OCoLC
317
282
  - value: PMCID
318
283
  - value: PMID
319
284
  - value: record id
@@ -326,6 +291,7 @@ identifier:
326
291
  use: Source ID
327
292
  - value: stock number
328
293
  code: stock-number
294
+ - value: SUL catalog key
329
295
  - value: Swets (Netherlands) ID
330
296
  code: swets
331
297
  - value: UPC
@@ -351,8 +317,10 @@ note:
351
317
  - value: additions
352
318
  - value: admin
353
319
  - value: affiliation
320
+ - value: arrangement
354
321
  - value: bibliographic
355
322
  - value: bibliography
323
+ - value: binding
356
324
  - value: biographical/historical
357
325
  - value: biographical/historical note
358
326
  status: deprecated
@@ -360,6 +328,10 @@ note:
360
328
  - value: biography
361
329
  - value: boat note
362
330
  - value: citation/reference
331
+ - value: codicology
332
+ - value: collation
333
+ - value: colophon
334
+ - value: condition
363
335
  - value: contact
364
336
  - value: content
365
337
  - value: content note
@@ -373,19 +345,34 @@ note:
373
345
  - value: creation/production credits
374
346
  - value: date
375
347
  - value: date/sequential designation
348
+ - value: decoNote
349
+ status: deprecated
350
+ use: decoration
351
+ - value: decoration
376
352
  - value: description
377
353
  - value: digitization
354
+ - value: dimensions
378
355
  - value: duration
379
356
  - value: event
380
357
  - value: exhibitions
358
+ - value: explicit
359
+ - value: foliation
381
360
  - value: funding
382
361
  - value: general
383
362
  - value: genre type
384
363
  - value: geography
364
+ - value: hand note
365
+ - value: handNote
366
+ status: deprecated
367
+ use: hand note
385
368
  - value: host
369
+ - value: incipit
370
+ - value: instrumentation
386
371
  - value: language
372
+ - value: layout
387
373
  - value: local
388
374
  - value: location
375
+ - value: material
389
376
  - value: medium of performance
390
377
  - value: names
391
378
  - value: numbering
@@ -403,11 +390,20 @@ note:
403
390
  - value: reassembly
404
391
  - value: reference
405
392
  - value: references
393
+ - value: reformatting
406
394
  - value: related publication
407
395
  - value: reproduction
408
396
  - value: research
409
397
  - value: restriction
398
+ - value: rubric
410
399
  - value: scope and content
400
+ - value: secfol
401
+ status: deprecated
402
+ use: second folio
403
+ - value: second folio
404
+ - value: secondFolio
405
+ status: deprecated
406
+ use: second folio
411
407
  - value: source characteristics
412
408
  - value: source identifier
413
409
  - value: statement of responsibility
@@ -420,6 +416,7 @@ note:
420
416
  - value: thesis
421
417
  - value: transcript
422
418
  - value: translation
419
+ - value: unit
423
420
  - value: update
424
421
  - value: use and reproduction
425
422
  - value: venue
@@ -484,14 +481,22 @@ subject.note:
484
481
  - value: role
485
482
  subject.structuredValue:
486
483
  - value: activity dates
484
+ - value: area
487
485
  - value: city
486
+ - value: city section
487
+ - value: conference
488
488
  - value: continent
489
489
  - value: country
490
+ - value: county
490
491
  - value: end
491
492
  - value: east
493
+ - value: event
494
+ - value: extraterrestrial area
492
495
  - value: display
496
+ - value: family
493
497
  - value: forename
494
498
  - value: genre
499
+ - value: island
495
500
  - value: latitude
496
501
  - value: life dates
497
502
  - value: longitude
@@ -500,18 +505,24 @@ subject.structuredValue:
500
505
  - value: north
501
506
  - value: occupation
502
507
  - value: ordinal
508
+ - value: organization
503
509
  - value: part name
510
+ - value: part number
504
511
  - value: person
505
512
  - value: place
513
+ - value: region
506
514
  - value: south
507
515
  - value: start
516
+ - value: state
508
517
  - value: surname
509
518
  - value: term of address
519
+ - value: territory
510
520
  - value: time
511
521
  - value: title
512
522
  - value: topic
513
523
  - value: west
514
524
  subject.structuredValue.note:
525
+ - value: affiliation
515
526
  - value: role
516
527
  description: The relation of the subject entity to the resource.
517
528
  subject.groupedValue:
data/docs/_config.yml ADDED
@@ -0,0 +1 @@
1
+ theme: jekyll-theme-tactile
@@ -0,0 +1,461 @@
1
+ # Description types
2
+
3
+ ## Access accesscontact types
4
+ _Path: access.accessContact_
5
+ * email: Email address for a contact person or institution concerning the resource.
6
+ * repository: Institution providing access to the resource.
7
+
8
+ ## Access digitallocation types
9
+ _Path: access.digitalLocation_
10
+ * discovery: Online location for the purpose of discovering the resource.
11
+
12
+ ## Access note types
13
+ _Path: access.note_
14
+ * access restriction: Restrictions on or conditions for gaining access to the resource.
15
+ * display label: Display label for the purl.
16
+ * license: License describing allowed uses of the resource.
17
+ * use and reproduction: Information related to allowed uses of the resource in other contexts.
18
+
19
+ ## Access physicallocation types
20
+ _Path: access.physicalLocation_
21
+ * discovery: Location where a user may find the resource.
22
+ * location: Physical location of the resource, or path to the resource on a hard drive or disk.
23
+ * repository: The institution holding the resource.
24
+ * series: Archival series of the resource.
25
+ * shelf locator: Identifier or shelfmark indicating the location of the resource.
26
+
27
+ ## Adminmetadata note types
28
+ _Path: adminMetadata.note_
29
+ * record information: General information about the metadata record.
30
+ * record origin: The source of the record, such as another record transformed to generate the current record.
31
+
32
+ # Contributor types
33
+ _Path: contributor_
34
+ * conference: An event focusing on a particular topic or discipline.
35
+ * event: A time-bound occurrence.
36
+ * family: A group of individuals related by blood or personal alliance.
37
+ * organization: An institution or other corporate or collective body.
38
+ * person: An individual identity.
39
+ * unspecified others: Designator for one or more additional contributors not named individually.
40
+
41
+ ## Contributor identifier types
42
+ _Path: contributor.identifier_
43
+ * ORCID: Identifier from orcid.org.
44
+ * Wikidata: Identifier from wikidata.org.
45
+
46
+ ## Contributor name types
47
+ _Path: contributor.name_
48
+ * alternative: Additional nonpreferred form of name.
49
+ * display: Preferred form of the name for display.
50
+ * forename: First or given name or names.
51
+ * inverted full name: Name given in last name, first name order.
52
+ * pseudonym: Name used that differs from legal or primary form of name.
53
+ * surname: Last or family name.
54
+ * transliteration: Name originally in non-Latin script presented phonetically using Latin characters.
55
+
56
+ ### Contributor name part types for structured value
57
+ _Path: contributor.name.structuredValue_
58
+ * activity dates: The date or dates when someone was producing work.
59
+ * forename: First or given name or names.
60
+ * life dates: Birth and death dates, or dates when an entity was in existence.
61
+ * name: Name provided alongside additional information.
62
+ * ordinal: Indicator that the name is one in a series (e.g. Elizabeth I, Martin Luther King, Jr.).
63
+ * surname: Last or family name.
64
+ * term of address: Title or other signifier associated with name.
65
+
66
+ ### Contributor name types for grouped value (MODS legacy)
67
+ _Path: contributor.name.groupedValue_
68
+ * alternative: Additional nonpreferred form of name.
69
+ * name: Primary form of name within group of values.
70
+ * pseudonym: Name used that differs from legal or primary form of name.
71
+
72
+ ## Contributor note types
73
+ _Path: contributor.note_
74
+ * affiliation: Institution with which the contributor is associated.
75
+ * citation status: Indicator of whether the contributor should be included in the citation.
76
+ * description: Biographical information about the contributor.
77
+
78
+ # Event types
79
+ _Path: event_
80
+ * acquisition: The transferral of ownership of a resource to a repository.
81
+ * capture: A record of the resource in a fixed form at a specific time.
82
+ * collection: The addition of a resource to a set of other resources.
83
+ * copyright: The activity by which a resource may be considered subject to copyright law.
84
+ * copyright notice: An explicit statement that a resource is under copyright.
85
+ * creation: The coming into being of a resource.
86
+ * degree conferral: The institutional approval of a thesis or other resource leading to an academic degree.
87
+ * development: The creation of a print from a photographic negative or other source medium.
88
+ * distribution: The delivery of the resource to an external audience.
89
+ * generation: The creation of a resource by an automatic or natural process.
90
+ * manufacture: The physical assembly of a resource, often in multiple copies, for publication or other distribution.
91
+ * modification: A change to an existing resource.
92
+ * performance: The enactment of an artistic or cultural work for an audience, such as a play.
93
+ * presentation: The discussion of an academic or intellectual work for an audience, such as a seminar.
94
+ * production: The physical assembly of a resource not considered published, such as page proofs for a book.
95
+ * publication: The publishing or issuing of a resource.
96
+ * recording: The initial fixation to a medium of live audio and/or visual activity.
97
+ * release: Making a resource available to a broader audience.
98
+ * submission: The provision of a resource for review or evaluation.
99
+ * validity: When a resource takes effect, such as a revised train schedule.
100
+ * withdrawal: The removal of previous access to a resource, often due to its obsolescence.
101
+
102
+ ## Event date types
103
+ _Path: event.date_
104
+ * acquisition: The transferral of ownership of a resource to a repository.
105
+ * capture: A record of the resource in a fixed form at a specific time.
106
+ * collection: The addition of a resource to a set of other resources.
107
+ * copyright: The activity by which a resource may be considered subject to copyright law.
108
+ * coverage
109
+ * creation: The coming into being of a resource.
110
+ * degree conferral: The institutional approval of a thesis or other resource leading to an academic degree.
111
+ * developed: The creation of a print from a photographic negative or other source medium.
112
+ * development: The creation of a print from a photographic negative or other source medium.
113
+ * distribution: The delivery of the resource to an external audience.
114
+ * generation: The creation of a resource by an automatic or natural process.
115
+ * manufacture: The physical assembly of a resource, often in multiple copies, for publication or other distribution.
116
+ * modification: A change to an existing resource.
117
+ * performance: The enactment of an artistic or cultural work for an audience, such as a play.
118
+ * presentation: The discussion of an academic or intellectual work for an audience, such as a seminar.
119
+ * production: The physical assembly of a resource not considered published, such as page proofs for a book.
120
+ * publication: The publishing or issuing of a resource.
121
+ * recording: The initial fixation to a medium of live audio and/or visual activity.
122
+ * release: Making a resource available to a broader audience.
123
+ * submission: The provision of a resource for review or evaluation.
124
+ * validity: When a resource takes effect, such as a revised train schedule.
125
+ * withdrawal: The removal of previous access to a resource, often due to its obsolescence.
126
+
127
+ ### Event date part types for structured value
128
+ _Path: event.date.structuredValue_
129
+ * start: The start date in a range.
130
+ * end: The end date in a range.
131
+
132
+ ## Event note types
133
+ _Path: event.note_
134
+ * copyright statement: A formal declaration of copyright on a resource.
135
+ * edition
136
+ * frequency: How often a resource is issued, such as monthly.
137
+ * issuance: How the resource is issued, such as serially.
138
+
139
+ # Form types
140
+ _Path: form_
141
+ * carrier
142
+ * data format
143
+ * digital origin
144
+ * extent
145
+ * form
146
+ * genre
147
+ * map projection
148
+ * map scale
149
+ * material
150
+ * media
151
+ * media type
152
+ * reformatting quality
153
+ * resource type
154
+ * technique
155
+ * type
156
+
157
+ ## Form part types for structured value
158
+ _Path: form.structuredValue_
159
+ * type
160
+ * subtype
161
+
162
+ ## Geographic form types
163
+ _Path: geographic.form_
164
+ * data format
165
+ * media type
166
+ * type
167
+
168
+ ## Geographic subject types
169
+ _Path: geographic.subject_
170
+ * bounding box coordinates
171
+ * coverage
172
+ * point coordinates
173
+
174
+ ### Geographic subject part types for structured value
175
+ _Path: geographic.subject.structuredValue_
176
+ * east
177
+ * latitude
178
+ * longitude
179
+ * north
180
+ * south
181
+ * west
182
+
183
+ # Identifier types
184
+ _Path: identifier_
185
+ * accession number
186
+ * alternate case number
187
+ * Apis ID
188
+ * ARK
189
+ * arXiv
190
+ * case identifier
191
+ * case number
192
+ * CSt
193
+ * CStRLIN
194
+ * document number
195
+ * DOI
196
+ * druid
197
+ * GTIN-14 ID
198
+ * Handle
199
+ * inventory number
200
+ * ISBN
201
+ * ISMN
202
+ * ISRC
203
+ * ISSN
204
+ * ISSN-L
205
+ * issue number
206
+ * LCCN
207
+ * local
208
+ * Local ID
209
+ * matrix number
210
+ * music plate
211
+ * music publisher
212
+ * OCLC
213
+ * OCoLC
214
+ * PMCID
215
+ * PMID
216
+ * record id
217
+ * Senate Number
218
+ * Series
219
+ * SIRSI
220
+ * Source ID
221
+ * sourceID
222
+ * stock number
223
+ * SUL catalog key
224
+ * Swets (Netherlands) ID
225
+ * UPC
226
+ * URI
227
+ * URN
228
+ * videorecording identifier
229
+ * West Mat \#
230
+ * Wikidata
231
+
232
+ # Note types
233
+ _Path: note_
234
+ * abstract
235
+ * access
236
+ * access note
237
+ * acquisition
238
+ * action
239
+ * additional physical form
240
+ * additions
241
+ * admin
242
+ * affiliation
243
+ * arrangement
244
+ * bibliographic
245
+ * bibliography
246
+ * binding
247
+ * biographical/historical
248
+ * biographical/historical note
249
+ * biography
250
+ * boat note
251
+ * citation/reference
252
+ * codicology
253
+ * collation
254
+ * colophon
255
+ * condition
256
+ * contact
257
+ * content
258
+ * content note
259
+ * content warning
260
+ * contents
261
+ * copyright
262
+ * creation/production credits
263
+ * date
264
+ * date/sequential designation
265
+ * decoNote
266
+ * decoration
267
+ * description
268
+ * digitization
269
+ * dimensions
270
+ * duration
271
+ * event
272
+ * exhibitions
273
+ * explicit
274
+ * foliation
275
+ * funding
276
+ * general
277
+ * genre type
278
+ * geography
279
+ * hand note
280
+ * handNote
281
+ * host
282
+ * incipit
283
+ * instrumentation
284
+ * language
285
+ * layout
286
+ * local
287
+ * location
288
+ * material
289
+ * medium of performance
290
+ * names
291
+ * numbering
292
+ * original location
293
+ * other relation type
294
+ * ownership
295
+ * part
296
+ * performer
297
+ * performers
298
+ * preferred citation
299
+ * provenance
300
+ * publications
301
+ * qualifications
302
+ * quote
303
+ * reassembly
304
+ * reference
305
+ * references
306
+ * reformatting
307
+ * related publication
308
+ * reproduction
309
+ * research
310
+ * restriction
311
+ * rubric
312
+ * scope and content
313
+ * secfol
314
+ * second folio
315
+ * secondFolio
316
+ * source characteristics
317
+ * source identifier
318
+ * statement of responsibility
319
+ * summary
320
+ * system details
321
+ * system requirements
322
+ * table of contents
323
+ * target audience
324
+ * technical note
325
+ * thesis
326
+ * transcript
327
+ * translation
328
+ * unit
329
+ * update
330
+ * use and reproduction
331
+ * venue
332
+ * version
333
+ * version identification
334
+ * writing
335
+
336
+ ## Note types for grouped value (MODS legacy)
337
+ _Path: note.groupedValue_
338
+ * caption
339
+ * date
340
+ * detail type
341
+ * extent unit
342
+ * list
343
+ * marker
344
+ * number
345
+ * title
346
+ * text
347
+
348
+ # Relatedresource types
349
+ _Path: relatedResource_
350
+ * has original version: An initial form of the resource.
351
+ * has other format: A version of the resource in a different physical or digital format.
352
+ * has part: A constituent unit of the resource.
353
+ * has version: A version of the resource with different intellectual content.
354
+ * in series: The name of a series of publications to which the resource belongs.
355
+ * other relation type: Resource type not otherwise described.
356
+ * part of: A larger resource to which the resource belongs, such as a collection.
357
+ * preceded by: A predecessor to the resource, such as a preceding journal title.
358
+ * referenced by: Other resources that cite the resource, such as a catalog.
359
+ * references: A resource which the resource references or cites.
360
+ * related to: A generically related resource.
361
+ * reviewed by: A review of the resource.
362
+ * succeeded by: A successor to the resource, such as a subsequent journal title.
363
+
364
+ # Subject types
365
+ _Path: subject_
366
+ * classification
367
+ * conference
368
+ * display
369
+ * event
370
+ * family
371
+ * genre
372
+ * map coordinates
373
+ * name
374
+ * occupation
375
+ * organization
376
+ * person
377
+ * place
378
+ * point coordinates
379
+ * time
380
+ * title
381
+ * topic
382
+
383
+ ## Subject note types
384
+ _Path: subject.note_
385
+ * role
386
+
387
+ ## Subject part types for structured value
388
+ _Path: subject.structuredValue_
389
+ * activity dates
390
+ * area
391
+ * city
392
+ * city section
393
+ * conference
394
+ * continent
395
+ * country
396
+ * county
397
+ * end
398
+ * east
399
+ * event
400
+ * extraterrestrial area
401
+ * display
402
+ * family
403
+ * forename
404
+ * genre
405
+ * island
406
+ * latitude
407
+ * life dates
408
+ * longitude
409
+ * main title
410
+ * name
411
+ * north
412
+ * occupation
413
+ * ordinal
414
+ * organization
415
+ * part name
416
+ * part number
417
+ * person
418
+ * place
419
+ * region
420
+ * south
421
+ * start
422
+ * state
423
+ * surname
424
+ * term of address
425
+ * territory
426
+ * time
427
+ * title
428
+ * topic
429
+ * west
430
+
431
+ ### Subject note types
432
+ _Path: subject.structuredValue.note_
433
+ * affiliation
434
+ * role: The relation of the subject entity to the resource.
435
+
436
+ ## Subject types for grouped value (MODS legacy)
437
+ _Path: subject.groupedValue_
438
+ * uniform: Form of title in Library of Congress title authority.
439
+
440
+ # Title types
441
+ _Path: title_
442
+ * abbreviated: Abbreviated form of title for indexing or identification.
443
+ * alternative: Variant title.
444
+ * parallel: Title transcribed from the resource in multiple languages or scripts.
445
+ * supplied: Title provided by metadata creator rather than transcribed from the resource.
446
+ * translated: Title translated into another language.
447
+ * transliterated: Title transliterated from non-Latin script to Latin script.
448
+ * uniform: Form of title in Library of Congress title authority.
449
+
450
+ ## Title note types
451
+ _Path: title.note_
452
+ * associated name: A name linked to the title, such as for a name-title heading.
453
+ * nonsorting character count: The number of characters at the beginning of the string to be disregarded when sorting.
454
+
455
+ ## Title part types for structured value
456
+ _Path: title.structuredValue_
457
+ * main title: The primary part of a multipart title.
458
+ * nonsorting characters: A string at the beginning of the title to be disregarded when sorting.
459
+ * part name: The distinct name of a resource as part of a series or multivolume set.
460
+ * part number: The distinct number of a resource as part of a series or multivolume set.
461
+ * subtitle: The secondary part of a title.
@@ -28,6 +28,7 @@ module Cocina
28
28
  # rubocop:enable Style/HashEachMethods
29
29
 
30
30
  generate_vocab
31
+ generate_descriptive_docs
31
32
  end
32
33
 
33
34
  desc 'generate_schema SCHEMA_NAME', 'generate for SCHEMA_NAME'
@@ -45,8 +46,56 @@ module Cocina
45
46
  Vocab.generate(schemas, output_dir: options[:output])
46
47
  end
47
48
 
49
+ desc 'generate_descriptive_docs', 'generate descriptive documentation'
50
+ def generate_descriptive_docs
51
+ markdown = YAML.load_file('description_types.yml').map do |field, types|
52
+ header_markdown = field_markdown_from(field)
53
+ types_markdown = types_markdown_from(types)
54
+
55
+ <<~MARKDOWN
56
+ #{'#' * (field.count('.') + 1)} #{header_markdown}
57
+ _Path: #{field}_
58
+ #{types_markdown}
59
+ MARKDOWN
60
+ end.join("\n")
61
+
62
+ remove_file 'docs/description_types.md'
63
+ create_file 'docs/description_types.md', h1_markdown + markdown
64
+ end
65
+
48
66
  private
49
67
 
68
+ def h1_markdown
69
+ <<~MARKDOWN
70
+ # Description types
71
+
72
+ MARKDOWN
73
+ end
74
+
75
+ def field_markdown_from(field)
76
+ header = field.split('.')
77
+ .grep_v(/groupedValue|structuredValue/)
78
+ .join(' ')
79
+ .capitalize
80
+
81
+ header_suffix = if field.ends_with?('structuredValue')
82
+ 'part types for structured value'
83
+ elsif field.ends_with?('groupedValue')
84
+ 'types for grouped value (MODS legacy)'
85
+ else
86
+ 'types'
87
+ end
88
+ "#{header} #{header_suffix}"
89
+ end
90
+
91
+ def types_markdown_from(types)
92
+ types.map do |type|
93
+ " * #{type['value']}".tap do |type_value|
94
+ type_value << ": #{type['description']}" if type['description']
95
+ end
96
+ end.join("\n")
97
+ end
98
+
50
99
  def schemas
51
100
  @schemas ||= Openapi3Parser.load_file(options[:openapi]).components.schemas
52
101
  end
@@ -11,7 +11,7 @@ module Cocina
11
11
 
12
12
  def initialize(clazz, attributes)
13
13
  @clazz = clazz
14
- @attributes = attributes
14
+ @attributes = attributes.deep_symbolize_keys
15
15
  @error_paths = []
16
16
  end
17
17
 
@@ -60,7 +60,7 @@ module Cocina
60
60
  next unless match?(path, type_signature)
61
61
  break if types.include?(type.downcase)
62
62
 
63
- error_paths << path_to_s(path)
63
+ error_paths << "#{path_to_s(path)} (#{type})"
64
64
  break
65
65
  end
66
66
  end
@@ -72,7 +72,7 @@ module Cocina
72
72
  # Some part of the path are ignored for the purpose of matching.
73
73
  def clean_path(path)
74
74
  new_path = path.reject do |part|
75
- part.is_a?(Integer) || part == :parallelValue
75
+ part.is_a?(Integer) || %i[parallelValue parallelContributor parallelEvent].include?(part)
76
76
  end
77
77
  # This needs to happen after parallelValue is removed
78
78
  # to handle structuredValue > parallelValue > structuredValue
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Cocina
4
4
  module Models
5
- VERSION = '0.73.0'
5
+ VERSION = '0.73.3'
6
6
  end
7
7
  end
data/openapi.yml CHANGED
@@ -523,7 +523,7 @@ components:
523
523
  items:
524
524
  $ref: "#/components/schemas/DescriptiveValue"
525
525
  type:
526
- description: Entity type of the contributor (person, organization, etc.).
526
+ description: Entity type of the contributor (person, organization, etc.). See https://sul-dlss.github.io/cocina-models/description_types.html for valid types.
527
527
  type: string
528
528
  status:
529
529
  description: Status of the contributor relative to other parallel contributors
@@ -712,7 +712,7 @@ components:
712
712
  # https://github.com/interagent/committee/issues/286
713
713
  # - type: integer
714
714
  type:
715
- description: Type of value provided by the descriptive element.
715
+ description: Type of value provided by the descriptive element. See https://sul-dlss.github.io/cocina-models/description_types.html for valid types.
716
716
  type: string
717
717
  status:
718
718
  description: Status of the descriptive element value relative to other instances
@@ -788,7 +788,7 @@ components:
788
788
  items:
789
789
  $ref: "#/components/schemas/DescriptiveValue"
790
790
  type:
791
- description: Entity type of the contributor (person, organization, etc.).
791
+ description: Entity type of the contributor (person, organization, etc.). See https://sul-dlss.github.io/cocina-models/description_types.html for valid types.
792
792
  type: string
793
793
  status:
794
794
  description: Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
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.73.0
4
+ version: 0.73.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Justin Coyne
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-04-12 00:00:00.000000000 Z
11
+ date: 2022-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -275,7 +275,9 @@ files:
275
275
  - bin/setup
276
276
  - cocina-models.gemspec
277
277
  - description_types.yml
278
+ - docs/_config.yml
278
279
  - docs/cocina-base.jsonld
280
+ - docs/description_types.md
279
281
  - docs/index.html
280
282
  - docs/maps/Agent.json
281
283
  - docs/maps/Collection.json