Skip to content

Commit cf233ca

Browse files
committed
Remove label from schema
1 parent cedb628 commit cf233ca

24 files changed

Lines changed: 32 additions & 145 deletions

lib/cocina/models/admin_policy.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ class AdminPolicy < Struct
1515
attribute :type, Types::Strict::String.enum(*AdminPolicy::TYPES)
1616
# example: druid:bc123df4567
1717
attribute :externalIdentifier, Druid
18-
attribute? :label, Types::Strict::String.default('')
1918
attribute :version, Types::Strict::Integer
2019
# Administrative properties for an AdminPolicy
2120
attribute(:administrative, AdminPolicyAdministrative.default { AdminPolicyAdministrative.new })

lib/cocina/models/admin_policy_lite.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ class AdminPolicyLite < Struct
1313
attribute :type, Types::Strict::String.enum(*AdminPolicyLite::TYPES)
1414
# example: druid:bc123df4567
1515
attribute :externalIdentifier, Druid
16-
attribute? :label, Types::Strict::String.default('')
1716
attribute :version, Types::Strict::Integer
1817
# Administrative properties for an AdminPolicy
1918
# Validation of this property is relaxed. See the schema.json for full validation.

lib/cocina/models/admin_policy_with_metadata.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ class AdminPolicyWithMetadata < Struct
1616
attribute :type, Types::Strict::String.enum(*AdminPolicyWithMetadata::TYPES)
1717
# example: druid:bc123df4567
1818
attribute :externalIdentifier, Druid
19-
attribute? :label, Types::Strict::String.default('')
2019
attribute :version, Types::Strict::Integer
2120
# Administrative properties for an AdminPolicy
2221
attribute(:administrative, AdminPolicyAdministrative.default { AdminPolicyAdministrative.new })

lib/cocina/models/collection.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ class Collection < Struct
2222
attribute :type, Types::Strict::String.enum(*Collection::TYPES)
2323
# example: druid:bc123df4567
2424
attribute :externalIdentifier, Druid
25-
# Primary processing label (can be same as title) for a Collection.
26-
attribute? :label, Types::Strict::String.default('')
2725
# Version for the Collection within SDR.
2826
attribute :version, Types::Strict::Integer
2927
# Access metadata for collections

lib/cocina/models/collection_lite.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ class CollectionLite < Struct
2020
attribute :type, Types::Strict::String.enum(*CollectionLite::TYPES)
2121
# example: druid:bc123df4567
2222
attribute :externalIdentifier, Druid
23-
# Primary processing label (can be same as title) for a Collection.
24-
attribute? :label, Types::Strict::String.default('')
2523
# Version for the Collection within SDR.
2624
attribute :version, Types::Strict::Integer
2725
# Access metadata for collections

lib/cocina/models/collection_with_metadata.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ class CollectionWithMetadata < Struct
2121
attribute :type, Types::Strict::String.enum(*CollectionWithMetadata::TYPES)
2222
# example: druid:bc123df4567
2323
attribute :externalIdentifier, Druid
24-
# Primary processing label (can be same as title) for a Collection.
25-
attribute? :label, Types::Strict::String.default('')
2624
# Version for the Collection within SDR.
2725
attribute :version, Types::Strict::Integer
2826
# Access metadata for collections

lib/cocina/models/dro.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,6 @@ class DRO < Struct
3232
attribute :type, Types::Strict::String.enum(*DRO::TYPES)
3333
# example: druid:bc123df4567
3434
attribute :externalIdentifier, Druid
35-
# Primary processing label (can be same as title) for a DRO.
36-
attribute? :label, Types::Strict::String.default('')
3735
# Version for the DRO within SDR.
3836
attribute :version, Types::Strict::Integer
3937
attribute(:access, DROAccess.default { DROAccess.new })

lib/cocina/models/dro_lite.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ class DROLite < Struct
3030
attribute :type, Types::Strict::String.enum(*DROLite::TYPES)
3131
# example: druid:bc123df4567
3232
attribute :externalIdentifier, Druid
33-
# Primary processing label (can be same as title) for a DRO.
34-
attribute? :label, Types::Strict::String.default('')
3533
# Version for the DRO within SDR.
3634
attribute :version, Types::Strict::Integer
3735
# Validation of this property is relaxed. See the schema.json for full validation.

lib/cocina/models/dro_with_metadata.rb

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ class DROWithMetadata < Struct
3131
attribute :type, Types::Strict::String.enum(*DROWithMetadata::TYPES)
3232
# example: druid:bc123df4567
3333
attribute :externalIdentifier, Druid
34-
# Primary processing label (can be same as title) for a DRO.
35-
attribute? :label, Types::Strict::String.default('')
3634
# Version for the DRO within SDR.
3735
attribute :version, Types::Strict::Integer
3836
attribute(:access, DROAccess.default { DROAccess.new })

lib/cocina/models/mapping/from_mods/description.rb

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,18 @@ class Description
1111

1212
# @param [Nokogiri::XML] mods
1313
# @param [String] druid
14-
# @oaram [String] label
1514
# @param [TitleBuilder] title_builder - defaults to Title class
1615
# @param [Cocina::Models::Mapping::ErrorNotifier] notifier
1716
# @return [Hash] a hash that can be mapped to a cocina descriptive model
18-
def self.props(mods:, druid:, label:, title_builder: Title, notifier: nil)
19-
new(title_builder: title_builder, mods: mods, druid: druid, label: label, notifier: notifier).props
17+
def self.props(mods:, druid:, title_builder: Title, notifier: nil)
18+
new(title_builder: title_builder, mods: mods, druid: druid, notifier: notifier).props
2019
end
2120

22-
def initialize(title_builder:, mods:, label:, druid:, notifier:)
21+
def initialize(title_builder:, mods:, druid:, notifier:)
2322
@title_builder = title_builder
2423
@ng_xml = mods
2524
@notifier = notifier || ErrorNotifier.new(druid: druid)
2625
@druid = druid
27-
@label = label
2826
end
2927

3028
# @return [Hash] a hash that can be mapped to a cocina descriptive model
@@ -34,17 +32,15 @@ def props
3432

3533
check_altrepgroups
3634
check_version
37-
props = DescriptionBuilder.build(title_builder: title_builder,
38-
resource_element: ng_xml.root,
39-
notifier: notifier,
40-
purl: druid ? Cocina::Models::Mapping::Purl.for(druid: druid) : nil)
41-
props[:title] = [{ value: label }] unless props.key?(:title)
42-
props
35+
DescriptionBuilder.build(title_builder: title_builder,
36+
resource_element: ng_xml.root,
37+
notifier: notifier,
38+
purl: druid ? Cocina::Models::Mapping::Purl.for(druid: druid) : nil)
4339
end
4440

4541
private
4642

47-
attr_reader :title_builder, :ng_xml, :notifier, :druid, :label
43+
attr_reader :title_builder, :ng_xml, :notifier, :druid
4844

4945
def check_altrepgroups
5046
ng_xml.xpath('//mods:*[@altRepGroup]', mods: DESC_METADATA_NS)

0 commit comments

Comments
 (0)