-
Notifications
You must be signed in to change notification settings - Fork 1
Manage Sequences
Jana Rajakumar edited this page Feb 21, 2018
·
6 revisions
Reference: https://iiif.library.utoronto.ca/presentation/v2/#!/Sequence/SequenceByItemGet
IIIF Reference: http://iiif.io/api/presentation/2.1/#sequence
- A sequence can be created by sending a
POST
request to{identifier}/sequence
with the required parameters. - For example:
{
"sequence": {
"@id": "http://example.org/iiif/book1/sequence/normal",
"@type": "sc:Sequence",
"label": "Current Page Order",
"viewingDirection": "left-to-right",
"viewingHint": "paged",
"startCanvas": "http://example.org/iiif/book1/canvas/p2",
"canvases": [
{
"@id": "http://example.org/iiif/book1/canvas/p1",
"@type": "sc:Canvas",
"label": "p. 1"
},
{
"@id": "http://example.org/iiif/book1/canvas/p2",
"@type": "sc:Canvas",
"label": "p. 2"
},
{
"@id": "http://example.org/iiif/book1/canvas/p3",
"@type": "sc:Canvas",
"label": "p. 3"
}
]
}
}
- This would create the sequence for the identifier
book1
with namenormal
and also create all of its provided sub-canvases recursively. - Each sub-canvas will have an upward link to this sequence defined in their
belongsTo
field with this sequence@id
. - The new sequence will also have a list of
@id
s in itschildren
field. This value along with thebelongsTo
are later used to re-construct the sequence when viewing. - Suppose any of the sub-canvas already exists, those objects will be updated with any new values from this request. Those objects will also be updated to have their
belongsTo
field to contain this new sequence@id
.
- A sequence can be updated by sending a
PUT
request to/{identifier}/sequence/{name}
with fields that need to be updated. - Updating a sequence without any of its sub-canvases in the request body would not affect its children unless the
@id
is being changed. In this case, an internal update will be performed on all of its children to update theirbelongsTo
values. - Suppose any of the sub-canvas does not exist, those objects will be created with new values from this request. Those objects will also be updated to have their
belongsTo
field to contain this new sequence@id
.
- A sequence can be deleted by sending a
DELETE
request to/{identifier}/sequence/{name}
. Beware that this will also delete all sub-canvases under this sequence recursively.
- A single sequence can be viewed at
/{identifier}/sequence/{name}
. This lists all sub-canvases that have the requested sequence@id
in theirbelongsTo
field.
-
How to create a sequence without an
@id
? -
A
POST
with no@id
in the request body will auto-generate a unique UUIDname
for that object with the providedidentifier
. -
How to hide a specific sub-canvas when viewing a sequence ?
-
This can be achieved by sending a
PUT
request to the object that needs to be hidden by updating thehidden
property totrue
.
{"canvas: {"hidden": true}}
- How to change the order of sub-canvases of a parent sequence?
- This can be achieved by sending a
PUT
request to the parent sequence with the correct order of@id
s for sub-canvases. - This would auto-update the
order
field of all the sub-canvases.
{"sequence": {
"images": [{"@id": "id-of-canvas-1"}, {"@id": "id-of-canvas-2"}]
}}