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

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.

Forwarded message 1

  • From: Dan Brickley <danbri@joost.com>
  • Date: Mon, 05 Nov 2007 12:16:07 +0000
  • Subject: SPARQL in Javascript? (tabulator ... opensocial ...)
  • To: Semantic web list <semantic-web@w3.org>
  • CC: Tim Berners-Lee <timbl@w3.org>
  • Message-ID: <472F0987.8020109@joost.com>
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 12:20:05 UTC