diff --git a/source/_includes/links.md b/source/_includes/links.md index 74569e426..15c8e966c 100644 --- a/source/_includes/links.md +++ b/source/_includes/links.md @@ -5,6 +5,7 @@ [annex-cookbook]: {{ site.cookbook_url | absolute_url }}/ "IIIF Cookbook" [annex-json-ld]: {{ site.api_url | absolute_url }}/annex/notes/jsonld/ "JSON-LD Frames Implementation Notes" [annex-oa]: {{ site.api_url | absolute_url }}/annex/openannotation/ "Open Annotation Extensions" +[annex-wa]: {{ site.api_url | absolute_url }}/registry/webannotation/ "Open/Web Annotation Extensions" [annex-patterns]: {{ site.api_url | absolute_url }}/annex/notes/design_principles/ [annex-services]: {{ site.api_url | absolute_url }}/annex/services/ "Services Annex Document" [auth094]: {{ site.api_url | absolute_url }}/auth/0.9/ "Authentication API v0.9.4" @@ -14,7 +15,7 @@ [auth1]: {{ site.api_url | absolute_url }}/auth/1.0/ "IIIF Authentication API 1.0" [auth10]: {{ site.api_url | absolute_url }}/auth/1.0/ "IIIF Authentication API 1.0" [contentstate09]: {{ site.api_url | absolute_url }}/content-state/0.9/ -[contentstate-export]: {{ site.api_url | absolute_url }}/content-state/0.9/#export "3.7. Exporting Current Content State from Viewer" +[contentstate-export]: {{ site.api_url | absolute_url }}/content-state/0.9/#export "3.7. Exporting Current Content State from Viewer" [contentstate-http]: {{ site.api_url | absolute_url }}/content-state/0.9/#7-http-requests-and-responses "HTTP Request and Responses" [contentstate-initialization]: {{ site.api_url | absolute_url }}/content-state/0.9/#initialization "Initialization mechanisms (protocol)" [contentstate03]: {{ site.api_url | absolute_url }}/content-state/0.3/ "IIIF Content State API" diff --git a/source/annex/index.md b/source/annex/index.md index 5f9546523..57dd3bbe2 100644 --- a/source/annex/index.md +++ b/source/annex/index.md @@ -9,9 +9,7 @@ hero: ## API Annex Documents -- [Open Annotation ImageApiSelector]({{ site.api_url | absolute_url }}/annex/openannotation/) - [Description of REST usage with IIIF APIs]({{ site.api_url | absolute_url }}/annex/rest/) -- [Known External Services]({{ site.api_url | absolute_url }}/annex/services/) ## API Implementation Notes diff --git a/source/registry/index.md b/source/registry/index.md index 2f299bedf..c943553e9 100644 --- a/source/registry/index.md +++ b/source/registry/index.md @@ -17,6 +17,7 @@ The process for having an entry included in one of the IIIF extension registries * [Presentation API Extensions][extensions] * [Motivations][registry-motivations] * [Profiles][registry-profiles] +* [Open/Web Annotation Extensions][annex-wa] * [Services][registry-services] * [TimeModes][registry-timeModes] * [Types][registry-types] diff --git a/source/registry/services/index.md b/source/registry/services/index.md index e8f50b4e7..4f0bf54df 100644 --- a/source/registry/services/index.md +++ b/source/registry/services/index.md @@ -19,6 +19,12 @@ editors: - name: Simeon Warner ORCID: https://orcid.org/0000-0002-7970-7855 institution: Cornell University + - name: Dawn Childress + ORCID: https://orcid.org/0000-0003-2602-2788 + institution: UCLA + - name: Jeff Mixter + ORCID: https://orcid.org/0000-0002-8411-2952 + institution: OCLC Research --- ## Status of this Document @@ -56,13 +62,28 @@ The process for having a new entry added to this registry is [described here][re ## 3. Registry -This table summarizes the services available and which APIs they may be used in. The '![not allowed][icon-na]' icon means that the service is not to be used in the API. The '![recommended][icon-rec]' icon means that the service can be used in the API. +This table summarizes the services available and which APIs they may be used in. For the icons and their meanings, consult the [Summary of Property Requirements][prezi30-appendixa] icon table in the IIIF Presentation 3 API documentation. -| Service | Image API | Presentation API | -| ------------------------------ |:-------------------------:|:-------------------------:| -| [Image Information][image-api] | ![optional][icon-opt] | ![recommended][icon-rec] | +| Service | Image API | Presentation 2 API | Presentation 3 API | +| ------------------------------ |:-------------------------:|:-------------------------:|:-------------------------:| +| [Image Information][image-api] | ![optional][icon-opt] | ![recommended][icon-rec] | ![recommended][icon-rec] | +| [GeoJSON][lgeojson] | ![not allowed][icon3-na] | ![recommended][icon3-rec] | ![not allowed][icon3-na] | +| [Physical Dimensions][physdim] | ![recommended][icon3-rec] | ![recommended][icon3-rec] | ![recommended][icon3-rec] | {: .api-table} +The following names have been added as of version 3.0 of the Image and Presentation APIs in order to facilitate cross-version compatibility. These names are used in the `type` or `@type` field for the service. + +| Value | Specification | +| -------------------- | ------------- | +| ImageService1 | [Image API version 1][image11] | +| ImageService2 | [Image API version 2][image21] | +| SearchService1 | [Search API version 1][search1] | +| SearchService2 | In development | +| AutoCompleteService1 | [Search API version 1][search1-autocomplete] | +| AuthCookieService1 | [Authentication API version 1][auth1-cookie-service] | +| AuthTokenService1 | [Authentication API version 1][auth1-token-service] | +| AuthLogoutService1 | [Authentication API version 1][auth1-logout-service] | +{: .api-table #table-service-types} ### 3.1 Image Information _Added: 2014-05-20_ @@ -134,6 +155,91 @@ With the `logo` property added to the Image Information description in version 2 } ``` +### 3.2 GeoJSON +{: #geojson} +_Added: 2014-05-20_, _Latest Revision: 2022-02-01_ + +*Note: GeoJSON as a service is supported in the Presentation 2 API. For the Presentation 3 API, use the [navPlace extension][navPlace].* + +[GeoJSON][geojson] provides the ability to associate a geographical place with a resource, in order to drive a map-based user interface or visualization tool. This might be a location associated with the provenance of the object such as where it was created, or where it is currently held. The location might also be related to the content of the resource, such as a city mentioned in the text or the landmark depicted in a photograph. It is not appropriate to use this feature for tagging of time, people, events, and other semantic metadata outside of the scope of the Presentation API. + +The [JSON-LD representation][geojson-ld] of GeoJSON, with `@context` `http://geojson.org/geojson-ld/geojson-context.jsonld` _SHOULD_ be used. See the GeoJSON documentation for a full description of the functionality available. + +An external reference example for tagging a place, where the URI would return a GeoJSON description of the city of Paris, France: + +{% include api/code_header.html %} +``` json-doc +{ + "service": { + "@context" : "http://geojson.org/geojson-ld/geojson-context.jsonld", + "@id" : "http://www.example.org/geojson/paris.json" + } +} +``` + +Or embedding the content: + +{% include api/code_header.html %} +``` json-doc +{ + "service": { + "@context" : "http://geojson.org/geojson-ld/geojson-context.jsonld", + "@id" : "http://www.example.org/geojson/paris.json", + "type": "Feature", + "properties": {"name": "Paris"}, + "geometry": { + "type": "Point", + "coordinates" : [48.8567,2.3508] + } + } +} +``` +### 3.3 Physical Dimensions +{: #physical-dimensions} +_Added: 2014-05-20_, _Latest Revision: 2015-12-04_ + +For digitized objects, it is often useful to know the physical dimensions of the object. When available, they allow a client to present a ruler, or other rendition of physical scale, to the user. However, implementers are warned that while this information may be available, frequently: + + * It is not available at all. + * It is unreliable when it is recorded. + * It is different for every view of an object. + * When used with the Presentation API, the Canvas might not be sized to depict only the physical object, but might also include a ruler, color bar, the scanning bed or other background objects. In these cases, the Canvas height and width will not be representative of the main object. + +As the Presentation API already includes an aspect ratio for the Canvas, and the Image API includes the height and width of the Image, the physical dimensions service need only report two additional pieces of information: the scale factor to multiply the dimensions by to calculate the physical dimensions, and the units for those generated physical dimensions. It is _RECOMMENDED_ that the information always be embedded rather than requiring the client to retrieve it with an additional HTTP request, however some implementers _MAY WISH TO_ keep the information separate. + +When used with the Image API, it allows a client to calculate the pixels per inch (often abbreviated as PPI or DPI) of the image it is associated with. When used with the Presentation API, it gives the size of the object that the Canvas is a surrogate for. + +The physical dimensions description includes the following properties: + +| Property | Required? | Description | +| ---------------- | --------- | ----------- | +| `@context` | Required | The string "http://iiif.io/api/registry/services/physdim/1/context.json". | +| `@id` | Optional | A URI that will return the information, perhaps generated dynamically from the image. | +| `profile` | Required | The string "http://iiif.io/api/registry/services/physdim". | +| `physicalScale` | Required | The floating point ratio by which the digital resource's height and width are multiplied in order to determine the depicted scene's height and width. | +| `physicalUnits` | Required | The physical units for the generated height and width. Possible values are: "mm", "cm", in". | +{: .api-table} + +The following example demonstrates the resulting structure, as embedded within the [Presentation API][prezi-api] response: + +{% include api/code_header.html %} +``` json-doc +{ + "service": { + "@context": "http://iiif.io/api/registry/services/physdim/1/context.json", + "profile": "http://iiif.io/api/registry/services/physdim", + "physicalScale": 0.0025, + "physicalUnits": "in" + } +} +``` + +If the above example was associated with a Canvas of width 4000 and height 6000, then the physical object would be 4000 * 0.0025 = 10 inches wide, and 15 inches high. If it was associated with an image with width 4000 and height 6000, then it would mean the image was 4000 pixels for 10 inches, or 400 pixels per inch. + +__Note:__ +There is a proposal to add a confidence label or value to this service to allow clients to either determine if they should use the information, or to display an appropriate warning or description when using it. This proposal is currently deferred until additional experience and use cases have been explored. Any interest in this feature should be brought up on [iiif-discuss][iiif-discuss]. +{: .note} + ## Appendices ### A. Acknowledgements @@ -146,7 +252,16 @@ Thanks to the members of the [IIIF][iiif-community] for their continuous engagem | Date | Description | | ---------- | -------------------------------------------------- | +| 2022-02-01 | Migrate Physical Dimensions from Annex | +| 2022-02-01 | Migrate GeoJSON from Annex | | 2018-XX-YY | New Version 3 Registries | + {% include acronyms.md %} {% include links.md %} + + [geojson]: http://geojson.org/ "GeoJSON" + [geojson-ld]: http://geojson.org/geojson-ld/ "GeoJSON-LD" + [imageinfo]: #image-information + [lgeojson]: #geojson + [physdim]: #physical-dimensions diff --git a/source/registry/services/physdim/1/context.json b/source/registry/services/physdim/1/context.json new file mode 100644 index 000000000..7bfce0482 --- /dev/null +++ b/source/registry/services/physdim/1/context.json @@ -0,0 +1,16 @@ +--- +--- +{ + "@context": { + "iiif": "http://iiif.io/api/presentation/2#", + "xsd": "http://www.w3.org/2001/XMLSchema#", + "physicalScale": { + "@id": "iiif:physicalScale", + "@type": "xsd:float" + }, + "physicalUnits": { + "@id": "iiif:physicalUnits", + "@type": "xsd:string" + } + } +} diff --git a/source/registry/webannotation/context.json b/source/registry/webannotation/context.json new file mode 100644 index 000000000..6d439f05d --- /dev/null +++ b/source/registry/webannotation/context.json @@ -0,0 +1,26 @@ +{ + "@context": { + "iiif": "http://iiif.io/api/image/2#", + + "region": { + "@id": "iiif:regionValue", + "@type": "xsd:string" + }, + "size": { + "@id": "iiif:sizeValue", + "@type": "xsd:string" + }, + "rotation": { + "@id": "iiif:rotationValue", + "@type": "xsd:string" + }, + "format": { + "@id": "iiif:formatValue", + "@type": "xsd:string" + }, + "quality": { + "@id": "iiif:qualityValue", + "@type": "xsd:string" + } + } +} diff --git a/source/registry/webannotation/index.md b/source/registry/webannotation/index.md new file mode 100644 index 000000000..8ee537735 --- /dev/null +++ b/source/registry/webannotation/index.md @@ -0,0 +1,170 @@ +--- +title: "IIIF Open/Web Annotation Extensions" +title_override: "IIIF Open/Web Annotation Extensions" +layout: spec +editors: + - name: Michael Appleby + ORCID: https://orcid.org/0000-0002-1266-298X + institution: Yale University + - name: Tom Crane + ORCID: https://orcid.org/0000-0003-1881-243X + institution: Digirati + - name: Robert Sanderson + ORCID: https://orcid.org/0000-0003-4441-6852 + institution: J. Paul Getty Trust + - name: Jon Stroop + ORCID: https://orcid.org/0000-0002-0367-1243 + institution: Princeton University Library + - name: Simeon Warner + ORCID: https://orcid.org/0000-0002-7970-7855 + institution: Cornell University + - name: Dawn Childress + ORCID: https://orcid.org/0000-0003-2602-2788 + institution: UCLA + - name: Jeff Mixter + ORCID: https://orcid.org/0000-0002-8411-2952 + institution: OCLC Research +--- + +## Status of this Document +{:.no_toc} + +This document is not subject to [semantic versioning][notes-versioning]. +Changes will be tracked within the document. + +**Editors:** + +{% include api/editors.md editors=page.editors %} + +{% include copyright.md %} + +## Abstract +{:.no_toc} +This document describes extensions to the [Web Annotation][org-w3c-webanno] Data Model required within the IIIF context. + +Please send feedback to [iiif-discuss@googlegroups.com][iiif-discuss] + +{:.no_toc} + + +## 1. Introduction +{: #introduction} + +As with the detailed use of any general framework within another, there are some extensions necessary to make the best use of the [Web Annotation][org-w3c-webanno] model within the IIIF APIs. This document covers those extension points. It was previously applied to the predecessor of the Web Annotation model, called Open Annotation. The extensions defined can be used with either framework. + +## 2. Selectors +{: #selectors} + +Selectors in Annotations are used to describe how to retrieve a given part of a resource. They are then associated with an instance of `SpecificResource` that also references the resource of which the Specific Resource is part. + +### 2.1. IIIF Image API Selector +{: #iiif-image-api-selector} + +The Image API Selector is used to describe the operations available via the Image API in order to retrieve a particular image representation. In this case the resource is the abstract image as identified by the [IIIF Image API][image-api] base URI plus identifier, and the retrieval process involves adding the correct parameters after that base URI. For example, the top left hand quadrant of an image has the region parameter of `pct:0,0,50,50` which must be put into the requested URI to obtain the appropriate representation. + +In order to make this as easy as possible for the situations when a IIIF Image API endpoint exists, we introduce a new Selector class called `ImageApiSelector`. It has properties that give the parameter values needed to fill out the URL structure in the request. If the property is not given, then a default should be used. + +One use of this is within the [IIIF Presentation API][prezi-api], when a Canvas is being painted by part of an image, or an image that requires rotation before display. + +| Property | Default | Description | +| -------- | --------- | ----------------------------------------------------- | +| type | | Required. Must be the value "ImageApiSelector". | +| region | "full" | The string to put in the region parameter of the URI. | +| size | "full" | The string to put in the size parameter of the URI. | +| rotation | "0" | The string to put in the rotation parameter of the URI. Note that this must be a string in order to allow mirroring, for example "!90". | +| quality | "default" | The string to put in the quality parameter of the URI. | +| format | "jpg" | The string to put in the format parameter of the URI. Note that the '.' character is not part of the format, just the URI syntax. | +{: .api-table} + +For example, to rotate the top left hand 10% of the image clockwise by 90 degrees would use this configuration of the Selector: + +{% include api/code_header.html %} +``` json-doc +{ + "type" : "ImageApiSelector", + "region" : "pct:0,0,10,10", + "rotation" : "90" +} +``` + +And would result in this SpecificResource, when applied to an image service at `https://example.org/iiif/image1`: + +{% include api/code_header.html %} +``` json-doc +{ + "type": "SpecificResource", + "source": "https://example.org/iiif/image1", + "selector": { + "type": "ImageApiSelector", + "region": "pct:0,0,10,10", + "rotation": "90" + } +} +``` + +It can be used in the Presentation API as demonstrated in the IIIF Cookbook recipe [...]. + +### 2.2. Point Selector +{: #point-selector} + +There are common use cases in which a point, rather than a range or area, is the target of the Annotation. For example, putting a pin in a map should result in an exact point, not a very small rectangle. Points in time are not very short durations, and user interfaces should also treat these differently. This is particularly important when zooming in (either spatially or temporally) beyond the scale of the frame of reference. Even if the point takes up a 10 by 10 pixel square at the user's current resolution, it is not a rectangle bounding an area. + +It is not possible to select a point using URI Fragments with the Media Fragment specification, as zero-sized fragments are not allowed. In order to fulfill the use cases, this specification defines a new Selector class called `PointSelector`. + +| Property | Description | +| -------- | ----------------------------------------------------- | +| type | Required. Must be the value "PointSelector". | +| x | Optional. An integer giving the x coordinate of the point, relative to the dimensions of the target resource. | +| y | Optional. An integer giving the y coordinate of the point, relative to the dimensions of the target resource. | +| t | Optional. A floating point number giving the time of the point in seconds, relative to the duration of the target resource. | +{: .api-table} + +For example, to select a point in a video that is 10 pixels in from the top left hand corner of the visual content, and 14.5 seconds into the duration: + +{% include api/code_header.html %} +``` json-doc +{ + "type": "PointSelector", + "x": 10, + "y": 10, + "t": 14.5 +} +``` + +### 2.3. Content Selectors +{: #content-selectors} + +Video content resources consist of both visual and audio content within the same bit-level representation. There are situations when it is useful to refer to only one aspect of the content -- either the visual or the audio, but not both. For example, an Annotation might associate only the visual content of a video that has spoken English in the audio, and an audio file that has the translation of that content in Spanish. + +This specification defines two Selectors, `AudioContentSelector` that selects the audio content and a second `VisualContentSelector` for the visual content. Neither selector has any additional properties. + +{% include api/code_header.html %} +``` json-doc +{ "type": "AudioContentSelector" } +``` + +{% include api/code_header.html %} +``` json-doc +{ "type": "VisualContentSelector" } +``` + +## Appendices + +### A. Acknowledgements + +The production of this document was generously supported by a grant from the [Andrew W. Mellon Foundation][org-mellon]. + +Thanks to the members of the [IIIF][iiif-community] for their continuous engagement, innovative ideas and feedback. + +### B. Change Log + +| Date | Description | +| ---------- | -------------------------------------------------- | +| 2022-02-04 | Version 1.2 (Style edits, migrate from Annex, update context) | +| 2018-03-14 | Version 1.1 (Update ImageApi, add Point Selectors) | +| 2014-07-01 | Version 1.0 (RFC) | +{:.api-table} + +[prezi-rot]: {{ site.api_url | absolute_url }}/presentation/2.0/#rotation "Rotation in Presentation API" +{% include acronyms.md %} +{% include links.md %}