-
-
Notifications
You must be signed in to change notification settings - Fork 43
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
Resource ID/source #8
Comments
My (naive) understanding is that the FWIW: Annotorious automatically sets the |
Your assumption on However, the selectors RecogitoJS uses don't allow to uniquely identify the selection within the DOM of the resource, since—to my understanding—the selectors specify text ranges relatively to the container DOM node that has been supplied to RecogitoJS. With the above technique on using refined selections, we could identify that container node—either...
|
Both solutions look good, and I think you could just automatically pick one, depending on whether the annotated DOM node has an id or not. What worries me a bit that this will break compatibility with the current implementation, since we now would have a Fragmen-/XPathSelector refined by TextQuote and OffsetSelectors, rather than the TextQuote-/OffsetSelector directly. Nothing that couldn't be handled with a few basic ifs, of course. But not a one-liner either. Another question is whether Recogito should the verify the validity of the XPath/Fragment-info... (which I think would be pointless since it's up to the implementer to init RecogitoJS on the right DOM node, anyway?) |
PS: if you want to give this a try, the code that generates targets from a user selection is here: https://github.com/recogito/recogito-client-core/blob/master/src/selection/SelectionUtils.js#L40 The code that renders annotations from their WebAnno form is, essentially, here: https://github.com/recogito/recogito-client-core/blob/master/src/highlighter/Highlighter.js#L44 However this would need some revising since that line relies on built-in helper functions (.start, .end) that are part of the WebAnnotation class. But these should rather be in some external helper function (perhaps part of Highlighter), in order to keep WebAnnotation clean. |
Thanks for the input! On the question of validating XPath/fragment selectors: I'm also unsure about this. On the one hand, RecogitoJS is a general-purpose annotation library, on the other it adheres to the Web Annotation spec which asks for unique identification. Maybe we could realize a trade-off between both by either strictly requiring an ID attribute on the container or alternatively issueing a Either way, |
After giving this issue some further thought, I suspect that resource ID validation doesn't need to be part of RecogitoJS itself after all. My main concerns:
With that in mind, I'm happy to solve the resource ID issue outside of RecogitoJS, e.g. with the web annotation adapter. While the Web Annotation data model specification demands a resource ID, its necessity depends on the demand for interoperability of the given platform (as mentioned above with Firebase). @rsimon If you agree, feel free to close this issue! |
Thanks for the update! I agree that enforcing the standard might be beyond the job of RecogitoJS. However, I still think you're absolutely right on the issue of the (refined) FragmentSelector vs. the current situation, which uses only the TextOffset selector. Therefore I'm in favor of keeping the issue open. (I've been focusing predominantly on Annotorious recently, so the work on RecogitoJS has slowed down a bit. But it will get picked up again eventually ;-) |
Hi! As far as I know, RecogitoJS currently does not support specifying and identifier for the annotated resource. While trying to integrate a general purpose annotation server with RecogitoJS, these identifiers become crucial for filtering annotations from a LDP annotation container.
The Web Annotation Data Model specification states in regard to target selector sources:
So, to be compliant with the WADM, RecogitoJS should possibly adhere to that requirement and add a
source
field to thetarget
object. However, I imagine it being difficult to realise it with the current API design, as RecogitoJS selects only a DOM fragment.For now, it should suffice to provide the target source externally from RecogitoJS (e.g., during the
createAnnotation
event). I can however imagine a versatile text referencing mechanism being built into RecogitoJS: One that can annotate textual parts of a HTML document, but reference the annotation selection globally within the document IRI.Maybe the following best practices report can be of help. I'd be happy to give this some further thought! https://www.w3.org/TR/fragid-best-practices/
P.S.: I just stumbled upon §4.2.9 "Refinement of Selection", which relates to the above issue. Multiple selectors can be combined to refine the selection: https://www.w3.org/TR/annotation-model/#refinement-of-selection
The text was updated successfully, but these errors were encountered: