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

RangeSelector #172

Open
glenrobson opened this issue Nov 4, 2024 · 6 comments
Open

RangeSelector #172

glenrobson opened this issue Nov 4, 2024 · 6 comments

Comments

@glenrobson
Copy link
Member

Current this manifest is failing validation. It has the following annotation structure:

    "target": {
        "source": {
            "id": ["https://tanyaclement.github.io/znh-1939/field_recordings_t86_243/canvas-2/canvas"](https://tanyaclement.github.io/znh-1939/field_recordings_t86_243/canvas-2/canvas),
            "type": "Canvas",
            "partOf": [{
                "id": ["https://tanyaclement.github.io/znh-1939/manifests.json"](https://tanyaclement.github.io/znh-1939/manifests.json),
                "type": "Manifest"
             }]
        },
        "selector": {
            "type": "RangeSelector",
            "t": "52,60"
        }
    }

Range selector defined in W3C:

https://www.w3.org/TR/annotation-model/#range-selector

Is t valid here? The W3C says that it needs to have a startSelector and endSelector. Should it use a fragement selector? or a PointSelector?

@saracarl
Copy link

saracarl commented Dec 6, 2024

@azaroth42 Could you weigh in here? What is the right way for an annotation to target a time range on a canvas containing time based media like an audio or video file?

I think the above example was probably derived (or copied from elsewhere?), likely incorrectly, from the PointSelector format:

"selector": {
            "type": "RangeSelector",
            "t": "52,60"
        }

@glenrobson's point is that the W3C Annotation model says a RangeSelector needs a startSelector and an endSelector:

"selector": {
      "type": "RangeSelector",
      "startSelector": {
        "type": "XPathSelector",
        "value": "//table[1]/tr[1]/td[2]"
      },
      "endSelector": {
        "type": "XPathSelector",
        "value": "//table[1]/tr[1]/td[4]"
      }
    }

Then the question is "what is the type and value; the obvious type is a MediaFragment, but that has 2 problems:
a) A MediaFragment (i.e. t=52,60) has a start and stop built into it, so the data doesn't match the startSelector and endSelector model from the Annotations model. (It's not a PointSelector.)
b) I don't think IIIF manifests should be targeting the media file itself, which MediaFragment seems to imply. We should be targeting a range of the canvas. In other words, what do we tack the t=52,60 onto? Perhaps the canvas? https://tanyaclement.github.io/znh-1939/field_recordings_t86_243/canvas-2/canvas#t=52,60

@kirschbombe
Copy link

@saracarl - I'm no Rob, but I think you would want to target the canvas and not the media file, just like you have in the last example. I thought we might have an example in the cookbook, but didn't see one at first glance. .../canvas#t=52,60 should validate, although may not work in current viewers (maybe Theseus?).

@azaroth42
Copy link
Member

Yes, RangeSelector is for designating a start and end point, and then the selection is between those two points. When you have a fragment like t=52,60 you can just use the regular FragmentSelector :)

Also, yes, given that it's a media fragment, you could simplify even further as Dawn says by just putting it on the end of the canvas URI.

@saracarl
Copy link

saracarl commented Dec 9, 2024

Thanks, @kirschbombe! Would you try to fit that media fragment selector into a RangeSelector standard that would (theoretically, if not yet practically) pass validation? Their are two sticking points -- how to use the MediaFragment, but also that, as @glenrobson points out:

W3C says that it needs to have a startSelector and endSelector

I'm pushing on this right now because AVAnnotate has some leverage to get the Aviary player and the RAMP player to support "whatever we decide is right", but "right" is hard to figure out. (and Theseus, what's that?!)

@glenrobson
Copy link
Member Author

glenrobson commented Dec 9, 2024

Do you still need to use the RangeSelector? Couldn't you do:

 "target": "https://tanyaclement.github.io/znh-1939/field_recordings_t86_243/canvas-2/canvas#t=52,60"

or if you wanted to keep a link to the manifest:

"target": {
    "type": "SpecificResource",
    "source": {
            "id": "https://tanyaclement.github.io/znh-1939/field_recordings_t86_243/canvas-2/canvas",
            "type": "Canvas",
            "partOf": [{
                "id": "https://tanyaclement.github.io/znh-1939/manifests.json",
                "type": "Manifest"
             }]
        },
    "selector": {
      "type": "FragmentSelector",
      "conformsTo": "http://www.w3.org/TR/media-frags/",
      "value": "t=52,60"
    }
  },

Similar to this recipe: https://iiif.io/api/cookbook/recipe/0306-linking-annotations-to-manifests/

@saracarl
Copy link

saracarl commented Dec 9, 2024

OK. That makes sense to me.

It took me forever to find this in the spec, as it's in the middle of the canvas section rather than the annotation section. I'm copying it here for reference.

Parts of Canvases may be described using a Specific Resource with a Selector, following the patterns defined in the Web Annotation data model. The use of the FragmentSelector class is recommended by that specification, as it allows for refinement by other Selectors and for consistency with use cases that cannot be represented using a URI fragment directly. Parts of Canvases can be referenced from Ranges, as the body or target of Annotations, or in the start property.

Parts of Canvases may also be identified by appending a fragment to the Canvas’s URI, and these parts are still considered to be Canvases: their type value is the string Canvas. Rectangular spatial parts of Canvases may also be described by appending an xywh= fragment to the end of the Canvas’s URI. Similarly, temporal parts of Canvases may be described by appending a t= fragment to the end of the Canvas’s URI. Spatial and temporal fragments may be combined, using an & character between them, and the temporal dimension should come first. It is an error to select a region using a dimension that is not defined by the Canvas, such as a temporal region of a Canvas that only has height and width dimensions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants