Module: NEU::MODS::Projection::PhysicalDescription

Includes:
Support
Included in:
NEU::MODS::Projection
Defined in:
lib/neu/mods/projection/physical_description.rb

Overview

What the resource is and how it is physically described: type, genre, form, extent, notes and the table of contents. See docs/other-fields.md.

Constant Summary

Constants included from Support

Support::AUTHORITY_ATTRIBUTES

Instance Method Summary collapse

Instance Method Details

#digital_origin ⇒ Object



21
# File 'lib/neu/mods/projection/physical_description.rb', line 21

def digital_origin = labeled_texts_at("/mods:mods/mods:physicalDescription/mods:digitalOrigin", from: "..")

#extent ⇒ Object



20
# File 'lib/neu/mods/projection/physical_description.rb', line 20

def extent = labeled_texts_at("/mods:mods/mods:physicalDescription/mods:extent", from: "..")

#format ⇒ Object

Headed by physicalDescription, which is where MODS puts @displayLabel.



19
# File 'lib/neu/mods/projection/physical_description.rb', line 19

def format = labeled_texts_at("/mods:mods/mods:physicalDescription/mods:form", from: "..")

#genres ⇒ Object

The one labeled field with its vocabulary, because a genre is a browse axis.



24
# File 'lib/neu/mods/projection/physical_description.rb', line 24

def genres = labeled_texts_at("/mods:mods/mods:genre", authority: true)

#notes ⇒ Object

Every top-level note, keeping its @type, which changes what it means.



44
45
46
47
48
49
# File 'lib/neu/mods/projection/physical_description.rb', line 44

def notes
  doc.xpath("/mods:mods/mods:note", NAMESPACE).filter_map do |node|
    value = clean(node.text)
    { type: clean(node["type"]), value: value, **qualifiers_of(node) } if value
  end
end

#physical_description_notes ⇒ Object

About the object, not the work, so no @type is kept.



41
# File 'lib/neu/mods/projection/physical_description.rb', line 41

def physical_description_notes = labeled_texts_at("/mods:mods/mods:physicalDescription/mods:note", from: "..")

#reformatting_quality ⇒ Object



36
37
38
# File 'lib/neu/mods/projection/physical_description.rb', line 36

def reformatting_quality
  labeled_texts_at("/mods:mods/mods:physicalDescription/mods:reformattingQuality", from: "..")
end

#resource_type ⇒ Object

MODS repeats typeOfResource, so a record can be text and a still image.



16
# File 'lib/neu/mods/projection/physical_description.rb', line 16

def resource_type = labeled_texts_at("/mods:mods/mods:typeOfResource")

#table_of_contents ⇒ Object

Line breaks kept: here a newline separates one entry from the next.



29
30
31
32
33
34
# File 'lib/neu/mods/projection/physical_description.rb', line 29

def table_of_contents
  doc.xpath("/mods:mods/mods:tableOfContents", NAMESPACE).filter_map do |node|
    lines = Canonicalize.canonical_lines(node.text)
    labeled(lines, node) unless lines.empty?
  end
end

#target_audience ⇒ Object



26
# File 'lib/neu/mods/projection/physical_description.rb', line 26

def target_audience = labeled_texts_at("/mods:mods/mods:targetAudience")