@@ -141,7 +141,7 @@ WOQLQuery.prototype.from = function(graph_filter, query) {
141
141
'The first parameter to from must be a Graph Filter Expression (string)' ,
142
142
)
143
143
}
144
- this . cursor [ 'graph_filter' ] = this . jlt ( graph_filter )
144
+ this . cursor [ 'graph_filter' ] = graph_filter
145
145
return this . addSubQuery ( query )
146
146
}
147
147
@@ -185,7 +185,7 @@ WOQLQuery.prototype.removed_triple = function(a, b, c) {
185
185
//if (a && a == 'args')
186
186
//return ['subject', 'predicate', 'object']
187
187
if ( this . cursor [ '@type' ] ) this . wrapCursorWithAnd ( )
188
- this . cursor [ '@type' ] = 'RemovedTriple '
188
+ this . cursor [ '@type' ] = 'DeletedTriple '
189
189
this . cursor [ 'subject' ] = this . cleanSubject ( a )
190
190
this . cursor [ 'predicate' ] = this . cleanPredicate ( b )
191
191
this . cursor [ 'object' ] = this . cleanObject ( c )
@@ -271,11 +271,11 @@ WOQLQuery.prototype.substr = function(String, Before, Length, After, SubString)
271
271
)
272
272
if ( this . cursor [ '@type' ] ) this . wrapCursorWithAnd ( )
273
273
this . cursor [ '@type' ] = 'Substring'
274
- this . cursor [ 'string' ] = this . cleanObject ( String )
275
- this . cursor [ 'before' ] = this . cleanObject ( Before , 'xsd:nonNegativeInteger' )
276
- this . cursor [ 'length' ] = this . cleanObject ( Length , 'xsd:nonNegativeInteger' )
277
- this . cursor [ 'after' ] = this . cleanObject ( After , 'xsd:nonNegativeInteger' )
278
- this . cursor [ 'substring' ] = this . cleanObject ( SubString )
274
+ this . cursor [ 'string' ] = this . cleanDataValue ( String , 'xsd:string' )
275
+ this . cursor [ 'before' ] = this . cleanDataValue ( Before , 'xsd:nonNegativeInteger' )
276
+ this . cursor [ 'length' ] = this . cleanDataValue ( Length , 'xsd:nonNegativeInteger' )
277
+ this . cursor [ 'after' ] = this . cleanDataValue ( After , 'xsd:nonNegativeInteger' )
278
+ this . cursor [ 'substring' ] = this . cleanDataValue ( SubString , 'xsd:string' )
279
279
return this
280
280
}
281
281
@@ -714,7 +714,7 @@ WOQLQuery.prototype.split = function(input, glue, output) {
714
714
this . cursor [ '@type' ] = 'Split'
715
715
this . cursor [ 'string' ] = this . cleanDataValue ( input )
716
716
this . cursor [ 'pattern' ] = this . cleanDataValue ( glue )
717
- this . cursor [ 'list' ] = this . wlist ( output )
717
+ this . cursor [ 'list' ] = this . dataList ( output )
718
718
return this
719
719
}
720
720
@@ -749,7 +749,7 @@ WOQLQuery.prototype.concat = function(list, v) {
749
749
if ( Array . isArray ( list ) ) {
750
750
if ( this . cursor [ '@type' ] ) this . wrapCursorWithAnd ( )
751
751
this . cursor [ '@type' ] = 'Concatenate'
752
- this . cursor [ 'list' ] = this . wlist ( list , true )
752
+ this . cursor [ 'list' ] = this . dataList ( list , true )
753
753
this . cursor [ 'result' ] = this . cleanDataValue ( v )
754
754
}
755
755
return this
@@ -762,7 +762,7 @@ WOQLQuery.prototype.join = function(input, glue, output) {
762
762
//return ['join_list', 'join_separator', 'join']
763
763
if ( this . cursor [ '@type' ] ) this . wrapCursorWithAnd ( )
764
764
this . cursor [ '@type' ] = 'Join'
765
- this . cursor [ 'list' ] = this . wlist ( input )
765
+ this . cursor [ 'list' ] = this . dataList ( input )
766
766
this . cursor [ 'separator' ] = this . cleanDataValue ( glue )
767
767
this . cursor [ 'result' ] = this . cleanDataValue ( output )
768
768
return this
@@ -772,7 +772,7 @@ WOQLQuery.prototype.sum = function(input, output) {
772
772
//if (input && input == 'args') return ['sum_list', 'sum']
773
773
if ( this . cursor [ '@type' ] ) this . wrapCursorWithAnd ( )
774
774
this . cursor [ '@type' ] = 'Sum'
775
- this . cursor [ 'list' ] = this . wlist ( input )
775
+ this . cursor [ 'list' ] = this . dataList ( input )
776
776
this . cursor [ 'result' ] = this . cleanObject ( output )
777
777
return this
778
778
}
@@ -800,7 +800,7 @@ WOQLQuery.prototype.re = function(p, s, m) {
800
800
this . cursor [ '@type' ] = 'Regexp'
801
801
this . cursor [ 'pattern' ] = this . cleanDataValue ( p )
802
802
this . cursor [ 'string' ] = this . cleanDataValue ( s )
803
- this . cursor [ 'result' ] = this . wlist ( m )
803
+ this . cursor [ 'result' ] = this . dataList ( m )
804
804
return this
805
805
}
806
806
@@ -893,26 +893,17 @@ WOQLQuery.prototype.order_by = function(...orderedVarlist) {
893
893
? orderedVarlist . pop ( )
894
894
: false
895
895
896
- let vars = [ ]
897
-
898
896
for ( var i = 0 ; i < orderedVarlist . length ; i ++ ) {
899
- if ( orderedVarlist [ i ] == 'asc' ) {
900
- vars [ vars . length - 1 ] [ 'order' ] = 'asc'
901
- } else if ( orderedVarlist [ i ] == 'desc' ) {
902
- vars [ vars . length - 1 ] [ 'order' ] = 'desc'
903
- } else if ( typeof orderedVarlist [ i ] == 'string' ) {
904
- vars . push ( { varname : orderedVarlist [ i ] , order : 'asc' } )
905
- } else {
906
- vars . push ( orderedVarlist [ i ] )
907
- }
908
- }
909
- for ( var i = 0 ; i < vars . length ; i ++ ) {
910
- let obj = {
911
- '@type' : 'OrderTemplate' ,
912
- 'variable' : this . rawVar ( vars [ i ] . varname ) ,
913
- 'order' : vars [ i ] . order
897
+ if ( typeof orderedVarlist [ i ] == 'string' ) {
898
+ let obj = {
899
+ '@type' : 'OrderTemplate' ,
900
+ 'variable' : this . rawVar ( orderedVarlist [ i ] ) ,
901
+ 'order' : "asc"
902
+ }
903
+ this . cursor [ 'ordering' ] . push ( obj )
904
+ } else {
905
+ this . cursor [ 'ordering' ] . push ( orderedVarlist [ i ] )
914
906
}
915
- this . cursor [ 'ordering' ] . push ( obj )
916
907
}
917
908
return this . addSubQuery ( embedquery )
918
909
}
@@ -926,11 +917,8 @@ WOQLQuery.prototype.group_by = function(gvarlist, groupedvar, output, groupquery
926
917
927
918
if ( typeof gvarlist == 'string' ) gvarlist = [ gvarlist ]
928
919
this . cursor [ 'group_by' ] = this . rawVarList ( gvarlist )
929
- if ( typeof groupedvar == 'string' ) {
930
- this . cursor [ 'template' ] = this . varj ( groupedvar )
931
- } else {
920
+ if ( typeof groupedvar == 'string' ) groupedvar = [ groupedvar ]
932
921
this . cursor [ 'template' ] = this . rawVarList ( groupedvar )
933
- }
934
922
this . cursor [ 'grouped' ] = this . varj ( output )
935
923
return this . addSubQuery ( groupquery )
936
924
}
0 commit comments