Re: SPARQL in Javascript? (tabulator ... opensocial ...)

Hi Dan,

Yes, yes, and yes. :)

I took a look a while back at the Tabulator code, and I couldn't see
any client-side SPARQL handling (at the time), so I started to write
my own. I needed it for use in my client-side JS RDFa parser, although
as things evolved I actually found myself using it for all sorts of
things; what I have now is essentially a dynamic JS object creation
tool. :) For this reason I'm going to continue with this work, because
it is now slightly more than a SPARQL engine, but....

Ben Adida recently released an update to his RDFa processor, and he
has indeed used the SPARQL code from Tabulator, which as far as I can
tell has worked well. (I'm sure he will comment on this, too.)

However, your broader point seems to be that this could all fit quite
nicely into the Ajax/Web 2.0 world, and I think there is a great deal
of possible convergence. For example, I've made my library accept
'pluggable' RDF stores in the way that many RDF libraries do, because
I want to be able to store and retrieve triples from Google Gears.

I also created a module that takes any JSON objects and 'translates'
them into a triple store. (Is that JSONGRDDL? :)) I did this because
(a) Yahoo! Pipes, can convert many sources of information into JSON,
and (b) JSON doesn't suffer from the annoying "same site" restriction
that browsers impose. So now I can add further triples to the triple
store, from many locations.

Anyway, I could go on...the point I'm making is that I agree with you
that getting RDF and SPARQL into 'Web 2.0' and Ajax environments is
very exciting. I think RDFa is one of the key ways to do this, due to
its close proximity to the actual DOM, which is how most of the new
techniques are leveraged, but of course there are many other scenarios
that will emerge.

Regards,

Mark

-- 
  Mark Birbeck, formsPlayer

  mark.birbeck@formsPlayer.com | +44 (0) 20 7689 9232
  http://www.formsPlayer.com | http://internet-apps.blogspot.com

  standards. innovation.


On 05/11/2007, Dan Brickley <danbri@danbri.org> wrote:
> Hi all
>
> Has anyone managed to do SPARQL in Javascript? Perhaps using the engine
> at http://dig.csail.mit.edu/2005/ajar/ajaw/tut/sparqlImplementation.html
> from the Tabulator project.
>
> I understand there are SPARQL protocol clients, but I'm talking about
> the whole thing: query answers computed from within Javascript. While
> you wait.
>
> The last time I played with RDF query in .js seriously it was (*gulp*) 1999!
>
> http://www.w3.org/1999/11/11-WWWProposal/rdfqdemo.html which used
> http://ioctl.org/logic/prolog-latest plus some hacky syntax I added to
> allow URIs in the Prolog. A modern approach should just use SPARQL.
>
> Since then, computers have got faster. Javascript interpreters have
> (presumably) got better. And Web 2.0 and JSON have happened.
>
> The source for Tabulator is available opensource at
> http://dig.csail.mit.edu/2005/ajar/ajaw/js/rdf/
>
> I see a new .js RDF/XML parser in there, as well as a patched version of
> Jim Ley's older one. And the SPARQL code is at:
> http://dig.csail.mit.edu/2005/ajar/ajaw/js/rdf/sparql.js
>
> Has anyone here tried using the SPARQL/RDF parts separate from the
> Tabulator UI? I'd love to have a minimal example of its use, and an
> overview of files/APIs. TimBL, have the DIG group thought of packaging
> the SPARQL implementation separately from the entire Tabulator system?
>
> These are interesting times for js data APIs, with Google's Gadget-based
> OpenSocial getting a lot of people thinking and talking and coding. See
> http://www.google.com/search?q=opensocial for specs and commentary.
> OpenSocial is essentially Google Gadgets applied to the problem of
> making "Social networking" site addons in a more portable manner. There
> is a lot of overlap with W3C's Widget work,
> http://www.w3.org/TR/2007/WD-widgets-reqs-20070209/
> http://www.w3.org/TR/widgets/ as well as WebAPIs of course, see
> http://www.w3.org/2006/webapi/ and nearby.
>
> Setting aside standardisation for now, my immediate concern is
> determining the state of the art: is SPARQLing in a pure .js environment
>   feasible and useful?
>
> cheers,
>
> Dan
>
> ps. oops sent this first from wrong account; sorry if a 2nd makes it
> thru eventually.
>
> Hi all
>
> Has anyone managed to do SPARQL in Javascript? Perhaps using the engine
> at http://dig.csail.mit.edu/2005/ajar/ajaw/tut/sparqlImplementation.html
> from the Tabulator project.
>
> I understand there are SPARQL protocol clients, but I'm talking about
> the whole thing: query answers computed from within Javascript. While
> you wait.
>
> The last time I played with RDF query in .js seriously it was (*gulp*) 1999!
>
> http://www.w3.org/1999/11/11-WWWProposal/rdfqdemo.html which used
> http://ioctl.org/logic/prolog-latest plus some hacky syntax I added to
> allow URIs in the Prolog. A modern approach should just use SPARQL.
>
> Since then, computers have got faster. Javascript interpreters have
> (presumably) got better. And Web 2.0 and JSON have happened.
>
> The source for Tabulator is available opensource at
> http://dig.csail.mit.edu/2005/ajar/ajaw/js/rdf/
>
> I see a new .js RDF/XML parser in there, as well as a patched version of
> Jim Ley's older one. And the SPARQL code is at:
> http://dig.csail.mit.edu/2005/ajar/ajaw/js/rdf/sparql.js
>
> Has anyone here tried using the SPARQL/RDF parts separate from the
> Tabulator UI? I'd love to have a minimal example of its use, and an
> overview of files/APIs. TimBL, have the DIG group thought of packaging
> the SPARQL implementation separately from the entire Tabulator system?
>
> These are interesting times for js data APIs, with Google's Gadget-based
> OpenSocial getting a lot of people thinking and talking and coding. See
> http://www.google.com/search?q=opensocial for specs and commentary.
> OpenSocial is essentially Google Gadgets applied to the problem of
> making "Social networking" site addons in a more portable manner. There
> is a lot of overlap with W3C's Widget work,
> http://www.w3.org/TR/2007/WD-widgets-reqs-20070209/
> http://www.w3.org/TR/widgets/ as well as WebAPIs of course, see
> http://www.w3.org/2006/webapi/ and nearby.
>
> Setting aside standardisation for now, my immediate concern is
> determining the state of the art: is SPARQLing in a pure .js environment
>   feasible and useful?
>
> cheers,
>
> Dan
>
>
>
>

Received on Monday, 5 November 2007 13:37:12 UTC