W3C home > Mailing lists > Public > public-rdf-in-xhtml-tf@w3.org > October 2007

RDFa JavaScript implementation updated

From: Ben Adida <ben@adida.net>
Date: Wed, 03 Oct 2007 21:03:23 -0700
Message-ID: <4704660B.4030400@adida.net>
To: RDFa <public-rdf-in-xhtml-tf@w3.org>


Hi all,

I've updated the RDFa JavaScript implementation to support xml:lang, and
I've completely ripped out the way I was storing triples, using instead
the RDF Triple Store from Tabulator [1].

I've updated all bookmarklets to use this new API, including GetN3, RDFa
Highlight, License Checker, and GetCal. As I'm still debugging heavily,
I haven't frozen the versions under a timestamped URL, so all code is
still in the development branch:

http://www.w3.org/2006/07/SWD/RDFa/impl/js/

The nice thing about using the Tabulator triple store is that accessing
triples is now *much* more flexible and robust. Take, for example, the
License Checker:


 var CC = new Namespace('http://creativecommons.org/ns#');
 var cc_license = CC('license');

 var current_page = RDFA.triplestore.sym(Util.uri.join('', RDFA.BASE));
 var license = RDFA.triplestore.the(current_page,cc_license);

In general, one can use the .the(), .each(), .statementsMatching() calls
to the triple store.

And, best of all, the triple store supports provenance tagging. So you
can add other triples to the store, but look at only the RDFa-generated
triples by limiting yourself to the "rdfa" bucket as the fourth
parameter to .the(), .each(), and .statementsMatching().

-Ben

[1] http://www.w3.org/2005/ajar/tab
Received on Thursday, 4 October 2007 04:03:35 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:15:15 GMT