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

Link annotation to Manifest it comes from (within in IIIF 2) #20

Closed
glenrobson opened this issue Jul 23, 2020 · 12 comments · Fixed by #28
Closed

Link annotation to Manifest it comes from (within in IIIF 2) #20

glenrobson opened this issue Jul 23, 2020 · 12 comments · Fixed by #28

Comments

@glenrobson
Copy link

glenrobson commented Jul 23, 2020

Is there a way to add a link to the Manifest where the canvas that is being annotated lives? Canvas Ids are often not resolvable so to find the image you are annotating you need access to the Manifest. In Mirador2 this was handled here:

https://github.com/ProjectMirador/mirador/blob/32e6bd5897e36611afbf0a8986051eaecac15011/js/src/annotations/mirador21Strategy.js#L39

and here:

https://github.com/ProjectMirador/mirador/blob/32e6bd5897e36611afbf0a8986051eaecac15011/js/src/annotations/miradorDualStrategy.js#L54

but this doesn't seem possible in this plugin as you only have access to the canvas id. For the SimpleAnnotationServer ideally I would like access to the manifest ID and label. The label is for this issue:

glenrobson/SimpleAnnotationServer#64

@glenrobson
Copy link
Author

I think this would be partof in IIIF version 3.0:

https://iiif.io/api/presentation/3.0/#partof

@mejackreed
Copy link
Contributor

@glenrobson would this need to be part of the annotationPage? https://www.w3.org/TR/annotation-model/#h-annotation-page

Or would we want to just use this to interact w/ SAS rather than part of the WebAnnotation

@glenrobson
Copy link
Author

glenrobson commented Jul 23, 2020

I don't think it would do any harm to be in an annotationPage but it is SAS specific so fine if its available in the adapter and not part of WebAnnotation. I believe an annotationPage can contain annotations from multiple canvases and manifests so in some ways having it would be useful but generally when you are working with annotationPages you start from the manifest so don't need to go the other way.

I think the annotation with the link to the manifest would look like:

{
  "@context": [
    "http://www.w3.org/ns/anno.jsonld",
    "http://iiif.io/api/presentation/3/context.json"
  ],
  "id": "http://example.org/anno1",
  "type": "Annotation",
  "motivation": "supplementing", 
  "body": {
        language: 'en',
        type: 'TextualBody',
        value: "annotation",
  },
  "target": {
    "type": "SpecificResource",
    "source": {
          "id": "http://example.org/manifest/1/canvas/1",
          "type": "Canvas",
          "label": { "en": [ "Page 1" ] } },
          "partOf": [
             {
                   "id": ""http://example.org/manifest/1.json",
                   "type": "Manifest",
                   "label": { "en": [ "Manifest title" ] } }
             }
          ]
    }
    "selector": {
       "type": "FragmentSelector",
       "conformsTo": "http://www.w3.org/TR/media-frags/",
       "value": "xywh=10,10,100,100"
     }
  }
}

I think because I'm asserting the target is a canvas it would need the selector and source to say which part of the canvas the annotation is relevant to. This is looking pretty SAS specific.... although it would mean a very similar looking annotation for an SVG annotation as a rectangle annotation.

@glenrobson
Copy link
Author

@robcast
Copy link
Contributor

robcast commented Jul 24, 2020

I like the idea of having the reference to the containing manifest for all annotations.

It makes the target slightly more complex but targets have to be more complex anyway...

@mejackreed
Copy link
Contributor

@glenrobson have you seen any examples with multiple selectors?

@glenrobson
Copy link
Author

glenrobson commented Jul 24, 2020

I haven't seen one no. I think reading the spec if would look like this (assuming your thinking of the SVG one):

{
  "@context": [
    "http://www.w3.org/ns/anno.jsonld",
    "http://iiif.io/api/presentation/3/context.json"
  ],
  "id": "http://example.org/anno1",
  "type": "Annotation",
  "motivation": "supplementing", 
  "body": {
        language: 'en',
        type: 'TextualBody',
        value: "annotation",
  },
  "target": {
    "type": "SpecificResource",
    "source": {
          "id": "http://example.org/manifest/1/canvas/1",
          "type": "Canvas",
          "label": { "en": [ "Page 1" ] } },
          "partOf": [
             {
                   "id": ""http://example.org/manifest/1.json",
                   "type": "Manifest",
                   "label": { "en": [ "Manifest title" ] } }
             }
          ]
    }
    "selector": [{
       "type": "FragmentSelector",
       "conformsTo": "http://www.w3.org/TR/media-frags/",
       "value": "xywh=10,10,100,100"
     },
     {
        "type": "SvgSelector",
        "value": "<svg:svg> ... </svg:svg>"
     }]
  }
}

In the W3C annotation model: https://www.w3.org/TR/annotation-model/ it says:

"There MAY be 0 or more selector relationships associated with a Specific Resource. Multiple Selectors SHOULD select the same content, however some Selectors will not have the same precision as others. Consuming user agents MUST pick one of the described segments, if they are different. "

And looking into the historical discussion it looks like it was meant for our use case: w3c/web-annotation#207

@robcast
Copy link
Contributor

robcast commented Jul 24, 2020

I created #21 for the alternate selectors issue.

@robcast
Copy link
Contributor

robcast commented Jul 29, 2020

@glenrobson I just looked at the WebAnno spec and I found partOf only on the AnnotationPage

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

Should we limit it to AnnotationPage? I agree that according to the spec an AnnotationPage can contain annotations on multiple targets but I think that in the IIIF annotation case we would only have annotations on one canvas.

Would the resource scope be a solution for the single annotation?

https://www.w3.org/TR/annotation-model/#scope-of-a-resource

{
  "@context": [
    "http://www.w3.org/ns/anno.jsonld",
    "http://iiif.io/api/presentation/3/context.json"
  ],
  "id": "http://example.org/anno1",
  "type": "Annotation",
  "motivation": "supplementing", 
  "body": {
        language: 'en',
        type: 'TextualBody',
        value: "annotation",
  },
  "target": {
    "type": "SpecificResource",
    "source": {
          "id": "http://example.org/manifest/1/canvas/1",
          "type": "Canvas",
          "label": { "en": [ "Page 1" ] } },
          "scope":  {
                   "id": ""http://example.org/manifest/1.json",
                   "type": "Manifest",
                   "label": { "en": [ "Manifest title" ] } }
             }
    }
    "selector": {
       "type": "FragmentSelector",
       "conformsTo": "http://www.w3.org/TR/media-frags/",
       "value": "xywh=10,10,100,100"
     }
  }
}

(The spec seems a bit vague if the "Relation" can be extended to an object)

@glenrobson
Copy link
Author

glenrobson commented Jul 29, 2020

Because the partof is in the canvas I think it falls into the IIIF spec rather than the annotation spec. It says here:

https://iiif.io/api/presentation/3.0/#partof

that canvases can point to the manifest they are part of. So I think my example above is OK. As Rob mentions in slack the source can be any resource and in this case we are asserting its a canvas (hence the iiif context at the start of the annotation) and as a canvas type is defined by IIIF we can follow those rules.

Does that answer your concern?

@robcast
Copy link
Contributor

robcast commented Jul 30, 2020

@glenrobson treating the source as a canvas makes sense, thanks for explaining!

I just wanted to make sure that our data is as correct as possible when it is set in stone, or, code that's going to be used a lot :-)

@robcast
Copy link
Contributor

robcast commented Jul 30, 2020

I started to implement loading the information in the SAS adapter but then I wasn't sure: do we really want to load and keep the partOf information or do we just generate the partOf based on the information in Mirador?

Is there a case where Mirador loads an annotation but it does not know its manifest?

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

Successfully merging a pull request may close this issue.

3 participants