w3c / wpub-ann

Web Annotation Extensions for Web Publications
https://w3c.github.io/wpub-ann/
Other
6 stars 10 forks source link

Use case for a component appearing in multiple locations? #12

Open iherman opened 6 years ago

iherman commented 6 years ago

(This is a transcription of a comment from @tcole3 to be sure not to loose it when the corresponding PR is closed.)

Are there any real-world use cases where a component (with its own URL) of a Web Publication is likely to appear (be embedded) in multiple locations within the Web Publication? If so, do any of these use cases require the ability to reference a particular occurrence of the component within the Web Publication? Originally I had thought we might be able to avoid need for ERS through the use of scope, but if we really need to define an ERS anyway, we want to make sure it sufficient to meet as many realistic use cases as possible.

RachelComerford commented 6 years ago

In education this would likely occur. A chart, graph, table, list, etc explained in the narrative will be reused in end of chapter material and appendices for review or assessment purposes. If that element is also referenced as study material in an activity or assessment then the link would mostly need to be to the element in context (so, in the narrative).

iherman commented 6 years ago

@tcole3 wouldn't the scope account for this use case, too? Ie, the scope may not be only used for the identification of the WP as a whole, but also to identify resource A that includes (eg, in an iframe), resource B: resource B is the source and resource A is the scope...

tcole3 commented 6 years ago

Yes, although there would be some limitations if the chart, table, list, etc. is embedded multiple times in the same chapter.

Assume myChart.html is meant to be embedded once each in chapters 1, 3 and Appendix A of WebPub1 and I wanted to link to its occurrence in chapter 3 only. I might use a locator such as this:

{
    "source": "http://example.org/WebPub1/files/myChart.html",
        "scope":  "http://example.org/WebPub1/files/chap3.html"
}

I could go further and select a text phrase from within the chart, such as, "the rain in Spain":

{
    "source": "http://example.org/WebPub1/files/myChart.html",
        "scope":  "http://example.org/WebPub1/files/chap3.html",
    "selector": {
        "type": "TextQuoteSelector",
        "exact": "the rain in Spain"
    }
}

The issue comes if myChart.html is meant to embedded more than once within Chapter 3. The above locators would not distinguish and the User Agent behavior would be somewhat unpredictable - just as it is with a TextQuoteSelector if the phrase "the rain in Spain" appears multiple times. We probably ought to include text that user agents SHOULD assume all matches in within the scope are meant (this is what we say for TextQuoteSelector).

An additional ambiguity might creep in if you want to rely on scope to simultaneously link to the Web Publication itself as an additional context for the locator, thus:

{
    "source": "http://example.org/WebPub1/files/myChart.html",
        "scope": [
               "http://example.org/WebPub1/files/chap3.html",
               "http://example.org/WebPub1/InfoSet"
        ],
    "selector": {
        "type": "TextQuoteSelector",
        "exact": "the rain in Spain"
    }
}

I think this describes the text snippet in myChart.html as embedded in chap3.html which is a component of WebPub1, and I can make a case for this interpretation by assuming Boolean AND'ing of scopes when multiple are provided, but the Web Annotation model, while allowing multiple scopes, doesn't give guidance on how to interpret. Should we?

iherman commented 6 years ago

In general, I can indeed see that the specification has to be described with a bit more attention on corner cases like the one you refer on multiple texts (the same is true, for example, for CssSelector). Making it clear that what we select MAY be multiple points in the document is important. (Which, as an aside, makes it more tangible to talk about MultipleSelector instead of MutipleResourceSelector...).

I am a bit more concerned about the additional feature of allowing several URL-s for a scope. Any new feature creep is frightening, and should be backed up by serious use cases (which we do not have...)

tcole3 commented 6 years ago

So the language in the Web Anno Data Model is "There may be 0 or more scope relationships for each Specific Resource."

I don't remember the use case for allowing multiple scopes and I'm not finding language elsewhere in the model document. @azaroth42, do you recall?

Anyway, for the current document we may want to address this issue since otherwise I think it's ambiguous as noted in the example above. Unless there is more in the Web Anno specs I missed about how to understand multiple scopes.

iherman commented 6 years ago

Ah, I did not remember we could have more than one scope. Forget about my comment then.

Like you, I suppose those are AND-s. That make sense, I am not sure what an OR would mean...

tcole3 commented 6 years ago

Yes, my vague recollection is that if you provide a list of scopes (rather than just one), then each individually provides scope (i.e., context) for the source. I don't think other interpretations make any sense - e.g., that the scope resources collectively (rather than individually) provide context, or that at least one (but not necessarily all) of the scope resources provide context. But again my recollection is vague. If we need to discuss further we should open as a separate issue. If we are satisfied that we have correct understanding, do we want to add a Note? e.g.,:

Note When describing a locator, if multiple resources are provided for the scope key, user agents SHOULD assume that each scope resource provides context for the source

/cc: @azaroth42 /cc @BigBlueHat