Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Selectors section to Registry; move/update imageAPISelector context #2231

Merged
merged 24 commits into from
Mar 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
a70ee34
add Selectors to reg; mv/update imageAPISelector
kirschbombe Apr 25, 2023
4659309
update links.md
kirschbombe Apr 25, 2023
ad3ff81
update size default to max
kirschbombe Apr 25, 2023
9dc42d2
add imageapiselector context link
kirschbombe Apr 25, 2023
db072bb
add backticks for table values
kirschbombe Apr 27, 2023
77487c4
update context to incl all selectors
kirschbombe Apr 27, 2023
33f2583
update selector context links
kirschbombe Apr 27, 2023
7b2dabc
add backticks to ImageApiSelector table
kirschbombe Apr 27, 2023
ce579fe
mv prezi-rot to links.md; add link to prezi3
kirschbombe Apr 27, 2023
31b8122
update image context uri in selectors context.json
kirschbombe May 9, 2023
63a6819
add note about ImageApiSelector defulat values
kirschbombe May 9, 2023
b803159
update selectors context
kirschbombe May 9, 2023
adbdd8f
rm image context from top level
kirschbombe May 9, 2023
4bbdf51
update iiif_selectors uri
kirschbombe May 9, 2023
a584483
update selectors context url
kirschbombe May 9, 2023
28deacd
mv image context uri down a level
kirschbombe May 11, 2023
404e9f6
rmv dup link
kirschbombe May 12, 2023
ca19ec1
define iiif_selectors context in presi 3 context
kirschbombe Aug 4, 2023
9d16509
add selectors to presi3 context
kirschbombe Sep 6, 2023
09bd3df
simplify selector context
kirschbombe Sep 26, 2023
d7ad1fb
update selectors changelog
kirschbombe Sep 26, 2023
0ca3e3b
add oa context to selector (for FragmentSelector)
kirschbombe Sep 29, 2023
a5c0e35
update link to selectors registry
kirschbombe Sep 29, 2023
eccefcb
add web anno selectors info to Selectors registry
kirschbombe Sep 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions source/_includes/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
[org-w3c-webanno]: http://w3.org/TR/annotation-model/ "Web Annotation Model"
[org-w3c-webanno-motivation]: https://www.w3.org/TR/annotation-model/#motivation-and-purpose "Web Annotation Model - Motivation"
[org-w3c-webanno-TextQuoteSelector]: https://www.w3.org/TR/annotation-model/#text-quote-selector "Web Annotation Model - Text Quote Selector"
[org-w3c-webanno-Selectors]: https://www.w3.org/TR/annotation-model/#selectors "Web Annotation model - Selectors"
[org-w3c-webarch]: http://www.w3.org/TR/webarch/ "Architecture of the World Wide Web"
[org-w3c-xsd-datetime]: https://www.w3.org/TR/xmlschema11-2/#dateTime "XSD DateTime"
[org-wsgi-pep333]: https://www.python.org/dev/peps/pep-0333/ "PEP 0333"
Expand All @@ -213,6 +214,7 @@
[prezi21-change-log]: {{ site.api_url | absolute_url }}/presentation/2.1/change-log/ "Presentation API 2.1 Change Log"
[prezi211-change-log]: {{ site.api_url | absolute_url }}/presentation/2.1/change-log-211/ "Presentation API 2.1.1 Change Log"
[prezi21]: {{ site.api_url | absolute_url }}/presentation/2.1/ "IIIF Presentation API 2.1"
[prezi21-rot]: {{ site.api_url | absolute_url }}/presentation/2.0/#rotation "Rotation in Presentation API"
[prezi3-considerations]: {{ site.api_url | absolute_url }}/presentation/3.{{ site.data.apis.presentation.latest.minor }}/#4-json-ld-considerations "Presentation API Section 4"
[prezi3-html]: {{ site.api_url | absolute_url }}/presentation/3.{{ site.data.apis.presentation.latest.minor }}/#45-html-markup-in-property-values "Presentation API Section 4.4"
[prezi3-languages]: {{ site.api_url | absolute_url }}/presentation/{{site.data.apis.presentation.latest.major}}.{{ site.data.apis.presentation.latest.minor }}/#language-of-property-values "Language of Property Values"
Expand Down Expand Up @@ -253,6 +255,7 @@
[registry-motivations]: {{ site.api_url | absolute_url }}/registry/motivations/
[registry-behaviors]: {{ site.api_url | absolute_url }}/registry/behaviors/
[registry-process]: {{ site.api_url | absolute_url }}/registry/process/
[registry-selectors]: {{ site.api_url | absolute_url }}/registry/selectors/
[registry-services]: {{ site.api_url | absolute_url }}/registry/services/
[registry-profiles]: {{ site.api_url | absolute_url }}/registry/profiles/
[registry-timeModes]: {{ site.api_url | absolute_url }}/registry/timeModes/
Expand Down
2 changes: 1 addition & 1 deletion source/presentation/3.0/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -1667,7 +1667,7 @@ Note that the Web Annotation data model defines different patterns for the `valu

Additional features of the Web Annotation data model _MAY_ also be used, such as selecting a segment of the Canvas or content resource, or embedding the comment or transcription within the Annotation. The use of these advanced features sometimes results in situations where the `target` is not a content resource, but instead a SpecificResource, a Choice, or other non-content object. Implementations should check the `type` of the resource and not assume that it is always content to be rendered.

The IIIF community has defined [additional Selector classes][annex-oa] for use with SpecificResources, especially for cases when it is not possible to use the official FragmentSelector. See the additional documentation for details.
The IIIF community has defined [additional Selector classes][registry-selectors] for use with SpecificResources, especially for cases when it is not possible to use the official FragmentSelector. See the additional documentation for details.

{% include api/code_header.html %}
``` json-doc
Expand Down
10 changes: 10 additions & 0 deletions source/presentation/3/context.json
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,16 @@
"@container": "@set"
},

"selector":{
"@type":"@id",
"@id":"oa:selector",
"@container" : "@set",
"@context":[
"https://iiif.io/api/registry/selectors/context.json",
"http://www.w3.org/ns/anno.jsonld"
]
},

"start": {
"@type": "@id",
"@id": "iiif_prezi:start"
Expand Down
1 change: 1 addition & 0 deletions source/registry/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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]
* [Selectors][registry-selectors]
* [Services][registry-services]
* [TimeModes][registry-timeModes]
* [Types][registry-types]
Expand Down
2 changes: 1 addition & 1 deletion source/registry/motivations/index.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: Registry of Motivations
layout: spec
tags: [annex, service, services, specifications]
tags: [registry, motivations, specifications]
cssversion: 2
editors:
- name: Michael Appleby
Expand Down
60 changes: 60 additions & 0 deletions source/registry/selectors/context.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"@context": {
"@version":1.1,
"iiif_selectors": "http://iiif.io/api/registry/selectors#",
"xsd": "http://www.w3.org/2001/XMLSchema#",


"ImageApiSelector": {
"@id": "iiif_selectors:ImageApiSelector",
"@context": [
{
"iiif_image": "http://iiif.io/api/image/#",
"region": {
"@id": "iiif_image:regionValue",
"@type": "xsd:string"
},
"size": {
"@id": "iiif_image:sizeValue",
"@type": "xsd:string"
},
"rotation": {
"@id": "iiif_image:rotationValue",
"@type": "xsd:string"
},
"format": {
"@id": "iiif_image:formatValue",
"@type": "xsd:string"
},
"quality": {
"@id": "iiif_image:qualityValue",
"@type": "xsd:string"
}
}
]
},

"PointSelector": {
"@id": "iiif_selectors:PointSelector",
"@context":
{
"x": {
"@id": "iiif_selectors:xValue",
"@type": "xsd:integer"
},
"y": {
"@id": "iiif_selectors:yValue",
"@type": "xsd:integer"
},
"t": {
"@id": "iiif_selectors:tValue",
"@type": "xsd:float"
}
}
},


"AudioContentSelector": "iiif_selectors:AudioContentSelector",
"VisualContentSelector": "iiif_selectors:VisualContentSelector"
}
}
163 changes: 163 additions & 0 deletions source/registry/selectors/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,163 @@
---
title: "Registry of Selectors"
tags: [registry, selectors, specifications]
layout: spec
cssversion: 2
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: 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 %}


## 1. Introduction
{: #introduction}

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.

The Selectors described here extend the use of the [Web Annotation][org-w3c-webanno] model within the IIIF APIs, and were previously applied to the predecessor of the Web Annotation model, Open Annotation. These Selectors can be used with either annotation model.

IIIF also supports the use of Web Annotation model Selectors, such as `FragmentSelector`. For more information on these Selectors, see the [IIIF Presentation API][prezi-api] and the [Web Annotation Selectors documentation][org-w3c-webanno-Selectors].

## 2. Selector Classes

### 2.1 IIIF Image API Selector
{: #iiif-image-api-selector}

The [Image API Selector][registry-selectors] 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 | `max` | 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 section on [Rotation (Presentation 2.1)][prezi21-rot]. For more information on using Selectors in IIIF, see the current [Presentation API 3 specification][prezi-api].

*Note: The default values in the table above follow the IIIF Image API 3. For default values in previous Image API versions, you will need to consult the corresponding documentation.*

### 2.2 Point Selectors
{: #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 |
| ---------- | -------------------------------------------------- |
| 2023-09-26 | Version 1.2 (Change document to Registry of Selectors from Open/Web Annotation Extensions)
| 2018-03-14 | Version 1.1 (Update ImageApi, add Point Selectors) |
| 2014-07-01 | Version 1.0 (RFC) |
{:.api-table}

{% include acronyms.md %}
{% include links.md %}