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.
















It would be cool if the rdflib.js was installable on Node via npm - http://github.com/isaacs/npm. It's the de facto standard for distributing packages for NodeJS. Here's what to do: http://github.com/isaacs/npm/blob/master/doc/developers.md#readme
RT @webr3: #RDF support in #node.js http://bit.ly/d09mE0 – ported tabulator rdflib.js over to work on the serverside – happy hacking!
This comment was originally posted on Twitter