From 38f9317d54723a90b9e03b2caa464a3449480f23 Mon Sep 17 00:00:00 2001 From: Dean Farrell Date: Tue, 19 Sep 2023 17:34:11 -0400 Subject: [PATCH] Remove mapping of affiliation to contributor (#1000) --- .../concerns/blacklight/document/dublin_core_override.rb | 2 -- spec/models/concerns/blacklight/document/dublin_core_spec.rb | 5 +---- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/app/overrides/models/concerns/blacklight/document/dublin_core_override.rb b/app/overrides/models/concerns/blacklight/document/dublin_core_override.rb index c80f4ab17..56a77cfa6 100644 --- a/app/overrides/models/concerns/blacklight/document/dublin_core_override.rb +++ b/app/overrides/models/concerns/blacklight/document/dublin_core_override.rb @@ -31,8 +31,6 @@ def export_as_oai_dc_xml array_of_values.each do |v| if field.to_s == 'creator' xml.tag! "dc:#{field}", v.to_s.split('||').first - affiliation = v.to_s.split('||Affiliation: ')[1] - xml.tag! 'dc:contributor', affiliation.split('||').first unless affiliation.blank? elsif field.to_s == 'contributor' xml.tag! "dc:#{field}", v.to_s.split('||').first # display journal values as comma separated string (journal values come from single-valued fields) diff --git a/spec/models/concerns/blacklight/document/dublin_core_spec.rb b/spec/models/concerns/blacklight/document/dublin_core_spec.rb index 8a1a1c8fc..fb7b322fe 100644 --- a/spec/models/concerns/blacklight/document/dublin_core_spec.rb +++ b/spec/models/concerns/blacklight/document/dublin_core_spec.rb @@ -48,14 +48,11 @@ ) } - it 'returns xml document with creator objects in index order, and affiliation' do + it 'returns xml document with creator objects in index order' do xml_doc = Nokogiri::XML(document.export_as_oai_dc_xml) puts "Result: #{document.export_as_oai_dc_xml}" creators = xml_doc.xpath('//dc:creator', 'dc' => 'http://purl.org/dc/elements/1.1/').map(&:text) expect(creators).to eq ['User1, B', 'User0, D', 'User3, C', 'User4, A'] - # Affiliations are captured as dc:contributor fields for creators - affiliations = xml_doc.xpath('//dc:contributor', 'dc' => 'http://purl.org/dc/elements/1.1/').map(&:text) - expect(affiliations).to eq ['School of Medicine, Carolina Center for Genome Sciences'] end end