-
Notifications
You must be signed in to change notification settings - Fork 0
/
testapp.js
33 lines (29 loc) · 852 Bytes
/
testapp.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//function called on entry-point
function execCode() {
//start-message
console.log("start of code");
//dependency
const $rdf = require('rdflib');
//initialize graph
const store1 = $rdf.graph();
//setup store
const me = store1.sym('https://testpro.solidweb.org/profile/card#me');
//generate named node
const profile = me.doc();
//setup namespace
const VCARD = new $rdf.Namespace('http://www.w3.org/2006/vcard/ns#');
//add data to store
store1.add(me, VCARD('fn'), "John C. Doe", profile);
//get data
let name = store1.any(me, VCARD('name'), null, profile);
let role = store1.any(me, VCARD('role'), null, profile);
let org = store1.any(me, VCARD('org'), null, profile);
//output data
console.log(name);
console.log(role);
console.log(org);
//further things
//...
//build a quadrupel
//let quad = store.match(subject, predicate, object, document);
}