Skip to content

Presentation 4.0#60

Open
stephenwf wants to merge 2 commits intomainfrom
feature/presentation-4.0
Open

Presentation 4.0#60
stephenwf wants to merge 2 commits intomainfrom
feature/presentation-4.0

Conversation

@stephenwf
Copy link
Member

IIIF Presentation 4

  • upgradeToPresentation4() to ingest v2.1, v3.0 or v4.0 into a v4-compatible shape
  • Traverse with v4 container support (Timeline, Canvas, Scene)
  • normalize() with deterministic ID minting for missing IDs
  • validatePresentation4() with traversal-first diagnostics (tolerant or strict)
  • serializeConfigPresentation4 for native v4 output
  • serializeConfigPresentation3 for strict v4→v3 downgrade (fails on unsupported v4-only constructs)
  • pnpm run update-cookbook-v4 to refresh local fixtures/cookbook-v4 from preview cookbook v4
import {
  upgradeToPresentation4,
  normalize,
  validatePresentation4,
  serialize,
  serializeConfigPresentation4
} from '@iiif/parser/presentation-4';

const upgraded = upgradeToPresentation4(loadSomeManifest());
const report = validatePresentation4(upgraded);
const normalized = normalize(upgraded);
const serialized = serialize(
  { entities: normalized.entities, mapping: normalized.mapping, requests: {} },
  normalized.resource,
  serializeConfigPresentation4
);

Included is all the v4 3D manifests I could find. Also the v4 cookbook.

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant