UWDC
Synopsis
Gem for accessing University of Wisconsin Digital Collection items from our Fedora Commons repository.
Install
gem install uwdc
Usage
METS
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
Display
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.
MODS
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
UWDC Origin/PREMIS
Obtain the preservation metadata for a UWDC object.
mets.origin.submitters
# => ["Louisiana State University Libraries, Special Collections, Louisiana and Lower Mississippi Valley Collections."]
RELS-EXT
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", ... }
Structural Map
Obtain the hierarchical structural map of a UWDC object.
mets.struct_map.structure
# => [#<UWDC::Div @node=#<Nokogiri::XML::Element name="div" attributes=[...]
Changelog
Nothing to mention yet.
Contributors
Eric Larson
Copyright
UWDC © 2013 Board of Regents - University of Wisconsin System. UWDC is licensed under the MIT license. Please see the LICENSE for more information.