Re: Very early alpha state pure JavaScript implementation of the RDFa API draft spec released

Hi Thomas,

Great news!

Just a quick comment on your point about the namespace for the API.

The easiest way to cater for both JS and native implementations is to
do something like this:

  if (! { = {

This is a common technique when adding cross-browser support for
standards such as DOM 2 Events, XML parsing, etc.

Like any other language, JavaScript has its idioms, so you're actually
much more likely to see this: = || {

But either way it amounts to the same thing; if some particular
feature doesn't exist already then add it via JavaScript.

(An old article of mine delves into this subject: Ajax and Progressive
Browser Enhancement [1].)



[1] <>

Mark Birbeck, webBackplane

webBackplane is a trading name of Backplane Ltd. (company number
05972288, registered office: 2nd Floor, 69/85 Tabernacle Street,
London, EC2A 4RR)

On Mon, Oct 4, 2010 at 10:00 PM, Thomas Steiner <> wrote:
> Hi RDFa API Working Group,
> I have released a very early alpha state pure JavaScript
> implementation of the RDFa API draft spec. It has still many flaws,
> and I'd like to sit down with you guys in order to get some open
> questions sorted, but at this stage it's ("it" being my
> implementation) already usable enough to be the foundation for a
> Chrome extension [0]. Rather than calling document.* you call
> LinkedData.API.* (I've put the API in my own namespace to avoid
> confusion with potential native implementations, and yepp, I do vote
> for renaming the API). I have coded an extension around example 1.3
> from the current draft spec [1]. The whole magic happens in just two
> calls:
>    'cc',
>    '');
> LinkedData.API.getElementsByProperty('cc:license');
> The extension is more or less just a toy, but the provided JavaScript
> code should already be good enough to test the examples in the latest
> spec draft. The library is implemented using XPath and not at all
> intended to be fast, or elegant, and currently just supports RDFa and
> has many of the advanced API calls mocked out. I'm happy to keep
> improving the code if anyone is interested. Just let me know. Thanks!
> Cheers,
> Tom
> [0]
> [1]
> --
> Thomas Steiner, Research Scientist, Google Inc.

Received on Tuesday, 5 October 2010 09:50:31 UTC