[okfn-help] Javascript annotation system

Nick Stenning nick at whiteink.com
Mon Jul 20 19:33:13 UTC 2009


Rufus, and all on [okfn-help],

Just a note to say that an extremely skeletal start on a javascript
text annotation library can be found at:

http://github.com/nickstenning/jsannotate

The ideas behind building our own library for doing annotation, and
specifically why we're not using an already-extant system such as
co-ment or Marginalia can be found at
http://wiki.okfn.org/p/Open_Shakespeare/AnnotationSystem. Put simply,
co-ment is slow, and Marginalia (according to Rufus) is fairly scary
code and is quite strongly coupled to Moodle.

The one thing not currently mentioned on the wiki is that (because of
the way the DOM does selection/range addressing) the most sensible way
of defining a range in a database currently would seem to be:

{ URI/URL,
  CSS selector/XPath for start node + character offset,
  CSS selector/XPath for end node + character offset }

Now XPath would probably be the obvious choice for identifying a node
in an XML document, but CSS selectors can be just as precise
(/body/div/div/p --> "body > div > div > p") and are probably much
easier to tie into JQuery, the library I'm planning on using to build
the annotator. If anyone has any input on XPath in javascript, I'd be
interested to hear from you.

Anyway, the "annotator" does more-or-less nothing at the moment other
than highlight text, but hopefully over the next few weeks it'll turn
into something a bit more useful. Patches welcome, even at this
nascent stage!

Best,
Nick




More information about the okfn-help mailing list