Module: Libis::Metadata::Mappers::ScopeVlp

Defined in:
lib/libis/metadata/mappers/scope_vlp.rb

Overview

Mixin for DublinCoreRecord to enable conversion of the Scope exported DC record.

Instance Method Summary collapse

Instance Method Details

#to_dc::Libis::Metadata::DublinCoreRecord

Main conversion method.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/libis/metadata/mappers/scope_vlp.rb', line 16

def to_dc
  assert(self.is_a? Libis::Metadata::DublinCoreRecord)

  doc = Libis::Metadata::DublinCoreRecord.new(self.to_xml)

  # set isPartOf
  doc.isPartOf = doc.title.content

  # remove identifiers with URL
  doc.xpath('//dc:identifier[@xsi:type = "dcterms:URI"]').remove

  doc.title = ''

  doc
end