Skip to content

Commit db8698c

Browse files
Copilotcubap
andauthored
Add explicit IIIF v2 prefixed types to resource set (#440)
* Initial plan * Fix IIIF v2 prefix handling in type normalization Co-authored-by: cubap <1119165+cubap@users.noreply.github.com> * Move prefix pattern to class constant and document resource types Co-authored-by: cubap <1119165+cubap@users.noreply.github.com> * Revert prefix stripping; explicitly add IIIF v2 prefixed types Co-authored-by: cubap <1119165+cubap@users.noreply.github.com> * Clarify documentation for agent and annotationlist types Co-authored-by: cubap <1119165+cubap@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: cubap <1119165+cubap@users.noreply.github.com>
1 parent ab4db40 commit db8698c

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

js/vault.js

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,11 +121,19 @@ class Vault {
121121
'motivation', 'purpose', 'profile'
122122
])
123123

124+
// IIIF resource types for both Presentation API v2 (prefixed) and v3 (unprefixed)
125+
// v2 types use prefixes: sc: (Shared Canvas), oa: (Open Annotation)
126+
// v3 types are unprefixed
124127
const iiifResourceTypes = new Set([
128+
// IIIF Presentation API v3 (unprefixed)
125129
'manifest', 'collection', 'canvas', 'annotation',
126130
'annotationpage', 'annotationcollection', 'range',
127-
'agent', 'annotationlist', 'sc:manifest', 'oa:annotationlist',
128-
'oa:annotation'
131+
'agent', // v3 metadata type for providers/creators
132+
// IIIF Presentation API v2 (sc: prefix for Shared Canvas types)
133+
'sc:manifest', 'sc:collection', 'sc:canvas', 'sc:sequence',
134+
'sc:range', 'sc:layer',
135+
// Open Annotation (oa: prefix) - v2 annotation types
136+
'oa:annotation', 'oa:annotationlist' // annotationlist is v2; becomes annotationpage in v3
129137
])
130138

131139
const dataType = this._normalizeType(data?.['@type'] ?? data?.type ?? type)

0 commit comments

Comments
 (0)