@@ -358,19 +358,21 @@ describe('triple builder chanier', function () {
358
358
it ( 'check the graph method' , function ( ) {
359
359
360
360
const woqlObject = WOQL . node ( "doc:x" , "add_quad" ) . graph ( "db:schema" ) ;
361
+ const woqlObject2 = WOQL . node ( "doc:x" , "add_quad" ) . graph ( "db:mySchema" ) . label ( "my label" , "en" ) ;
361
362
362
- console . log ( woqlObject . json ( ) ) ;
363
- // const jsonObj={}
363
+ const jsonObj = { } ;
364
+ const jsonObj2 = { add_quad : [ 'doc:x' , 'rdfs:label' , { '@value' : 'my label' , '@language' : 'en' } , 'db:mySchema' ] } ;
364
365
365
- //expect(woqlObject.json()).to.eql(jsonObj);
366
+ expect ( woqlObject . json ( ) ) . to . eql ( jsonObj ) ;
367
+ expect ( woqlObject2 . json ( ) ) . to . eql ( jsonObj2 ) ;
366
368
367
369
} )
368
370
369
371
it ( 'check the label method' , function ( ) {
370
372
371
373
const woqlObject = WOQL . node ( "doc:x" , "add_quad" ) . label ( "my label" , "en" ) ;
372
374
373
- const jsonObj = { add_quad : [ 'doc:x' , 'rdfs:label' , { '@value' : 'my label' , '@language' : 'en' } , 'db:schema' ] }
375
+ const jsonObj = { add_quad : [ 'doc:x' , 'rdfs:label' , { '@value' : 'my label' , '@language' : 'en' } , 'db:schema' ] } ;
374
376
375
377
expect ( woqlObject . json ( ) ) . to . eql ( jsonObj ) ;
376
378
@@ -380,7 +382,7 @@ describe('triple builder chanier', function () {
380
382
381
383
const woqlObject = WOQL . node ( "doc:x" , "add_quad" ) . comment ( "my comment" ) ;
382
384
383
- const jsonObj = { add_quad : [ 'doc:x' , 'rdfs:comment' , { '@value' : 'my comment' , '@language' : 'en' } , 'db:schema' ] }
385
+ const jsonObj = { add_quad : [ 'doc:x' , 'rdfs:comment' , { '@value' : 'my comment' , '@language' : 'en' } , 'db:schema' ] } ;
384
386
385
387
expect ( woqlObject . json ( ) ) . to . eql ( jsonObj ) ;
386
388
@@ -390,10 +392,92 @@ describe('triple builder chanier', function () {
390
392
391
393
const woqlObject = WOQL . node ( "doc:x" , "add_quad" ) . property ( "myprop" , "value" ) ;
392
394
393
- const jsonObj = { add_quad : [ 'doc:x' , 'rdfs:myprop' , { '@value' : 'my value' , '@language' : 'en' } , 'db:schema' ] }
395
+ const jsonObj = { add_quad : [ 'doc:x' , 'rdfs:myprop' , { '@value' : 'my value' , '@language' : 'en' } , 'db:schema' ] } ;
394
396
395
397
expect ( woqlObject . json ( ) ) . to . eql ( jsonObj ) ;
396
398
397
399
} )
398
400
401
+ it ( 'check the entity method' , function ( ) {
402
+
403
+ const woqlObject = WOQL . node ( "doc:x" , "add_quad" ) . entity ( ) ;
404
+
405
+ console . log ( woqlObject . json ( ) ) ;
406
+
407
+ //const jsonObj={ add_quad: ['doc:x', 'rdfs:myprop', { '@value ': 'my value', '@language': 'en' }, 'db:schema'] }
408
+
409
+ //expect(woqlObject.json()).to.eql(jsonObj);
410
+
411
+ } )
412
+
413
+ it ( 'check the parent method' , function ( ) {
414
+
415
+ const woqlObject = WOQL . node ( "doc:x" , "add_quad" ) . parent ( "Z" ) ;
416
+
417
+ console . log ( woqlObject . json ( ) ) ;
418
+
419
+ //const jsonObj={ add_quad: ['doc:x', 'rdfs:myprop', { '@value ': 'my value', '@language': 'en' }, 'db:schema'] }
420
+
421
+ //expect(woqlObject.json()).to.eql(jsonObj);
422
+
423
+ } )
424
+
425
+ it ( 'check the abstract method' , function ( ) {
426
+
427
+ const woqlObject = WOQL . node ( "doc:x" , "add_quad" ) . abstract ( ) ;
428
+
429
+ const jsonObj = { add_quad : [ 'doc:x' , 'tcs:tag' , 'tcs:abstract' , 'db:schema' ] } ;
430
+
431
+ expect ( woqlObject . json ( ) ) . to . eql ( jsonObj ) ;
432
+
433
+ } )
434
+
435
+ it ( 'check the relationship method' , function ( ) {
436
+
437
+ const woqlObject = WOQL . node ( "doc:x" , "add_quad" ) . relationship ( ) ;
438
+
439
+ console . log ( woqlObject . json ( ) ) ;
440
+
441
+ const jsonObj = { add_quad : [ 'doc:x' , 'tcs:tag' , 'tcs:relationship' , 'db:schema' ] } ;
442
+
443
+ expect ( woqlObject . json ( ) ) . to . eql ( jsonObj ) ;
444
+
445
+ } )
446
+
447
+ it ( 'check the max method' , function ( ) {
448
+
449
+ const woqlObject = WOQL . addProperty ( "P" , "string" ) . max ( 4 ) ;
450
+
451
+ console . log ( woqlObject . json ( ) ) ;
452
+
453
+ //const jsonObj={ add_quad: [ 'doc:x', 'tcs:tag', 'tcs:relationship', 'db:schema' ] };
454
+
455
+ //expect(woqlObject.json()).to.eql(jsonObj);
456
+
457
+ } )
458
+
459
+ it ( 'check the min method' , function ( ) {
460
+
461
+ const woqlObject = WOQL . addProperty ( "P" , "string" ) . min ( 2 ) ;
462
+
463
+ console . log ( woqlObject . json ( ) ) ;
464
+
465
+ //const jsonObj={ add_quad: [ 'doc:x', 'tcs:tag', 'tcs:relationship', 'db:schema' ] };
466
+
467
+ //expect(woqlObject.json()).to.eql(jsonObj);
468
+
469
+ } )
470
+
471
+ it ( 'check the cardinality method' , function ( ) {
472
+
473
+ const woqlObject = WOQL . addProperty ( "P" , "string" ) . cardinality ( 3 ) ;
474
+
475
+ console . log ( woqlObject . json ( ) ) ;
476
+
477
+ //const jsonObj={ add_quad: [ 'doc:x', 'tcs:tag', 'tcs:relationship', 'db:schema' ] };
478
+
479
+ //expect(woqlObject.json()).to.eql(jsonObj);
480
+
481
+ } )
482
+
399
483
} )
0 commit comments