@@ -324,10 +324,9 @@ describe('triple builder', function () {
324
324
//{ limit: [ 10, { start: [Array] } ] }
325
325
const woqlObject = WOQL . addProperty ( "some_property" , "string" ) ;
326
326
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' ] } ] } ;
329
328
330
- // expect(woqlObject.json()).to.eql(jsonObj);
329
+ expect ( woqlObject . json ( ) ) . to . eql ( jsonObj ) ;
331
330
332
331
} )
333
332
@@ -367,4 +366,34 @@ describe('triple builder chanier', function () {
367
366
368
367
} )
369
368
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
+
370
399
} )
0 commit comments