[annotator-dev] Annotations without

Riccardo Tasso riccardo.tasso at gmail.com
Wed Nov 13 23:14:21 UTC 2013


Hi Randall,
   the main design choice of our software was to have a text stored in our
own backend as an array of characters. Over that text we store annotations
of different kind: a chapter is a kind of annotation, a page is another
kind. The user annotation (note) is another kind of annotation.

The big difference from the annotator use case is that we can ignore the
HTML structure, since the annotation is over a given text, not over a given
HTML document. The advantage should be that if I change the HTML strutcure
of my pages my annotations remain valid.

The main page of my frontend should show the list of all annotations of
kind "chapter", obtained from a backend call which doesn't return any
detail of chapters, but only their title, their begin and end offsett
(relative to the whole text). At this point no annotation can be inserted
by current user.

The user can choose an arbitrary chapter and, clicking on it, the frontend
should call the backend obtaining:

   - the chapter' text
   - the chapter attributes
   - the user annotations over that chapter

>From now on the user can add its own user annotations.

You're right, storing a new annotation won't be a problem.

I'll have to use some trick reading annotations from my backend. It is
possible to assign a unique URL to each chapter, using parameters:
chaptersList?begin=0&end=1000 for chapter 1,
chaptersList?begin=1000&end=2000 for chapter 2, ...

Can I follow these steps?

   1. query the backend for chapter details (with its annotations in our
   own format)
   2. initialize the annotator only for the div containing the text of
   current chapter
   3. transform the annotation provided by the backend in the format
   required by annotator
   4. pass the annotations to annotator

Thank you,
   Riccardo


2013/11/13 Randall Leeds <tilgovi at hypothes.is>

> On Tue, Nov 12, 2013 at 2:16 PM, Riccardo Tasso <riccardo.tasso at gmail.com>wrote:
>
>>
>> The data-begin and data-end attributes for each div represent the "real"
>> offsets of each chapter of my text.
>>
>> My first question is about inserting a new annotation: how can I use
>> annotator to send to my backend the annotation with the "real" offsets? For
>> example, for the word "Lorem" the real offset is { begin: 1000, end: 1005>.
>> Please note that my backend doesn't care the HTML structure, and the "real"
>> offset is calculated by the offset of "Lorem" in his div summed with the
>> data-begin attribute of its div.
>>
>
> You would subscribe to a hook which takes an annotation and adds a field
> to store this information.
>
>
>>
>> The second question is about reading existing annotations: how can I use
>> annotator to highlight the right spans of text without using only the
>> data-begin and data-end attributes and the <begin, end> of each annotation?
>>
>
> Current Annotator will likely not work well out of the box for your case,
> unless the URI changes when you load new paragraphs. Without changing the
> URI, it will likely attach annotations to the wrong paragraphs, but you
> could write some plugins.
>
> Kristof (csillag) has done some really nice work on providing this sort of
> anchoring, though. If all goes well with this the hope is that we might
> find a way to make Annotator aware of your data attributes.
>
> It may be better to delineate the chapters as entities with their own URIs
> if possible. Then the offsets are just relative to the chapter and we can
> make Annotator recognize the chapter entities as distinct from the URI of
> the owner document (the viewer) when determining the context for an
> annotation. That's probably a bit more in line with the open web.
>
> A bit more about the UX you're trying to achieve might help clarify how
> Annotator could be useful for you.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.okfn.org/pipermail/annotator-dev/attachments/20131114/721a439f/attachment-0004.html>


More information about the annotator-dev mailing list