Skip to content

Commit

Permalink
Remove mapping of affiliation to contributor (#1000)
Browse files Browse the repository at this point in the history
  • Loading branch information
lfarrell authored Sep 19, 2023
1 parent 5d053a9 commit 38f9317
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
5 changes: 1 addition & 4 deletions spec/models/concerns/blacklight/document/dublin_core_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 38f9317

Please sign in to comment.