2.0.0-alpha.0 • Published 4 years ago

@hyperion-framework/presentation-2-parser v2.0.0-alpha.0

Weekly downloads
52
License
MIT
Repository
-
Last release
4 years ago

Parser IIIF conversion

Lists

Set properties

  • thumbnail
  • logo
  • behavior
  • rendering
  • service
  • seeAlso
  • partOf

Annotation properties

  • body
  • target
  • motivation
  • source
  • selector
  • state
  • stylesheet
  • styleClass

Object properties

  • thumbnail -> "Image"
  • logo -> Image"
  • homepage -> ""
  • rendering -> ""
  • seeAlso -> "Dataset"
  • partOf -> ""

Content type map

  • "image" -> "Image",
  • "audio" -> "Sound",
  • "video" -> "Video",
  • "application/pdf" -> "Text",
  • "text/html" -> "Text",
  • "text/plain" -> "Text",
  • "application/xml" -> "Dataset",
  • "text/xml" -> "Dataset"

Steps (re-naming)

  • attribution to requiredStatement
  • viewingHint to behavior
  • description to summary
  • otherContent to annotations
  • within to partOf
  • Start canvas to start - fixing string starts to objects

Steps

  • Convert language mapping on descriptive properties
  • Fix context fields
  • Fix profiles
  • Fix types
  • Fix non-array elements that need to be (set_properties)
  • Head requests for content type of remote items - behind configuration
  • Fix License field, move to metadata if multiple
  • Fix service type (nothing else)
  • Combine members, collections and manifests into items properties
  • contentLayer to supplementary (AnnotationCollection)
  • Convert canvas images to items into annotation page
  • Annotation page to Annotation list
  • Annotation: on -> target
  • Annotation: resource -> body
  • Annotation: motivation remove prefix

Steps (todo)

  • Convert multiple sequences into ranges
  • Merge range structure items + make sure they all have type
  • Remove behaviour=top from range
  • Annotation: parse stylesheet
  • Try to set type on everything - using format, remote types, URL format (content_type_map)
  • Minting of new URLs for IDs that are not set, using IIIF resource guides

Post-process steps

  • Process range structures
  • Add v3 context to top level
  • Reorder keys

Processing levels

  • Process service
  • Process resource (not service or language or not to be traversed)
  • Process generic (top level?)
  • Process collection
  • Process manifest
  • Process sequence
  • Process canvas
  • Process layer
  • Process annotation page (list)
  • Process annotation collection (layer)
  • Process annotation
  • Process specific resource
  • Process textual body
  • Process choice

Post-processing

  • Post-process manifest

Fixtures

Other

  • Check all presence of all MUSTs in the spec and maybe bail?
  • A Collection must have at least one label.
  • A Manifest must have at least one label.
  • An AnnotationCollection must have at least one label.
  • id on Collection, Manifest, Canvas, content, Range,
  • AnnotationCollection, AnnotationPage, Annotation
  • type on all
  • width+height pair for Canvas, if either
  • items all the way down