Gem for accessing University of Wisconsin Digital Collection items from our Fedora Commons repository.
gem install uwdc
Obtain the METS metadata for a UWDC object.
require 'uwdc'
mets = UWDC::Mets.new('33QOBSVPJLWEM8S')
mets.mods
mets.mods.titles
# => ["A life idyl"]
mets.mods.metadata
# => {:titles=>["A life idyl"], :names=>[], :dates=>["1869"], :forms=>["text"], ...}
UWDC METS will contain:
- Display
- MODS
- Origin (PREMIS)
- RELS-EXT
- FileSec
- StructMap
Obtain display methods for the UWDC object.
- Images
- Audio
- Video (todo)
- Downloads (todo)
mets.display.images
# => {"x1711-dl_U4QQPS4KWQSUA8A"=>[#<UWDC::FileAsset", @mimetype="image/jpeg", @use="thumb", @href="http://url.edu">, ...]}
The display class will be extended considerably in future releases of this gem.
Obtain the MODS metadata for a UWDC object.
mods = UWDC::Mods.new('33QOBSVPJLWEM8S')
mods.titles
MODS top-level elements are boiled in Ruby to something more dot-syntax friendly.
UWDC::Mods method | MODS Element | Example output |
---|---|---|
mods.titles | titleInfo | ["A life idyl", ...] |
mods.names | name | [OpenStruct.new(:name, :role), ...] |
mods.dates | originInfo | ["1869"] |
mods.forms | physicalDescription | ["text"] |
mods.abstracts | abstract | ["Green leather with gold stamping...", ...] |
mods.subjects | subject | ["Bookbinding--Techniques--Gold stamping", ...] |
mods.access_conditions | accessCondition | [OpenStruct.new(:rights, :reuse), ...] |
mods.related_items | relatedItem | [OpenStruct.new(:label, :name), ...] |
Transform via to_* calls. Supports JSON, Ruby and XML
mods.to_json
mods.to_ruby
mods.to_xml
Obtain the preservation metadata for a UWDC object.
mets.origin.submitters
# => ["Louisiana State University Libraries, Special Collections, Louisiana and Lower Mississippi Valley Collections."]
Obtain the object-to-object relationship metadata for a UWDC object.
mets.rels_ext.models
# => {"x1711-dl_33QOBSVPJLWEM8S-RELS-EXT"=>["info:fedora/1711.dl:CModelUWDCObject", ... }
Obtain the hierarchical structural map of a UWDC object.
mets.struct_map.structure
# => [#<UWDC::Div @node=#<Nokogiri::XML::Element name="div" attributes=[...]
Nothing to mention yet.
Eric Larson
UWDC © 2013 Board of Regents - University of Wisconsin System. UWDC is licensed under the MIT license. Please see the LICENSE for more information.