blogccasion

RDFa API-based Creative Commons Laser Highlighter Chrome Extension Released

RDFa API-based Creative Commons Laser Highlighter Chrome Extension Released

I have released a very early alpha state pure JavaScript implementation of the RDFa API draft spec. It has still many flaws, but at this stage it's already usable enough to be the foundation for a Chrome extension: the RDFa Creative Commons Laser Highlighter. 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. The whole magic happens in just two calls:
LinkedData.API.data.context.setMapping(
'cc',
'http://creativecommons.org/ns#');
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.
Chrome Extensions: RDFa Creative Commons Laser Highlighter