iiif-prezi / osullivan

IIIF Presentation API for Ruby
BSD 2-Clause "Simplified" License
32 stars 15 forks source link

Manifest conversion fails on Stanford's collection #49

Open benwbrum opened 9 years ago

benwbrum commented 9 years ago

When using osullivan to parse Stanford's collection (from the iiif-universe repository), manifests are remain lists rather than being converted to manifests. This does not happen for Villanova's collections, however, so I'm not sure what's up.

connection = open("https://graph.global/static/data/universes/iiif/stanford.json")
collection_json = connection.read
service = IIIF::Service.parse(collection_json)
service.manifests.first
=> {"@id"=>"http://purl.stanford.edu/bb389yg4719/iiif/manifest.json",
 "location"=>"Stanford University",
 "label"=>"Stanford University Libraries, M1814. Flat Box 2, Folder 02"}
[20] pry(ScCollection)> service.manifests.first.label
NoMethodError: undefined method `label' for #<ActiveSupport::OrderedHash:0x007f2a4260a978>

For comparison, the Yale manifests do convert successfully:

[21] pry(ScCollection)> connection = open("http://manifests.ydc2.yale.edu/manifest")
=> #<File:/tmp/open-uri20151006-13599-18bs854>
[22] pry(ScCollection)> collection_json = connection.read;0
=> 0
[23] pry(ScCollection)> service = IIIF::Service.parse(collection_json);0
=> 0
[24] pry(ScCollection)> service.manifests.first
=> #<IIIF::Presentation::Manifest:0x007f2a3c1d1ec0
 @data=
  {"@type"=>"sc:Manifest",
   "@id"=>"http://manifests.ydc2.yale.edu/manifest/DecretumMagistriGratiani",
   "label"=>"Friedberg, ed., Decretum magistri Gratiani "}>
[25] pry(ScCollection)> service.manifests.first.label=> "Friedberg, ed., Decretum magistri Gratiani "

I can get around this by avoiding dot accessors, but it may be of interest. It's possibly that the problem is in Stanford's manifest and its failure to specify an @type property, and that this isn't an osullivan issue at all.

azaroth42 commented 9 years ago

Not an OSullivan issue, but location in that data isn't a valid property of a manifest. Do the other collections in the "universe" have this too?

benwbrum commented 9 years ago

I'll test the remainder of the collections as I continue to robustify the FromThePage IIIF client. So far, only Stanford has a bad manifest that I've found.

On Tue, Oct 6, 2015 at 2:04 PM, Rob Sanderson notifications@github.com wrote:

Not an OSullivan issue, but location in that data isn't a valid property of a manifest. Do the other collections in the "universe" have this too?

— Reply to this email directly or view it on GitHub https://github.com/IIIF/osullivan/issues/49#issuecomment-145967008.