Skip to content

Commit 2e0ba10

Browse files
committed
add more test to the triple builder chain example
1 parent d436ba0 commit 2e0ba10

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

test/woql.spec.js

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,10 +324,9 @@ describe('triple builder', function () {
324324
//{ limit: [ 10, { start: [Array] } ] }
325325
const woqlObject=WOQL.addProperty("some_property", "string");
326326

327-
console.log(woqlObject.json())
328-
//const jsonObj={ add_quad: [ 'scm:some_property', 'rdf:scm', 'owl:Class', 'db:schema' ] }
327+
const jsonObj={ and: [ { add_quad: [ 'scm:some_property', 'rdf:type', 'owl:DatatypeProperty', 'db:schema' ] }, { add_quad: [ 'scm:some_property', 'rdfs:range', 'xsd:string', 'db:schema' ] } ] };
329328

330-
//expect(woqlObject.json()).to.eql(jsonObj);
329+
expect(woqlObject.json()).to.eql(jsonObj);
331330

332331
})
333332

@@ -367,4 +366,34 @@ describe('triple builder chanier', function () {
367366

368367
})
369368

369+
it('check the label method',function(){
370+
371+
const woqlObject=WOQL.node("doc:x", "add_quad").label("my label", "en");
372+
373+
const jsonObj={ add_quad: ['doc:x', 'rdfs:label', { '@value': 'my label', '@language': 'en' }, 'db:schema'] }
374+
375+
expect(woqlObject.json()).to.eql(jsonObj);
376+
377+
})
378+
379+
it('check the comment method',function(){
380+
381+
const woqlObject=WOQL.node("doc:x", "add_quad").comment("my comment");
382+
383+
const jsonObj={ add_quad: ['doc:x', 'rdfs:comment', { '@value': 'my comment', '@language': 'en' }, 'db:schema'] }
384+
385+
expect(woqlObject.json()).to.eql(jsonObj);
386+
387+
})
388+
389+
it('check the property method',function(){
390+
391+
const woqlObject=WOQL.node("doc:x", "add_quad").property("myprop", "value");
392+
393+
const jsonObj={ add_quad: ['doc:x', 'rdfs:myprop', { '@value': 'my value', '@language': 'en' }, 'db:schema'] }
394+
395+
expect(woqlObject.json()).to.eql(jsonObj);
396+
397+
})
398+
370399
})

0 commit comments

Comments
 (0)