Tuesday, May 31, 2016

Getting started with rdflib.js -- my first experiment

I cloned the github repository with:

git clone https://github.com/linkeddata/rdflib.js.git

then I followed the following steps:

cd rdflib.js

sudo su

npm install

make all

npm install -g jquery

npm install -g xmlhttprequest

I was inspired by the instructions at:


In separate directory at the same level of hierarchy on the directory tree I created a directory with the name "rdflibexperiments":

cd ..

mkdir rdflibexperiments

cd rdflibexperiments

Then I created a file called "exp1.js":

vim exp1.js

With the contents:

var $rdf = require('../rdflib.js');

var FOAF = $rdf.Namespace("http://xmlns.com/foaf/0.1/");

var foafKnows = FOAF('knows');


Running this with the command

node exp1.js


NamedNode { uri: 'http://xmlns.com/foaf/0.1/knows' }

The contents of the file was inspired by: 


with a friendly reminder from:


No comments:

Post a Comment