RDF support in node.js

Just a short update, I've ported the latest rdflib from the refactor of tabulator over to node.js.

In other words, you can now use the fantastic tabulator code on the client side, and on the server side - the released code is just a quick port to allow you to get hacking, I'm not planning to maintain it, because I feel it would be far more beneficial to make the rdflib.js code work on both client and server from a single library rather than forking it and loosing the hard work of all involved.

rdflib.js ported to node (was incredibly easy, only had to change a few lines)

A quick example (parsing n3 foaf file and showing everybody with a foaf:name):

var sys = require('sys'), rdf = require('rdflib');
var rdfdata = ''; //some rdf in n3 here; probably a foaf file would be a good idea
var kb = rdf.N3Parser( new rdf.IndexedFormula() , null , uri , uri ).loadBuf( rdfdata );
var FOAF = rdf.Namespace('http://xmlns.com/foaf/0.1/');
var results = kb.each( undefined, FOAF('name') );
for (var i = 0; i < results.length; i++) {
sys.puts( results[i] + ' ' + kb.the( results[i] , FOAF('name') ) + '\n' );
}

Related, I've also updated Sean B. Palmer's FOAF example to work on the clientside with RDF/XML and with N3.

Back to node.js stuff, I've also released a patch which exposes all the details needed for FOAF+SSL in node to node_cryto.js (hopefully it'll get added to the main git repo v soon) - next step is to get a JS FOAF+SSL library working, which shouldn't take too long.

Digg This
Reddit This
Stumble Now!
Buzz This
Vote on DZone
Share on Facebook
Bookmark this on Delicious
Kick It on DotNetKicks.com
Shout it
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Printed from: http://webr3.org/blog/uncategorized/rdf-support-in-node-js/ .
© Your Name Here 2012.

1 Tweet

4 Comments   »

RSS feed for comments on this post , TrackBack URI

Leave a Reply

Additional comments powered by BackType

  • webr3 avatar