@@ -226,13 +226,7 @@ describe('woql queries', function () {
226
226
227
227
const woqlObject = WOQL . get ( "Map" , "Target" ) ;
228
228
229
- const jsonObj = { get : [
230
- [ { "as" : [ { "@value" : "T" } , "M" ] } ,
231
- { "as" : [ { "@value" : "a" } , "a" ] } ,
232
- { "as" : [ { "@value" : "r" } , "p" ] }
233
- ] ,
234
- { }
235
- ] } ;
229
+ const jsonObj = { get : [ [ ] , { } ] } ;
236
230
237
231
expect ( woqlObject . json ( ) ) . to . eql ( jsonObj ) ;
238
232
@@ -241,10 +235,14 @@ describe('woql queries', function () {
241
235
it ( 'check the as method' , function ( ) {
242
236
243
237
const woqlObject = WOQL . as ( "Source" , "Target" ) ;
238
+ const woqlObject2 = WOQL . as ( "Source" , "Target" ) . as ( "Source2" , "Target2" ) ;
244
239
245
- const jsonObj = { as : [ { '@value' : 'Source' } , 'v:Target' ] } ;
240
+ const jsonObj = [ { as : [ { '@value' : 'Source' } , 'v:Target' ] } ] ;
241
+ const jsonObj2 = [ { as : [ { '@value' : 'Source' } , 'v:Target' ] } ,
242
+ { as : [ { '@value' : 'Source2' } , 'v:Target2' ] } ]
246
243
247
244
expect ( woqlObject . json ( ) ) . to . eql ( jsonObj ) ;
245
+ expect ( woqlObject2 . json ( ) ) . to . eql ( jsonObj2 ) ;
248
246
249
247
} )
250
248
@@ -260,9 +258,9 @@ describe('woql queries', function () {
260
258
261
259
it ( 'check the unique method' , function ( ) {
262
260
263
- const woqlObject = WOQL . as ( "Prefix" , [ "V1" , "V2" ] ) ;
261
+ const woqlObject = WOQL . unique ( "doc:Station_" , [ "v:Start_ID" ] , "v:Start_IRI" ) ;
264
262
265
- const jsonObj = { as : [ { '@value' : 'Prefix' } , 'v:V1,V2 ' ] } ;
263
+ const jsonObj = { unique : [ 'doc:Station_' , { list : [ "v:Start_ID" ] } , 'v:Start_IRI ' ] }
266
264
267
265
expect ( woqlObject . json ( ) ) . to . eql ( jsonObj ) ;
268
266
@@ -458,7 +456,7 @@ describe('triple builder chanier', function () {
458
456
459
457
const woqlObject = WOQL . node ( "doc:x" , "add_quad" ) . comment ( "my comment" ) ;
460
458
461
- const jsonObj = { add_quad : [ 'doc:x' , 'rdfs:comment' , { '@value' : 'my comment' , '@language' : 'en' } , 'db:schema' ] } ;
459
+ const jsonObj = { " add_quad" : [ 'doc:x' , 'rdfs:comment' , { '@value' : 'my comment' , '@language' : 'en' } , 'db:schema' ] } ;
462
460
463
461
expect ( woqlObject . json ( ) ) . to . eql ( jsonObj ) ;
464
462
0 commit comments