ObjectObject (Museology) Artefact or specimen held in a museum collection. (Computer science) A software "bundle" consisting of a set of variables which define the states the object can exist in and a set of functions that define its behavior. records will contain references to any images, video, audio or other media that represent that object.
To find object records with attached media, include the hasMedia: true
in your queryQuery (Computer Science) A query is a request for data or information from a database table or combination of tables, or an API that manages access to those tables, for example:
{
object(hasImages:true) {
id
titleTitle (Museology) The name given to the design or work of art.
summary
multimediaMultimedia (API) A section of an API record that provides access to images, video, audio or other file associated with an object.
}
}
Resized media (images)
Pre-processed media files are available at different dimensions, known as ‘artifacts’, these are:
preview
: 350px on its shortest side.large
: 1024px on its shortest side.zoom
: A zoomable pyramid tiff generated from the sourceSource (API) The origin of the data or object. image. Only generated for media whose original is at least 300px on its shortest side.original
: The original image asset, published where the object is licensed as CC0.
Example
In the following recordRecord (Computer Science) A unit that groups together related items of data, for example all the fields that represent a museum collection object, you can see how format type and image dimensions are included alongside URLs to the different media artifacts.
{
"data": {
"object": [
{
"id": "object-9346",
"summary": {
"title": "Drawing"
},
"multimedia": [
{
"cc0": true,
"datatype": {
"actual": "image",
"base": "media"
},
"department": [
{
"@admin": {
"id": "department-23",
"source": "tms",
"status": "public",
"uuid": "efba4e30-b776-3975-a655-bce874a3be01"
}
}
],
"id": "media-122215",
"large": {
"format": "jpeg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 1024
},
{
"dimension": "width",
"units": "pixels",
"value": 1451
}
],
"filesize": {
"units": "bytes",
"value": 282572
}
},
"url": "https://ciim-static-media.s3.us-east-1.amazonaws.com/122/215/large_CHSDM_F50C19FA59A32_000001.jpg"
},
"original": {
"format": "jpeg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 2244
},
{
"dimension": "width",
"units": "pixels",
"value": 3180
}
],
"filesize": {
"units": "bytes",
"value": 5700457
}
},
"processed": true,
"url": "https://ciim-static-media.s3.us-east-1.amazonaws.com/122/215/CHSDM_F50C19FA59A32_000001.jpg"
},
"preview": {
"format": "jpeg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 350
},
{
"dimension": "width",
"units": "pixels",
"value": 496
}
],
"filesize": {
"units": "bytes",
"value": 43376
}
},
"url": "https://ciim-static-media.s3.us-east-1.amazonaws.com/122/215/preview_CHSDM_F50C19FA59A32_000001.jpg"
},
"summary": {
"title": "CHSDM-F50C19FA59A32-000001"
},
"type": "image"
},
{
"datatype": {
"actual": "image",
"base": "media"
},
"id": "media-267864",
"large": {
"format": "jpeg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 1024
},
{
"dimension": "width",
"units": "pixels",
"value": 732
}
],
"filesize": {
"units": "bytes",
"value": 162047
}
},
"url": "https://ciim-static-media.s3.us-east-1.amazonaws.com/267/864/large_CHSDM_9346_02_000001.jpg"
},
"preview": {
"format": "jpeg",
"measurements": {
"dimensions": [
{
"dimension": "height",
"units": "pixels",
"value": 350
},
{
"dimension": "width",
"units": "pixels",
"value": 250
}
],
"filesize": {
"units": "bytes",
"value": 49001
}
},
"url": "https://ciim-static-media.s3.us-east-1.amazonaws.com/267/864/preview_CHSDM_9346_02_000001.jpg"
},
"summary": {
"title": "CHSDM-9346_02-000001"
},
"type": "image"
}
]
}
]
},
"extensions": {
"pagination": {
"hits": 1,
"per_page": 10,
"current_page": 0,
"number_of_pages": 1
}
}
}
Zooms
Zoomable images, serving a “pyramid” of tiles that allow an applicationApplication (Computer Science) A computer software unit that provides functionality for particular use to zoom in to the fine detail, are also available via the APIAPI (Computer Science) Application Programming Interface – a facility to allow a computer or application to access the data and/or functionality of another computer system or application at multimedia.zoom.url
. A query that returns zoom information will look like this:
{
object(hasImages:true) {
media {
id
large
preview
zoom
original
}
}
}{
object(hasImages:true) {
media {
id
large
preview
zoom
original
}
}
}
To resolve the zoomable image’s IIIF manifest, you can append /info.jsonJSON (Computer Science) JSON (JavaScript Object Notation) is a structured format for data that is lightweight (does not contain a lot of markup) and easy to parse.
to the URL. For example: https://ch-api.ch-dev-use.link/iiif/3/138%2f845%2fCHSDM_283851_04.ptif/info.json
Creative Commons
If an object record is licensed under the Creative Commons “CC0” license, then its media data will contain cc0: true
. If this is not the case, there will be no cc0
field present.
Limiting your query to just the media artifacts that you need
It is possible to restrict the query to only the artifacts that you require for a task. For example, if you were using the API to produce a grid of thumbnail images, the following query would limit the data to just the fieldsFields (Computer Science) The smallest container of information in a database. A field is named, e.g. "Title" or "Date" and each record contains a group of fields. you would need:
{
object(hasImages:true) {
summary
media {
id
preview
}
}
}
Colors
Many images have been analyzed using machine learning to extract their constituent colors. To search for records with color information, add colors
to your query:
{
object(colors:"#8eabae") {
id
colors
multimedia
}
}
The responseResult (Computer Science) The data (in JSON format) that is returned by the API following a query. It will either contain records, or, if there is a problem with the query, an error message. will consist of the following types of information:
"gvision": {
"colors": [
{
"confidence": "58.85", # The AI's confidence of the resultResult (Computer Science) The data (in JSON format) that is returned by the API following a query. It will either contain records, or, if there is a problem with the query, an error message. in %
"fraction": 0.37141976, # The fraction of pixels the color occupies in the image [0-1]
"hex": "#8eabae", # The hex valueValue (Computer Science) The representation given to the corresponding entity, often the public description of the entity. of the color
"rgb": {
"blue": 174,
"green": 171,
"red": 142,
"value": "142, 171, 174" # The combined RGB values
}
}
]
}