CDS2 Developer Guide
- 1 Getting Object Information
- 1.1 Manifest
- 2 Getting IIIF Images
- 3 Getting Stock TIFF Images
- 4 Ingest of Images and Image Data
- 5 Ingest of Object Data via Activity Stream
- 5.1 Collection
- 5.1.1 Example
- 5.1.2 Attributes
- 5.2 Page
- 5.2.1 Example
- 5.2.2 Attributes
- 5.3 Payload
- 5.3.1 Example
- 5.3.2 Attributes
- 5.1 Collection
Getting Object Information
Manifest
https://manifests.collections.yale.edu/{unit}/{object_type}/{object_id}
object_type
corresponds to assets.cmstype in the TMAN database and object_id
to assets.cmsid.
Example:
https://manifests.collections.yale.edu/ycba/obj/38803
https://manifests.collections.yale.edu/yuag/obj/211386
https://manifests.collections.yale.edu/ypm/nat/2
Getting IIIF Images
IIIF image info
https://images.collections.yale.edu/iiif/2/{unit}:{uuid}.tif/info.json
Example:
https://images.collections.yale.edu/iiif/2/ycba:c5bad9c0-24f7-482c-9852-f6a554a4314a/info.json
IIIF image
https://images.collections.yale.edu/iiif/2/{unit}:{uuid}.tif/{region}/{size}/{rotation}/{quality}.{format}
For detailed explanations for parameters region, size, rotation, quality, and format, please refer to IIIF Image API.
Example:
Full(max) size image: https://images.collections.yale.edu/iiif/2/ycba:c5bad9c0-24f7-482c-9852-f6a554a4314a/full/max/0/default.jpg
Width 280: https://images.collections.yale.edu/iiif/2/ycba:c5bad9c0-24f7-482c-9852-f6a554a4314a/full/280,/0/default.jpg
Height 280: https://images.collections.yale.edu/iiif/2/ycba:c5bad9c0-24f7-482c-9852-f6a554a4314a/full/,280/0/default.jpg
Crop x=500, y=400, width=500, height=480: https://images.collections.yale.edu/iiif/2/ycba:c5bad9c0-24f7-482c-9852-f6a554a4314a/500,400,500,480/max/0/default.jpg
Private image (Unit Access Only)
Attach a JWT to the request as the Authorization header. To encode it, each unit will share a “secret” (see ENV['YPM_SECRET'] in the code below) with ITS.
Send an API key to the request as a bearer token in the Authorization header. Each unit will share an API key (see ENV['YPM_SECRET'] in the code below) with ITS.
A curl example:
with TOKEN
replaced with the actual value of the API key
An example in Ruby:
Getting Stock TIFF Images
Example:
https://media.collections.yale.edu/tiff/ycba/c5bad9c0-24f7-482c-9852-f6a554a4314a.tif
Ingest of Images and Image Data
TMAN Database
production:
traffic-manager-prd.cnh4zslmvwh7.us-east-1.rds.amazonaws.com:1433
development:
traffic-manager-dev.c7exm1chla3f.us-east-1.rds.amazonaws.com:1433
New Database Fields
cds_access_master
(type string, default: N): N (no access) or P (public)cds_access_tiff
(type string, default: N): N or Pcds_access_jpeg
(type string, default N): N, U (unit access), or Pcds_maxsize_tiff
(type integer, default: 0)cds_maxsize_jpeg
(type integer, default: 0)
Rules on Max Sizes
If max size is not specified or the value is 0, the image will maintain its original size.
If max size is bigger than the original size, the image will maintain its original size.
Image Conversion to Pyramidal TIFF
Pyramidal TIFF contains copies of the original image at various scales.
Each copy is created using JPEG compression at the quality level of 90%.
Images are converted to the ICC color profile "sRGB IEC61966-2.1".
Image Conversion to Stock TIFF
Images are converted to the ICC color profile “Adobe RGB 1998”.
Results
Result from processing each content is gets saved to TMAN database columns assetstatus.cds2_status
and assetstatus.cds2_error
.
The possible values for cds2_status
are:
507 | Image processing was successful. Manifest builder has been notified to update the manifest for the content. |
607 | Image processing failed. |
807 | Image processing was successful and the manifest for the content has been updated. |
907 | Image processing was successful but manifest build failed. |
Ingest of Object Data via Activity Stream
Metadata for objects to be delivered in the form of IIIF manifests gets harvested by CDS2 harvester. Each unit should implement an activity stream for that. We will use a subset of the protocol defined in IIIF Change Discovery API.
Note
The stream is to be published via HTTP(s).
As long as it follows the API, the implementation detail is not important. For example, it can be an application that accommodates HTTP GET requests, or it can be a set of files served from an HTTP addressable store such as S3.
All data to be downloaded and parsed by the harvester MUST be encoded in UTF-8.
Collection
A collection is the highest level document that (recursively) contains links to all other necessary documents. The harvester only has to know the URL of the collection.
Example
Attributes
| |
---|---|
id | All "id" attributes in the activity stream must be an actionable URL for the resource |
first | Points to the first page document (in time order) |
last | Points to the last page document |
Page
Example
Attributes
context | description | |
---|---|---|
type | under "orderedItems" | Type of activity. Must be “Create”, “Update”, or “Delete”. For practical purposes, “Create” and “Update” are handled in the same way and won’t make any real difference. |
type | under "object" | Type of the payload (the object that changed). |
endTime | Timestamp of the activity. The page document must list the activities (in orderedItems) in order, sorted by endTime (earlier activity goes first). The time values for the “endTime” attribute should follow the format “YYYY-MM-DDThh:mm:ssTZD”, a.k.a. RFC3339 or ISO 8601. For example, “3:25 p.m., December 4, 2019, EST”, should be presented as “2019-12-04T15:25:00-05:00” or “2019-12-04T20:25:00Z”. |
Payload
Document ("object") referenced by an activity item in the page document. It contains the real data for the object in question.
Example
Attributes
| ||
---|---|---|
unit, cmsType, cmsId |
| These three values together uniquely defines an object, corresponding respectively to unitcode, cmstype, and cmsid in the dbo.assets table of TMAN database. |
metadata |
|
|
| label | becomes the “label” for the whole manifest |
| Rights URI | goes to the top level “rights” field |
| Rights Description | goes into the top level “requiredStatement” field |
| Copyright Statement |
|
| Image Use Rights URI |
|
| Image Use Rights |
|
| logo | goes to the top level “logo” field |
| homepage, seeAlso | goes to the top level “homepage”, “seeAlso” field respectively. Since these can have great variability among units, this field should be entered verbatim as should appear in the manifest, according to the API. See
|