Re: Experimental RDFa extractor in JS

Niklas,

I think this is a great idea and I am very excited to see that. I think that a system that returns JSON to application developers is the best possible choice for now, as we do not have any RDF API. And, maybe, that is all what WebApp developers need.

I think the first goal should be (if you can) is to cover the whole of Lite, plus possibly fully cover @about. That would be a major first step. Then it could be completed.

What kind of JSON-LD do you produce? For pyRdfa I tried to push as much as I could into @context; mainly in the case of @vocab usage that meant that the rest of the JSON part really looked very simple. That is a major plus for WebApp developers.

The only, though insignificant, issue is that you won't be able to run the official test suite directly. Nevertheless, I think it would be hugely important to have whatever you have be part of the official report (via a manually edited EARL file, for example). 

Niklas, this could be very important...

Thanks

Ivan


On Apr 20, 2012, at 01:58 , Niklas Lindström wrote:

> Hi all!
> 
> The last couple of days I've been experimenting with a different kind
> of approach to implementing an RDFa extractor. The result so far is a
> draft with admittedly rather partial coverage. However, I hope some
> aspects of it will be of interest even at this stage:
> 
> 1. It is implemented in pure Javascript. (Well, actually, in some 170
> lines of CoffeeScript, but the generated result is the same.)
> 2. It runs both in the browser and on Node (used with jsdom).
> 3. It does not produce triples. It directly creates a JSON-LD extract
> (corresponding in shape to the RDFa). This is the difference, and the
> fun part.
> 
> Now, it really doesn't handle anything but the most simple RDFa 1.1.
> Possibly all of Lite, plus @datatype, @rel (including hanging),
> @inlist, @rev and perhaps one or two more. It only copes with @about
> if it's alone, it doesn't handle combinations of @rel and @property,
> and so on. I'll strive to make it a lot more compliant given time of
> course.
> 
> - You can check out the code at: https://github.com/niklasl/rdfa-lab
> - Or enjoy the bookmarklet (only tested in Firefox), available at:
> http://niklasl.github.com/rdfa-lab/
> 
> (Just add the latter to your bookmarks and apply on any page
> containing RDFa. I recommend the JSONView [1] browser add-on for a
> good experience.)
> 
> I hope you'll enjoy the little things it can do. (For one, using the
> resulting JSON-LD directly in a JS application should prove
> interesting.)
> 
> Best regards,
> Niklas
> 
> [1]: http://jsonview.com/
> 


----
Ivan Herman, W3C Semantic Web Activity Lead
Home: http://www.w3.org/People/Ivan/
mobile: +31-641044153
FOAF: http://www.ivan-herman.net/foaf.rdf

Received on Friday, 20 April 2012 06:44:11 UTC