Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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. A ruby example for creating JWT

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:

Code Block
languageruby
require 'net/http'
require 'jwt'

# shared symmetric secret key to encrypt and decrypt the token
hmac_secret = ENV['YPM_SECRET']

payload = {
  unit: "YPM",
  iat: Time.now.to_i
}
token = JWT.encode payload, hmac_secret, 'HS512'
uri = URI("http://localhost:8182curl -O -H 'Authorization: Bearer TOKEN' 'http://images-dev.collections.yale.edu/iiif/2/ypm:85f1f218-30c1-48a4-8546-17d681f59c35.tif/full/20,/0/default.jpg")

req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{token}"
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end

open('out.jpg', 'w') do |f|
  f.write(res.read_body)
end

Getting Stock TIFF Images

Code Block
https://media.collections.yale.edu/print'

with TOKEN replaced with the actual value of the API key

An example in Ruby:

Code Block
languageruby
require 'net/http'

uri = URI('http://images-dev.collections.yale.edu/iiif/2/ypm:85f1f218-30c1-48a4-8546-17d681f59c35.tif/full/20,/0/default.jpg')
api_key = ENV['YPM_SECRET']

req = Net::HTTP::Get.new(uri)
req['Authorization'] = "Bearer #{api_key}"

res = Net::HTTP.start(uri.hostname, uri.port,
                      use_ssl: uri.scheme == 'https') do |http|
  http.request(req)
end

open('out.jpg', 'w') do |f|
  f.write(res.read_body)
end


Getting Stock TIFF Images

Code Block
https://media.collections.yale.edu/tiff/{unit}/{uuid}.tif

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 P

  • cds_access_jpeg (type string, default N): N, U (unit access), or P

  • cds_maxsize_tiff (type integer, default: 0)

  • cds_maxsize_jpeg (type integer, default: 0)

...

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 gets converted to "sRGB IEC61966-2.1".

Image Conversion to Stock TIFF

Ingestion 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

Example

...

  • 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

Code Block
{
  "@context": "http://iiif.io/api/discovery/0/context.json",
  "id": "https://example.org/activities/p3collection.json",
 
  "type": "OrderedCollectionPageOrderedCollection",
  "first": }
}

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

Code Block
{{
    "@contextid": "httphttps://iiifexample.ioorg/api/discovery/0/contextactivities/p1.json",
  "id": "https://example.org/activities/p2.json",   "type": "OrderedCollectionPage"
  },
  "partOflast": {
    "id": "https://example.org/activities/collectionp3.json",
    "type": "OrderedCollectionOrderedCollectionPage"
  },
  "prev": {
    "id": "https://example.org/activities/p1
}

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

Code Block
{
  "@context": "http://iiif.io/api/discovery/0/context.json",
  "id": "https://example.org/activities/p2.json",
  "type": "OrderedCollectionPage"
  },
  "nextpartOf": {
    "id": "https://example.org/activities/p3collection.json",
    "type": "OrderedCollectionPageOrderedCollection"
  },
  "orderedItemsprev": [{
    {
 "id": "https://example.org/activities/p1.json",
    "type": "CreateOrderedCollectionPage",
   },
  "objectnext": {
   
    "id": "https://example.org/objectsactivities/41002p3.json",
   
    "type": "jsonOrderedCollectionPage"
   
  },
   
  "endTimeorderedItems": "2019-05-10T15:31:01-04:00"
    },[
    {
      "type": "UpdateCreate",
      "object": {
        "id": "https://example.org/objects/5426841002.json",
        "type": "json"
      },
      "endTime": "2019-05-10T15:31:01-04:00"
    },
    {
      "type": "Update",
      "object": {
        "id": "https://example.org/objects/3733154268.xmljson",
        "type": "lidojson"
      },
      "endTime": "2019-05-10T1910T15:31:01Z01-04:00"
    },
        {
      "type": "DeleteUpdate",
      "object": {
        "id": "obj/10788.jsonhttps://example.org/objects/37331.xml",
        "type": "jsonlido"
      },
      "endTime": "2019-05-10T1510T19:31:01-04:0001Z"
    },
    {
  ]  }

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).
"lido" for YUAG, "json" for others.

...

endTime

...

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

Example

Code Block
{
  "unit": "YCBA",
  "cmsType": "obj",
  "cmsId": "1726",
  "metadata": [
    {
      "label": "logo",
    "type": "Delete",
      "object": {
        "id": "obj/10788.json",
        "type": "json"
      },
      "endTime": "2019-05-10T15:31:01-04:00"
    }
  ]
}

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).
"lido" for YUAG, "json" for others.

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

Code Block
{
  "unit": "YCBA",
  "cmsType": "obj",
  "cmsId": "1726",
  "metadata": [
    {
      "label": "logo",
      "value": "https://static.britishart.yale.edu/images/ycba_logo.jpg"
    },
    {
      "label": "label",
      "value": "Robert Dighton, 1752–1814, British, The Produce of Industry, undated"
    },
    {
      "label": "AttributionRights URI",
      "value": "Yale Center for British Art, Paul Mellon Collection, public domain"
"https://creativecommons.org/publicdomain/zero/1.0/"
    },
    {
      "label": "licenseRights Description",
      "value": "http://hdl.handle.net/10079/w6m90dq"
    },
    {
      "label": "Description",
      "value": "Twelve Illustrations to Contemporary Life and Diversions, Sheet: 6 5/8 × 10 7/8 inches (16.8 × 27.6 cm)"
   Metadata describing Yale Center for British Art collections is public domain under CC0. Copyright or other restrictions may apply to cultural works or images of those works in this record."
    },
     {
      "label": "Copyright Statement",
      "value": "Copyright Information"
    },
    {
      "label": "CreatorImage Use Rights URI",
      "value": "Robert Dighton, 1752–1814, Britishhttp://rightsstatements.org/vocab/UND/1.0/"
    },
    {
      "label": "TitleImage Use Rights",
      "value": "TheCopyright ProduceUndetermined: ofThe Industry"copyright and related rights status },of this Item has been {reviewed by the organization that has made "label": "Physical Description"the Item available, but the organization was unable to "value": "Sheet: 6 5/8 × 10 7/8 inches (16.8 × 27.6 cm)"
    },
    {
      "label": "Credit Line",
      "value": "Yale Center for British Art, Paul Mellon Collectionmake a conclusive determination as to the copyright status of the Item. Please refer to the organization that has made the Item available for more information. You are free to use this Item in any way that is permitted by the copyright and related rights legislation that applies to your use."
    },
    {
      "label": "InstitutionAttribution",
      "value": "Yale Center for British Art, Paul Mellon Collection, public domain"
    },
    {
      "label": "CollectionDescription",
      "value": "PrintsTwelve andIllustrations Drawings"to Contemporary Life and  }Diversions, Sheet: 6 5/8 × 10 7/8 inches (16.8 × 27.6 cm)"
    },
    {
      "label": "Call NumberCreator",
      "value": "B1986.29.81Robert Dighton, 1752–1814, British"
    },
    {
      "label": "homepageTitle",
      "value": ["The Produce of Industry"
    },
{    {
      "@idlabel": "https://collections.britishart.yale.edu/catalog/tms:1726",
   Physical Description",
      "labelvalue": "catalogSheet: entry6 at5/8 the× Yale10 Center7/8 for British Art",
 inches (16.8 × 27.6 cm)"
    },
    {
      "formatlabel": "text/html"Credit Line",
      "value": "Yale }Center for British Art, Paul Mellon  ]Collection"
    },
    {
      "label": "seeAlsoInstitution",
      "value": "Yale [Center for British Art"
    },
{    {
      "@idlabel": "https://collections.britishart.yale.edu/oaicatmuseum/OAIHandler?verb=GetRecord&identifier=oai:tms.ycba.yale.edu:1726&metadataPrefix=lido","Collection",
      "value": "Prints and Drawings"
   "format": "text/xml", },
    {
      "profilelabel": "http://www.lido-schema.org/schema/v1.0/lido-v1.0.xsd"Call Number",
      "value":  },"B1986.29.81"
    },
    {
   
      "@idlabel": "http://collection.britishart.yale.edu/id/page/object/1726homepage",
      "value": [
        {
          "format@id": "text/rdf+n3"https://collections.britishart.yale.edu/catalog/tms:1726",
         } "type": "Text",
    ]     }   ]
}


Attributes

...

metadata

...

"label": "catalog entry at the Yale Center for British Art",
          "format": "text/html"
        }
      ]
    },
    {
      "label": "seeAlso",
      "value": [
        {
          "@id": "https://collections.britishart.yale.edu/oaicatmuseum/OAIHandler?verb=GetRecord&identifier=oai:tms.ycba.yale.edu:1726&metadataPrefix=lido",
          "type": "Dataset",
          "format": "text/xml",
          "profile": "http://www.lido-schema.org/schema/v1.0/lido-v1.0.xsd"
        },
        {
          "@id": "http://collection.britishart.yale.edu/id/page/object/1726",
          "format": "text/rdf+n3"
        }
      ]
    }
  ]
}


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

  • An ordered list of items, each of which has a "label" and a "value".

  • All entries are optional, except "label", "logo", and "Attribution" are required.

  • Any combinations of “label” and “values” can be added here, and each item will be added to the top level “metadata” field of the manifest as it is, with the exception of the “special” labels below, which are interpreted differently.

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