Skip to content

Commit 83d9921

Browse files
committed
better standardize object path examples
1 parent 9c65f90 commit 83d9921

File tree

1 file changed

+75
-49
lines changed

1 file changed

+75
-49
lines changed

docs/metadata/object-paths.md

Lines changed: 75 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -46,52 +46,58 @@ For example:
4646

4747
## Path for YouTube Objects
4848

49-
YouTube video items are supported in Item pages via the `video` value for the "[display_template]({{ '/docs/metadata/csv_metadata/#display_template' | relative_url }})" metadata field.
49+
YouTube video items are supported in Item pages via the `video` value for the [display_template]({{ '/docs/metadata/csv_metadata/#display_template' | relative_url }}) metadata field.
5050
Provide the full YouTube video link in the "object_location" metadata field.
5151
Use the API recipes below to fill in the "image_small" and "image_thumb" fields if desired.
5252

5353
The "image_small" and "image_thumb" fields can be filled in using YouTube's image API.
54-
This API is not well documented by Google, but is used by many sites and JS libraries.
54+
This API is not well documented by Google, but is used by many sites and JS libraries--check the details below.
5555

5656
For most CB collections the recipes will look like:
5757

58-
- "object_location" = the full YouTube video link, https://youtu.be/`[youtubeid]`
59-
- e.g. https://youtu.be/CVXQ3X6Q8oU
60-
- "image_small" = max quality youtube image api, https://img.youtube.com/vi/`[youtubeid]`/maxresdefault.jpg
61-
- e.g. https://img.youtube.com/vi/CVXQ3X6Q8oU/maxresdefault.jpg
62-
- "image_thumb" = high quality youtube image api, https://img.youtube.com/vi/`[youtubeid]`/hqdefault.jpg
63-
- e.g. https://img.youtube.com/vi/CVXQ3X6Q8oU/hqdefault.jpg
58+
- "object_location"
59+
- the full YouTube video link
60+
- Recipe: `https://youtu.be/` + "youtubeid"
61+
- Example: `https://youtu.be/CVXQ3X6Q8oU`
62+
- "image_small"
63+
- the max quality youtube image api
64+
- Recipe: `https://img.youtube.com/vi/` + "youtubeid" + `/maxresdefault.jpg`
65+
- Example: `https://img.youtube.com/vi/CVXQ3X6Q8oU/maxresdefault.jpg`
66+
- "image_thumb" = high quality youtube image api
67+
- Recipe: `https://img.youtube.com/vi/` + "youtubeid" + `/hqdefault.jpg`
68+
- Example: `https://img.youtube.com/vi/CVXQ3X6Q8oU/hqdefault.jpg `
6469

6570
### YouTube Image API
6671

6772
Below is more information about the YouTube image API incase the recipe suggestions above do not work for your collection.
6873
Keep in mind you can also manually create your own derivative images for the videos (using screenshots or exports) if the auto generated YouTube options don't meet your needs.
6974

7075
Basically, you can get four sizes of the default thumbnail, or four smaller thumbnails from different points in the video.
71-
You can use the domain "img.youtube.com" or "i3.ytimg.com"
76+
You can use the domain "img.youtube.com" or "i3.ytimg.com".
77+
Replace `[youtubeid]` with the id of your video in these recipes.
7278

7379
Default images:
7480

75-
- thumb 120x90, https://img.youtube.com/vi/`[youtubeid]`/default.jpg
76-
- medium quality 320x180, https://img.youtube.com/vi/`[youtubeid]`/mqdefault.jpg
77-
- high quality 480x360, https://img.youtube.com/vi/`[youtubeid]`/hqdefault.jpg
78-
- SD 640x480 (not available for all videos), https://img.youtube.com/vi/`[youtubeid]`/sddefault.jpg
79-
- max quality 1280×720 (or 1920x1080?, not available for all videos), https://img.youtube.com/vi/`[youtubeid]`/maxresdefault.jpg
81+
- thumb 120x90, `https://img.youtube.com/vi/[youtubeid]/default.jpg`
82+
- medium quality 320x180, `https://img.youtube.com/vi/[youtubeid]/mqdefault.jpg`
83+
- high quality 480x360, `https://img.youtube.com/vi/[youtubeid]/hqdefault.jpg`
84+
- SD 640x480 (not available for all videos), `https://img.youtube.com/vi/[youtubeid]/sddefault.jpg`
85+
- max quality 1280×720 (or 1920x1080?, not available for all videos), `https://img.youtube.com/vi/[youtubeid]/maxresdefault.jpg`
8086

8187
Auto thumbs:
8288

83-
- default thumb, 480x360, https://img.youtube.com/vi/`[youtubeid]`/0.jpg
84-
- alternate 120x90, https://img.youtube.com/vi/`[youtubeid]`/1.jpg
85-
- alternate 120x90, https://img.youtube.com/vi/`[youtubeid]`/2.jpg
86-
- alternate 120x90, https://img.youtube.com/vi/`[youtubeid]`/3.jpg
89+
- default thumb, 480x360, `https://img.youtube.com/vi/[youtubeid]/0.jpg`
90+
- alternate 120x90, `https://img.youtube.com/vi/[youtubeid]/1.jpg`
91+
- alternate 120x90, `https://img.youtube.com/vi/[youtubeid]/2.jpg`
92+
- alternate 120x90, `https://img.youtube.com/vi/[youtubeid]/3.jpg`
8793

8894
For more control, you can use [YouTube Data API](https://developers.google.com/youtube/v3/), but it requires a key to access.
8995

9096
------
9197

9298
## Path for Vimeo Objects
9399

94-
Vimeo video items are supported in Item pages via the `video` value for the "[display_template]({{ '/docs/metadata/csv_metadata/#display_template' | relative_url }})" metadata field.
100+
Vimeo video items are supported in Item pages via the `video` value for the [display_template]({{ '/docs/metadata/csv_metadata/#display_template' | relative_url }}) metadata field.
95101
Provide the full Vimeo video link in the "object_location" metadata field.
96102

97103
Vimeo does not have a documented thumbnail API.
@@ -104,50 +110,67 @@ One option is to create screenshots to use as derivative images--if image_thumb
104110
[Internet Archive](https://archive.org/) image items are accessible via standard IIIF api.
105111
Check the [IA IIIF documentation](https://iiif.archive.org/iiif/documentation) for full details.
106112
This works well for adding image and book items into a CB collection without needing to store any objects in your project.
107-
You can upload your items at IA or curate existing items in for your exhibit.
113+
You can upload your items at IA or curate existing IA items for your exhibit.
114+
Since IA's interface isn't great for browsing and you can not customize item pages, using CB to provide context for a curated collection is a great option.
108115

109116
### Single Image Items
110117

111118
For single image items following the standard CB set up, you will use the IIIF recipes to create image URLs for your "object_location", "image_small", and "image_thumb" fields.
112119
To use the recipes you will need the image identifier--this is a bit tricky because you will need the item id plus the individual filename to create the identifier for IIIF.
113120

114-
- **ID:** IA item id is the last part of the item's URL.
115-
- e.g. https://archive.org/details/mma_wheat_field_with_cypresses_436535 the id is `mma_wheat_field_with_cypresses_436535`
116-
- **Filename:** The filename can be found by checking the "Download Options" box on the item's page. Click "Show all" option. This will list various files. Look for the main JPG, which might have a strange name.
117-
- e.g. https://archive.org/download/mma_wheat_field_with_cypresses_436535 the filename is "436535.jpg".
118-
- You can use this method to reference individual images from a book / multiple image items. Looking at the download files, the images will be in a zip folder (generally look for the JP2 version). You will separate each level of folders shown in the downloads by an escaped slash `%2f`. E.g. to get the cover of this [book item](https://archive.org/details/aladoren00newbuoft), the filename is `%2faladoren00newbuoft_jp2.zip%2faladoren00newbuoft_jp2%2faladoren00newbuoft_0001.jp2` (a zip file, then a folder, then the filename). Generally, it will be easier to get this info from the manifest.json!
119-
- *Alternatively,* you can find the IIIF identifier by checking the "info.json" for an item following the pattern `https://iiif.archive.org/iiif/` + item id + `/info.json`, e.g. https://iiif.archive.org/iiif/mma_wheat_field_with_cypresses_436535/info.json. This json will have a field "@id" listed, with the full identifier following the "https://iiif.archive.org/image/iiif/2/" url. Note, "info.json" is only available for single image items!
120-
- **Identifier:** The identifier for IIIF will be the ID and Filename separated by an escaped slash `%2f`
121-
- e.g. `mma_wheat_field_with_cypresses_436535%2f436535.jpg`
121+
- **ID:**
122+
- IA item id is the last part of the item's URL.
123+
- Example: for URL "https://archive.org/details/mma_wheat_field_with_cypresses_436535" the id is `mma_wheat_field_with_cypresses_436535`
124+
- **Filename:**
125+
- The filename can be found by checking the "Download Options" box on the item's page. Click "Show all" option. This will list various files. Look for the main JPG, which might have a strange name. You can look at the filename as listed in the downloads or copy the download link to get the name.
126+
- Example: visiting the [example item's download page](https://archive.org/download/mma_wheat_field_with_cypresses_436535) we can see the filename is `436535.jpg`.
127+
- You can use this method to reference individual images from a book / multiple image items. Looking at the download files, the images will be in a zip folder (generally look for the JP2 version). You will separate each level of folders shown in the downloads by an escaped slash `%2f`.
128+
- Example: to get the cover of this [book item](https://archive.org/details/aladoren00newbuoft), the filename is `%2faladoren00newbuoft_jp2.zip%2faladoren00newbuoft_jp2%2faladoren00newbuoft_0001.jp2` (a zip file, then a folder, then the filename). Generally, it will be easier to get this info from the manifest.json!
129+
- *Alternatively,* you can find the IIIF identifier by checking the "info.json" for an item following the pattern `https://iiif.archive.org/iiif/` + item id + `/info.json`. This json will have a field "@id" listed, with the full identifier following the "https://iiif.archive.org/image/iiif/2/" url. Note, "info.json" is only available for single image items!
130+
- Example: `https://iiif.archive.org/iiif/mma_wheat_field_with_cypresses_436535/info.json`
131+
- **Identifier:**
132+
- The identifier for IIIF will be the ID and Filename separated by an escaped slash `%2f`. You will use this value in the IIIF recipes.
133+
- Example: `mma_wheat_field_with_cypresses_436535%2f436535.jpg`
122134

123135
Once you have the identifier, you can use standard IIIF recipes to create urls that will retrieve appropriately sized images:
124136

125-
- "object_location" = full sized, `https://iiif.archive.org/image/iiif/3/` + identifier + `/full/max/0/default.jpg`
126-
- e.g. https://iiif.archive.org/image/iiif/3/mma_wheat_field_with_cypresses_436535%2f436535.jpg/full/max/0/default.jpg
127-
- "image_small" = 800px width, `https://iiif.archive.org/image/iiif/3/` + identifier + ``/full/,800/0/default.jpg`
128-
- e.g. https://iiif.archive.org/image/iiif/3/mma_wheat_field_with_cypresses_436535%2f436535.jpg/full/,800/0/default.jpg
129-
- "image_thumb" = 450px width, `https://iiif.archive.org/image/iiif/3/` + identifier + `/full/,450/0/default.jpg`
130-
- e.g. https://iiif.archive.org/image/iiif/3/mma_wheat_field_with_cypresses_436535%2f436535.jpg/full/,450/0/default.jpg
137+
- "object_location"
138+
- full sized image
139+
- Recipe: `https://iiif.archive.org/image/iiif/3/` + identifier + `/full/max/0/default.jpg`
140+
- Example: `https://iiif.archive.org/image/iiif/3/mma_wheat_field_with_cypresses_436535%2f436535.jpg/full/max/0/default.jpg`
141+
- "image_small"
142+
- 800px width
143+
- Recipe: `https://iiif.archive.org/image/iiif/3/` + identifier + ``/full/,800/0/default.jpg`
144+
- Example: `https://iiif.archive.org/image/iiif/3/mma_wheat_field_with_cypresses_436535%2f436535.jpg/full/,800/0/default.jpg`
145+
- "image_thumb"
146+
- 450px width
147+
- Recipe: `https://iiif.archive.org/image/iiif/3/` + identifier + `/full/,450/0/default.jpg`
148+
- Example: `https://iiif.archive.org/image/iiif/3/mma_wheat_field_with_cypresses_436535%2f436535.jpg/full/,450/0/default.jpg`
131149

132-
### Book, Multiple Image Items, or IIIF Viewer
150+
### IIIF Viewer for Books and Images
133151

134-
To display an IA item with a IIIF viewer (instead of the default CB simple image style template), it is possible to use the "manifest.json".
152+
To display an IA item in a IIIF viewer (instead of CB's default simple image style template), it is possible to use the "manifest.json".
135153
The full url to the "manifest.json" file will be used in the "object_location" field.
136154
The recipe follows the pattern:
137-
`https://iiif.archive.org/iiif/3/` + item id + `/manifest.json`
138155

139-
e.g. for book item page, https://archive.org/details/aladoren00newbuoft
140-
the IIIF manifest will be at
141-
https://iiif.archive.org/iiif/3/aladoren00newbuoft/manifest.json
156+
- "object_location"
157+
- URL to IIIF manifest.json
158+
- Recipe: `https://iiif.archive.org/iiif/3/` + item id + `/manifest.json`
159+
- Example: for book item page at "https://archive.org/details/aladoren00newbuoft", the IIIF manifest will be `https://iiif.archive.org/iiif/3/aladoren00newbuoft/manifest.json`
160+
161+
The recipe for manifest url is the same for both book and single image items, and can be used for either to display the item in a IIIF viewer.
162+
You will still want to figure out appropriate derivatives for "image_small" and "image_thumb" using the IIIF recipes above or manually created images.
142163

143-
The recipe for manifest url is the same for both book and single image items, and can be used for either in the universal IIIF viewer.
144-
You will still want to figure out appropriate derivatives for "image_small" and "image_thumb" using the recipes above or manually created images.
164+
With the manifest.json url in "object_location", you will then modify the "image" display_template or create a new display_template that uses a IIIF viewer to display the items.
165+
CB has an include with [Universal Viewer](https://github.com/UniversalViewer/universalviewer) set up to use in this context.
145166

146-
With the manifest.json url in "object_location", you will then modify the "image" display_template or create a new display_template for the IIIF viewer items.
167+
If all your "image" items are set up with a manifest.json, edit "_layouts/item/image.html"--or if you would like to create a new custom display_template, create a new file such as "_layouts/item/iiif_image.html" by copying "_layouts/item/image.html".
168+
In the file, change the line:
147169

148-
In "_layouts/item/image.html" (or a new file such as "_layouts/item/iiif_image.html") change
149170
`{% raw %}{% include item/image-gallery.html %}{% endraw %}`
150-
to
171+
172+
to to use the iiif-manifest-universal-viewer include instead:
173+
151174
`{% raw %}{% include item/iiif-manifest-universal-viewer.html %}{% endraw %}`
152175

153176
Note: Universal Viewer this will work with manifest.json loaded from IA.
@@ -161,11 +184,14 @@ A potential work around is to download a the manifests and put them directly in
161184
The CONTENTdm API can be used to retrieve display images and file downloads from any CONTENTdm repository.
162185
To use the API you will need to know the "Collection Alias" and "CONTENTdm number" of each object:
163186

164-
- The **Collection Alias** is a path assigned by CONTENTdm and can be found in CONTENTdm Admin on the Collections > Profile page, or by looking at the URL of the collection on the web. For example "https://cdm17254.contentdm.oclc.org/digital/collection/ui_ep/search" the collection alias is given after "/collection/", so would be `ui_ep`.
165-
166-
- The values for **CONTENTdm number** are included in your metadata by default when you export your collection's metadata from CONTENTdm.
187+
- **Collection Alias**
188+
- a path assigned by CONTENTdm and can be found in CONTENTdm Admin on the Collections > Profile page, or by looking at the URL of the collection on the web.
189+
- Example: "https://cdm17254.contentdm.oclc.org/digital/collection/ui_ep/search" the collection alias is given after "/collection/", so would be `ui_ep`.
190+
- **CONTENTdm number**
191+
- Individual identifier for each item in a collection. The values for *CONTENTdm number* are included in your metadata by default when you export your collection's metadata from CONTENTdm.
192+
- Example: `1`
167193

168-
Once you have columns in your metadata for "Collection Alias" and "CONTENTdm number" you can use formulas in Sheets or OpenRefine based on the CDM APIs to fill in `object_location`, `image_small`, and `image_thumb` columns for different item types.
194+
Once you have columns in your metadata for "Collection Alias" and "CONTENTdm number" you can use formulas in Sheets or OpenRefine based on the CDM APIs to fill in "object_location", "image_small", and "image_thumb" columns for different item types.
169195
In general, it is best to use IIIF for image objects and CDM "utils" API for non-image items.
170196

171197
- [CONTENTdm API reference](https://help.oclc.org/Metadata_Services/CONTENTdm/Advanced_website_customization/API_Reference/CONTENTdm_API)

0 commit comments

Comments
 (0)