-
Notifications
You must be signed in to change notification settings - Fork 1
Manage Collections
Jana Rajakumar edited this page Feb 21, 2018
·
11 revisions
Reference: https://iiif.library.utoronto.ca/presentation/v2/#!/Collection/CollectionsGet
- Create a Collection
- Update a Collection
- Delete a Collection
- View Top Level Collection
- View a Collection
- FAQ
IIIF Reference: http://iiif.io/api/presentation/2.1/#collection
- A collection can be created by sending a
POSTrequest to/collectionswith the required parameters. - For example:
{
"collection": {
"@id": "http://example.org/iiif/collections/to-p",
"label": "some collection label parent",
"collections": [
{
"@id": "http://example.org/iiif/collections/top6",
"label": "some colelction label child"
},
{
"@id": "http://example.org/iiif/collections/top98",
"label": "anothoer colelction label child"
}
],
"manifests": [
{
"@id": "http://example.org/iiif/book1/manifest",
"label": "some manifest label parent"
},
{
"@id": "http://example.org/iiif/book2/manifest",
"label": "some manifest label"
}
],
"members": [
{
"@id": "http://example.org/iiif/book3/manifest",
"label": "some manifest label parent",
"@type": "sc:Manifest"
},
{
"@id": "http://example.org/iiif/collections/top6666",
"label": "some manifest label",
"@type": "sc:Collection"
}
]
}
}- This would create the collection
to-pand also create all of its sub-collections and manifests provided. - Each sub-collection and manifest will have an upward link to this collection defined in their
belongsTofield with this collection@id. - The new collection will also have a list of
@ids in itschildrenfield. This value along with thebelongsToare later used to re-construct the collection when viewing. - Suppose any of the sub-collection or manifest already exists, those objects will be updated with any new values from this request. Those objects will also be updated to have their
belongsTofield to contain this new collection@id.
- A collection can be updated by sending a
PUTrequest to/collections/{name}with fields that need to be updated. - Updating a collection without any of its sub-collections or manifests in the request body would not affect its children unless the
@idis being changed. In this case, an internal update will be performed on all of its children to update theirbelongsTovalues. - Suppose any of the sub-collection or manifest does not exist, those objects will be created with new values from this request. Those objects will also be updated to have their
belongsTofield to contain this new collection@id.
- A collection can be deleted by sending a
DELETErequest to/collections/{name}. Beware that this will also delete all sub-collections and manifests under this collection recursively.
- The top level UofT collection can be viewed at
/collections. This lists all sub-collections and manifests that have theirbelongsTofield to an empty list.
- A single collection can be viewed at
/collections/{name}. This lists all sub-collections and manifests that have the requested collection@idin theirbelongsTofield.
-
How to create a collection without an
@id? -
A
POSTwith no@idin the request body will auto-generate a unique UUIDnamefor that object. -
How to hide a specific sub-collection or manifest when viewing a collection ?
-
This can be achieved by sending a
PUTrequest to the object that needs to be hidden by updating thehiddenproperty totrue.
{"collection: {"hidden": true}} or {"manifest: {"hidden": true}}
- How to change the order of sub-collections or manifests of a parent collection?
- This can be achieved by sending a
PUTrequest to the parent collection with the correct order of@ids for sub-collections and manifests. - This would auto-update the
orderfield of all the sub-collections and manifests.
{"collection": {
"collections": [{"@id": "id-of-collection-1"}, {"@id": "id-of-collection-2"}],
"manifests": [{"@id": "id-of-manifest-1"}, {"@id": "id-of-manifest-2"}]
}}