I am new to node.js.
I want to use rdfstore module for implementing semantic web in a node.js
poroject.
I found this sample code on Github for rdfstore, can anyone explain it
var rdfstore = require('rdfstore');
new rdfstore.Store({persistent:true,
engine:'mongodb',
name:'myappstore', // quads in MongoDB will be stored
in a DB named myappstore
overwrite:true, // delete all the data already
present in the MongoDB server
mongoDomain:'localhost', // location of the MongoDB
instance, localhost by default
mongoPort:27017 // port where the MongoDB server is
running, 27017 by default
}, function(store){
store.execute('LOAD <http://dbpedia.org/resource/Tim_Berners-Lee> INTO
GRAPH <http://example.org/people>', function() {
store.setPrefix('dbp', 'http://dbpedia.org/resource/');
store.node(store.rdf.resolve('dbp:Tim_Berners-Lee'),
"http://example.org/people", function(success, graph) {
var peopleGraph =
graph.filter(store.rdf.filters.type(store.rdf.resolve("foaf:Person")));
store.execute('PREFIX rdf:
<http://www.w3.org/1999/02/22-rdf-syntax-ns#>\
PREFIX foaf: <http://xmlns.com/foaf/0.1/>\
PREFIX : <http://example.org/>\
SELECT ?s FROM NAMED :people { GRAPH ?g { ?s rdf:type
foaf:Person } }',
function(success, results) {
console.log(peopleGraph.toArray()[0].subject.valueOf() ===
results[0].s.value);
console.log('Getting value...');
console.log(peopleGraph.toArray());
});
});
});
})
--
Job board: http://jobs.nodejs.org/
New group rules:
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/nodejs/26e626db-5807-4078-8d59-a129a299b865%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.