W3C home > Mailing lists > Public > public-annotation@w3.org > July 2015

To Web Annotation (from Annotator 2.x...currently)

From: Benjamin Young <bigbluehat@hypothes.is>
Date: Thu, 30 Jul 2015 10:49:26 -0400
Message-ID: <CAE3H5FLZAHN2Jg=OyBn2dm+4+T6QDiOG8Pk7tHuMRY0AYd2xLQ@mail.gmail.com>
To: W3C Public Annotation List <public-annotation@w3.org>
I've been working on some (deliberately very) basic conversion code to turn
Annotator 2.x JSON output into Web Annotation Data Model.

Here's what I've got so far:
http://bigbluehat.github.io/to-web-annotation/

Code lives at:
https://github.com/BigBlueHat/to-web-annotation

>From what I can tell by using the JSON-LD Playground, the results are
correct:
http://tinyurl.com/pkoygbx
(or http://preview.tinyurl.com/pkoygbx if the short URL ;) )

If nothing else, I figured this would help us get a sense of what a "just
JSON" developer might attempt to do to get their code to "be correct" in
the Web Annotation Data Model world.

The output includes a "-from-annotator-" key (which is ugly on purpose) to
hold the original JSON...as there are some things that just don't translate
yet (mostly the XPath Ranges). Eventually, I hope to get those expressed
somehow and be able to have a lossless conversion, but for now the ugly key
is there as a reminder. ;)

Other things to note:
 - `@id` for the annotation is considered to be relative & uses `
annotation.id` (...which the Annotator dev will need to set...and make it
the actual document name, etc...)
 - there *are* `@id` values "minting" URLs for the sub-graphs (ex: #body,
#selectors, etc.)
    - curious how folks feel about this one
 - having a URL for the JSON-LD context would make this look less...complex

I'll raise some separate issues/thoughts...separately. :)

For now, I'd love feedback from anyone who has time for it!

Cheers!
Benjamin
--
Developer Advocate
http://hypothes.is/
Received on Thursday, 30 July 2015 14:49:56 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 18:54:38 UTC