cocina-models 0.31.1 → 0.35.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (43) hide show
  1. checksums.yaml +4 -4
  2. data/.github/pull_request_template.md +8 -1
  3. data/.rubocop.yml +53 -2
  4. data/README.md +7 -13
  5. data/cocina-models.gemspec +2 -2
  6. data/docs/index.html +20 -0
  7. data/docs/maps/DRO.json +1 -1
  8. data/lib/cocina/generator/generator.rb +3 -0
  9. data/lib/cocina/generator/schema_value.rb +2 -2
  10. data/lib/cocina/models.rb +1 -2
  11. data/lib/cocina/models/access.rb +4 -0
  12. data/lib/cocina/models/admin_policy_administrative.rb +1 -1
  13. data/lib/cocina/models/administrative.rb +1 -1
  14. data/lib/cocina/models/contributor.rb +3 -1
  15. data/lib/cocina/models/description.rb +4 -2
  16. data/lib/cocina/models/descriptive_access_metadata.rb +13 -0
  17. data/lib/cocina/models/descriptive_admin_metadata.rb +3 -1
  18. data/lib/cocina/models/descriptive_basic_value.rb +10 -3
  19. data/lib/cocina/models/descriptive_parallel_value.rb +9 -0
  20. data/lib/cocina/models/descriptive_structured_value.rb +1 -1
  21. data/lib/cocina/models/descriptive_value.rb +10 -4
  22. data/lib/cocina/models/descriptive_value_required.rb +10 -4
  23. data/lib/cocina/models/dro.rb +1 -1
  24. data/lib/cocina/models/dro_access.rb +7 -1
  25. data/lib/cocina/models/event.rb +1 -1
  26. data/lib/cocina/models/file.rb +1 -1
  27. data/lib/cocina/models/identification.rb +2 -0
  28. data/lib/cocina/models/language.rb +30 -0
  29. data/lib/cocina/models/related_resource.rb +21 -0
  30. data/lib/cocina/models/request_collection.rb +1 -1
  31. data/lib/cocina/models/request_dro.rb +2 -2
  32. data/lib/cocina/models/request_identification.rb +13 -0
  33. data/lib/cocina/models/sequence.rb +1 -0
  34. data/lib/cocina/models/source.rb +1 -0
  35. data/lib/cocina/models/standard.rb +16 -0
  36. data/lib/cocina/models/version.rb +1 -1
  37. data/openapi.yml +425 -113
  38. metadata +14 -12
  39. data/docs/README.md +0 -9
  40. data/docs/_config.yml +0 -1
  41. data/docs/meta.json +0 -9
  42. data/docs/schema.json +0 -1654
  43. data/docs/schema.md +0 -268
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56996d980d118dcf4b8d40ceff5ec6fbff8b24abb997c4b9e0197bb528b8d079
4
- data.tar.gz: fbd4dc60749aa56fb60334efb0841a707e676a86117129c0f792bbe7cb8e6efe
3
+ metadata.gz: 9ea38c51d33daf4bd30982c2a326f4f8df2b02885f531d48f93f5cd95836eb4e
4
+ data.tar.gz: 8964732d746a81b264bc159db52b1a9ea91f5c6455cb12634e1d937d74ba13db
5
5
  SHA512:
6
- metadata.gz: 2d329215bcbe26594b87741cd14eeb17d6d3059812ac9049782c8f5c571cb1243abdb46ce16f0c664704b834fbdf3984f37813aa0fc339b98fa58bf79ff35e96
7
- data.tar.gz: 16a11f6ee008decd17ffee1bd3329e3c8b9d67ed6350d536a9f1526ecce6d28ccddba4ceff688b2e24163b93c8859e4798e050106a747b8fef2574c9f62df140
6
+ metadata.gz: 4e9842002155019798495d31b30a1476b4b34d3984a9c66a1105729fb535d566a0c833ad670b01e649de21d2bc05d2831e82feabd59a87c10fabbaffec29e9bd
7
+ data.tar.gz: 1e80bffa4f64a9641840b3dfb92d3deb4441b7a0a8cdd9fa78666893d6d12f144884146bec39d153d55672c5747d699179adeaa2d7411a6d9549396eb8a0f22c
@@ -2,4 +2,11 @@
2
2
 
3
3
 
4
4
 
5
- ## Was the documentation (README, wiki) updated?
5
+ ## How was this change tested?
6
+
7
+
8
+
9
+ ## Which documentation and/or configurations were updated?
10
+
11
+
12
+
@@ -4,7 +4,7 @@ inherit_from: .rubocop_todo.yml
4
4
  require:
5
5
  - rubocop-rspec
6
6
 
7
- Metrics/LineLength:
7
+ Layout/LineLength:
8
8
  Max: 114
9
9
  Exclude:
10
10
  - lib/cocina/models/*
@@ -26,7 +26,58 @@ RSpec/ExampleLength:
26
26
  - spec/cocina/models/description_spec.rb
27
27
  - spec/cocina/models/dro_shared_examples.rb
28
28
 
29
-
30
29
  Style/Documentation:
31
30
  Exclude:
32
31
  - lib/cocina/models/*
32
+
33
+ Layout/EmptyLinesAroundAttributeAccessor:
34
+ Enabled: true
35
+
36
+ Layout/SpaceAroundMethodCallOperator:
37
+ Enabled: true
38
+
39
+ Lint/DeprecatedOpenSSLConstant:
40
+ Enabled: true
41
+
42
+ Lint/MixedRegexpCaptureTypes:
43
+ Enabled: true
44
+
45
+ Lint/RaiseException:
46
+ Enabled: true
47
+
48
+ Lint/StructNewOverride:
49
+ Enabled: true
50
+
51
+ Style/AccessorGrouping:
52
+ Enabled: true
53
+
54
+ Style/BisectedAttrAccessor:
55
+ Enabled: true
56
+
57
+ Style/ExponentialNotation:
58
+ Enabled: true
59
+
60
+ Style/HashEachMethods:
61
+ Enabled: true
62
+
63
+ Style/HashTransformKeys:
64
+ Enabled: true
65
+
66
+ Style/HashTransformValues:
67
+ Enabled: true
68
+
69
+ Style/RedundantAssignment:
70
+ Enabled: true
71
+
72
+ Style/RedundantFetchBlock:
73
+ Enabled: true
74
+
75
+ Style/RedundantRegexpCharacterClass:
76
+ Enabled: true
77
+
78
+ Style/RedundantRegexpEscape:
79
+ Enabled: true
80
+
81
+ Style/SlicingWithRange:
82
+ Enabled: true
83
+
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.com/sul-dlss/cocina-models.svg?branch=master)](https://travis-ci.com/sul-dlss/cocina-models)
1
+ [![CircleCI](https://circleci.com/gh/sul-dlss/cocina-models.svg?style=svg)](https://circleci.com/gh/sul-dlss/cocina-models)
2
2
  [![Test Coverage](https://api.codeclimate.com/v1/badges/472273351516ac01dce1/test_coverage)](https://codeclimate.com/github/sul-dlss/cocina-models/test_coverage)
3
3
  [![Maintainability](https://api.codeclimate.com/v1/badges/472273351516ac01dce1/maintainability)](https://codeclimate.com/github/sul-dlss/cocina-models/maintainability)
4
4
  [![Gem Version](https://badge.fury.io/rb/cocina-models.svg)](https://badge.fury.io/rb/cocina-models)
@@ -26,20 +26,14 @@ exe/generator generate
26
26
  exe/generator generate_schema DRO
27
27
  ```
28
28
 
29
- ## Generate Documentation
29
+ ## Testing
30
30
 
31
- ```
32
- gem install prmd
33
- cd docs
31
+ 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`.
34
32
 
35
- # Combine into a single schema
36
- prmd combine --meta meta.json maps/ > schema.json
33
+ Beyond what is necessary to test the generator, the Cocina model classes are not tested, i.e., they are assumed to be as specified in `openapi.yml`.
37
34
 
38
- # Check it’s all good
39
- prmd verify schema.json
35
+ ## Using this gem
40
36
 
41
- # Build docs
42
- prmd doc schema.json > schema.md
43
- ```
37
+ If you are using this gem in an application that has an API that accepts Cocina models (e.g., SDR API, Dor-Services-App), make sure that the `openapi.yml` for the application includes the schemas that match the schemas in this `openapi.yml`.
44
38
 
45
- Then check in the resulting changes to `docs/schema.json` and `docs/schema.md`
39
+ This can be accomplished by cutting and pasting these schemas. By convention, these schemas are listed first in the `openapi.yml` of the associated projects, followed by the application-specific schemas.
@@ -33,9 +33,9 @@ Gem::Specification.new do |spec|
33
33
 
34
34
  spec.add_development_dependency 'bundler', '~> 2.0'
35
35
  spec.add_development_dependency 'committee'
36
- spec.add_development_dependency 'rake', '~> 12.0'
36
+ spec.add_development_dependency 'rake', '~> 13.0'
37
37
  spec.add_development_dependency 'rspec', '~> 3.0'
38
- spec.add_development_dependency 'rubocop', '~> 0.74.0'
38
+ spec.add_development_dependency 'rubocop', '~> 0.87'
39
39
  spec.add_development_dependency 'rubocop-rspec'
40
40
  spec.add_development_dependency 'simplecov', '~> 0.17.0'
41
41
  end
@@ -0,0 +1,20 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>API documentation</title>
5
+
6
+ <meta name="viewport" content="width=device-width, initial-scale=1">
7
+
8
+
9
+ <style>
10
+ body {
11
+ margin: 0;
12
+ padding: 0;
13
+ }
14
+ </style>
15
+ </head>
16
+ <body>
17
+ <redoc spec-url='https://raw.githubusercontent.com/sul-dlss/cocina-models/master/openapi.yml'></redoc>
18
+ <script src="https://cdn.jsdelivr.net/npm/redoc@next/bundles/redoc.standalone.js"> </script>
19
+ </body>
20
+ </html>
@@ -84,7 +84,7 @@
84
84
  "download": {
85
85
  "description": "Download level for the DRO metadata.",
86
86
  "type": "string",
87
- "enum": ["world", "stanford", "location-based", "citation-only", "dark"]
87
+ "enum": ["world", "stanford", "location-based", "none"]
88
88
  },
89
89
  "embargo": {
90
90
  "description": "Embargo metadata",
@@ -17,10 +17,13 @@ module Cocina
17
17
  def generate
18
18
  clean_output
19
19
 
20
+ # rubocop:disable Style/HashEachMethods
21
+ # This is not a Hash
20
22
  schemas.keys.each do |schema_name|
21
23
  schema = schema_for(schema_name)
22
24
  generate_for(schema) if schema
23
25
  end
26
+ # rubocop:enable Style/HashEachMethods
24
27
 
25
28
  generate_vocab
26
29
  end
@@ -4,11 +4,11 @@ module Cocina
4
4
  module Generator
5
5
  # Class for generating from an openapi value
6
6
  class SchemaValue < SchemaBase
7
- # rubocop:disable Metrics/LineLength
7
+ # rubocop:disable Layout/LineLength
8
8
  def generate
9
9
  "#{description}#{example}attribute :#{name.camelize(:lower)}, Types::#{dry_datatype(schema_doc)}#{default}#{enum}#{omittable}"
10
10
  end
11
- # rubocop:enable Metrics/LineLength
11
+ # rubocop:enable Layout/LineLength
12
12
 
13
13
  private
14
14
 
@@ -14,7 +14,6 @@ require 'thor'
14
14
 
15
15
  # Help Zeitwerk find some of our classes
16
16
  class CocinaModelsInflector < Zeitwerk::Inflector
17
- # rubocop:disable Metrics/CyclomaticComplexity
18
17
  # rubocop:disable Metrics/MethodLength
19
18
  def camelize(basename, _abspath)
20
19
  case basename
@@ -34,7 +33,7 @@ class CocinaModelsInflector < Zeitwerk::Inflector
34
33
  super
35
34
  end
36
35
  end
37
- # rubocop:enable Metrics/CyclomaticComplexity
36
+
38
37
  # rubocop:enable Metrics/MethodLength
39
38
  end
40
39
 
@@ -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
@@ -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
@@ -6,9 +6,11 @@ module Cocina
6
6
  attribute :name, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
7
  # Entity type of the contributor (person, organization, etc.).
8
8
  attribute :type, Types::Strict::String.meta(omittable: true)
9
- # Status of the contributor relative to other parallel contributors.
9
+ # Status of the contributor relative to other parallel contributors (e.g. the primary author among a group of contributors).
10
10
  attribute :status, Types::Strict::String.meta(omittable: true)
11
11
  attribute :role, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
12
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
12
14
  end
13
15
  end
14
16
  end
@@ -7,12 +7,14 @@ module Cocina
7
7
  attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
8
8
  attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
9
9
  attribute :form, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
10
- attribute :language, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
10
+ attribute :language, Types::Strict::Array.of(Language).meta(omittable: true)
11
11
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
12
12
  attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
+ attribute :subject, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
13
14
  # Stanford persistent URL associated with the resource.
14
15
  attribute :purl, Types::Strict::String.meta(omittable: true)
15
- attribute :url, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
16
+ attribute :access, DescriptiveAccessMetadata.optional.meta(omittable: true)
17
+ attribute :relatedResource, Types::Strict::Array.of(RelatedResource).meta(omittable: true)
16
18
  attribute :marcEncodedData, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
17
19
  attribute :adminMetadata, DescriptiveAdminMetadata.optional.meta(omittable: true)
18
20
 
@@ -0,0 +1,13 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class DescriptiveAccessMetadata < Struct
6
+ attribute :url, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
+ attribute :physicalLocation, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
8
+ attribute :accessContact, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
9
+ attribute :digitalRepository, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
10
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
11
+ end
12
+ end
13
+ end
@@ -5,8 +5,10 @@ module Cocina
5
5
  class DescriptiveAdminMetadata < Struct
6
6
  attribute :contributor, Types::Strict::Array.of(Contributor).meta(omittable: true)
7
7
  attribute :event, Types::Strict::Array.of(Event).meta(omittable: true)
8
- attribute :language, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
8
+ attribute :language, Types::Strict::Array.of(Language).meta(omittable: true)
9
9
  attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
10
+ attribute :standard, Standard.optional.meta(omittable: true)
11
+ attribute :identifier, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
10
12
  end
11
13
  end
12
14
  end
@@ -3,19 +3,26 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveBasicValue < Struct
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
+ attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
6
8
  # String value of the descriptive element.
7
9
  attribute :value, Types::Strict::String.meta(omittable: true)
8
10
  # Type of value provided by the descriptive element.
9
11
  attribute :type, Types::Strict::String.meta(omittable: true)
10
- # Status of the descriptive element relative to other instances of the element.
12
+ # Status of the descriptive element value relative to other instances of the element.
11
13
  attribute :status, Types::Strict::String.meta(omittable: true)
12
14
  # Code value of the descriptive element.
13
15
  attribute :code, Types::Strict::String.meta(omittable: true)
14
16
  # URI value of the descriptive element.
15
17
  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 :standard, Standard.optional.meta(omittable: true)
19
+ attribute :encoding, Standard.optional.meta(omittable: true)
18
20
  attribute :source, Source.optional.meta(omittable: true)
21
+ # The preferred display label to use for the descriptive element in access systems.
22
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
23
+ # A term providing information about the circumstances of the statement (e.g., approximate dates).
24
+ attribute :qualifier, Types::Strict::String.meta(omittable: true)
25
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
19
26
  end
20
27
  end
21
28
  end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Cocina
4
+ module Models
5
+ class DescriptiveParallelValue < Struct
6
+ attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
+ end
8
+ end
9
+ end
@@ -3,7 +3,7 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveStructuredValue < Struct
6
- attribute :structuredValue, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
7
  end
8
8
  end
9
9
  end
@@ -3,20 +3,26 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveValue < Struct
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
+ attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
6
8
  # String value of the descriptive element.
7
9
  attribute :value, Types::Strict::String.meta(omittable: true)
8
10
  # Type of value provided by the descriptive element.
9
11
  attribute :type, Types::Strict::String.meta(omittable: true)
10
- # Status of the descriptive element relative to other instances of the element.
12
+ # Status of the descriptive element value relative to other instances of the element.
11
13
  attribute :status, Types::Strict::String.meta(omittable: true)
12
14
  # Code value of the descriptive element.
13
15
  attribute :code, Types::Strict::String.meta(omittable: true)
14
16
  # URI value of the descriptive element.
15
17
  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 :standard, Standard.optional.meta(omittable: true)
19
+ attribute :encoding, Standard.optional.meta(omittable: true)
18
20
  attribute :source, Source.optional.meta(omittable: true)
19
- attribute :structuredValue, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
21
+ # The preferred display label to use for the descriptive element in access systems.
22
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
23
+ # A term providing information about the circumstances of the statement (e.g., approximate dates).
24
+ attribute :qualifier, Types::Strict::String.meta(omittable: true)
25
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
20
26
  attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
21
27
  end
22
28
  end
@@ -3,20 +3,26 @@
3
3
  module Cocina
4
4
  module Models
5
5
  class DescriptiveValueRequired < Struct
6
+ attribute :structuredValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
7
+ attribute :parallelValue, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
6
8
  # String value of the descriptive element.
7
9
  attribute :value, Types::Strict::String.meta(omittable: true)
8
10
  # Type of value provided by the descriptive element.
9
11
  attribute :type, Types::Strict::String.meta(omittable: true)
10
- # Status of the descriptive element relative to other instances of the element.
12
+ # Status of the descriptive element value relative to other instances of the element.
11
13
  attribute :status, Types::Strict::String.meta(omittable: true)
12
14
  # Code value of the descriptive element.
13
15
  attribute :code, Types::Strict::String.meta(omittable: true)
14
16
  # URI value of the descriptive element.
15
17
  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 :standard, Standard.optional.meta(omittable: true)
19
+ attribute :encoding, Standard.optional.meta(omittable: true)
18
20
  attribute :source, Source.optional.meta(omittable: true)
19
- attribute :structuredValue, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
21
+ # The preferred display label to use for the descriptive element in access systems.
22
+ attribute :displayLabel, Types::Strict::String.meta(omittable: true)
23
+ # A term providing information about the circumstances of the statement (e.g., approximate dates).
24
+ attribute :qualifier, Types::Strict::String.meta(omittable: true)
25
+ attribute :note, Types::Strict::Array.of(DescriptiveValue).meta(omittable: true)
20
26
  attribute :appliesTo, Types::Strict::Array.of(DescriptiveBasicValue).meta(omittable: true)
21
27
  end
22
28
  end
@@ -31,7 +31,7 @@ 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)
@@ -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