@@ -57,15 +57,15 @@ WOQL.greater = function(v1, v2){ return new WOQLQuery().greater(v1, v2); }
57
57
58
58
59
59
/* Mathematical Processing */
60
- WOQL . eval = function ( arith , v ) { return new WOQLQuery ( ) . eval ( arith , v ) ; }
60
+ WOQL . eval = function ( arith , v ) { return new WOQLQuery ( ) . eval ( arith , v ) ; }
61
61
WOQL . plus = function ( ...args ) { return new WOQLQuery ( ) . plus ( ...args ) ; }
62
62
WOQL . minus = function ( ...args ) { return new WOQLQuery ( ) . minus ( ...args ) ; }
63
63
WOQL . times = function ( ...args ) { return new WOQLQuery ( ) . times ( ...args ) ; }
64
64
WOQL . divide = function ( ...args ) { return new WOQLQuery ( ) . divide ( ...args ) ; }
65
65
WOQL . exp = function ( a , b ) { return new WOQLQuery ( ) . exp ( a , b ) ; }
66
66
WOQL . div = function ( ...args ) { return new WOQLQuery ( ) . div ( ...args ) ; }
67
67
WOQL . comment = function ( arg ) { return new WOQLQuery ( ) . comment ( arg ) ; }
68
- WOQL . length = function ( var1 , res ) { return new WOQLQuery ( ) . length ( var1 , res ) ; }
68
+ WOQL . length = function ( var1 , res ) { return new WOQLQuery ( ) . length ( var1 , res ) ; }
69
69
70
70
71
71
//language extensions that can be chained after 'grounded' stuff (clauses with a specific subject) sub, isa, delete_triple, add_triple, delete_quad, add_quad, node
@@ -124,7 +124,7 @@ WOQLQuery.prototype.get = function(arr1, arr2, target){
124
124
target = arr2 ;
125
125
}
126
126
else {
127
- var map = this . buildAsClauses ( arr1 , arr2 ) ;
127
+ var map = this . buildAsClauses ( arr1 , arr2 ) ;
128
128
}
129
129
if ( target ) {
130
130
if ( target . json ) target = target . json ( ) ;
@@ -199,7 +199,7 @@ WOQLQuery.prototype.group_by = function(gvarlist, groupedvar, groupquery, output
199
199
if ( typeof groupedvar == "object" && Array . isArray ( groupedvar ) ) {
200
200
ng = [ ] ;
201
201
for ( var i = 0 ; i < groupedvar . length ; i ++ ) {
202
- ng . push ( groupedvar [ i ] . substring ( 0 , 2 ) != "v:" ? "v:" + groupedvar [ i ] : groupedvar [ i ] ) ;
202
+ ng . push ( groupedvar [ i ] . substring ( 0 , 2 ) != "v:" ? "v:" + groupedvar [ i ] : groupedvar [ i ] ) ;
203
203
}
204
204
groupedvar = { "list" : ng } ;
205
205
}
@@ -208,7 +208,7 @@ WOQLQuery.prototype.group_by = function(gvarlist, groupedvar, groupquery, output
208
208
}
209
209
args . push ( groupedvar ) ;
210
210
if ( output ) {
211
- groupquery = groupquery . json ? groupquery . json ( ) : groupquery ;
211
+ groupquery = groupquery . json ? groupquery . json ( ) : groupquery ;
212
212
args . push ( groupquery ) ;
213
213
}
214
214
else {
@@ -527,7 +527,7 @@ WOQLQuery.prototype.eval = function(arith, v){
527
527
}
528
528
529
529
WOQLQuery . prototype . plus = function ( ...args ) {
530
- this . cursor . plus = [ ] ;
530
+ this . cursor . plus = [ ] ;
531
531
for ( var i = 0 ; i < args . length ; i ++ ) {
532
532
this . cursor . plus . push ( args [ i ] . json ? args [ i ] . json ( ) : args [ i ] ) ;
533
533
}
@@ -674,7 +674,7 @@ WOQLQuery.prototype.as = function(a, b){
674
674
b = ( b . indexOf ( ":" ) == - 1 ? "v:" + b : b ) ;
675
675
var val = ( typeof a == "object" ? a : { "@value" : a } ) ;
676
676
this . query . push ( { as : [ val , b ] } ) ;
677
- return this ;
677
+ return this ;
678
678
}
679
679
680
680
/**
@@ -1222,7 +1222,7 @@ WOQLQuery.prototype.prettyPrint = function(indent, show_context, q, fluent){
1222
1222
str += this . getWOQLPrelude ( operator , fluent , indent - this . indent ) ;
1223
1223
var val = q [ operator ] ;
1224
1224
if ( this . chainable ( operator , val [ val . length - 1 ] ) ) {
1225
- //all arguments up until the last are regular function arguments
1225
+ //all arguments up until the last are regular function arguments
1226
1226
str += this . uncleanArguments ( operator , val . slice ( 0 , val . length - 1 ) , indent , show_context ) ;
1227
1227
if ( newlining_operators . indexOf ( operator ) !== - 1 ) {
1228
1228
//some fluent function calls demand a linebreak..
@@ -1253,7 +1253,7 @@ WOQLQuery.prototype.getWOQLPrelude = function(operator, fluent, inline){
1253
1253
if ( fluent ) {
1254
1254
return "." + operator ;
1255
1255
}
1256
- return ( inline ? "\n" + nspaces ( inline ) : "" ) + "WOQL." + operator ;
1256
+ return ( inline ? "\n" + nspaces ( inline ) : "" ) + "WOQL." + operator ;
1257
1257
}
1258
1258
1259
1259
/**
@@ -1301,7 +1301,7 @@ WOQLQuery.prototype.uncleanArguments = function(operator, args, indent, show_con
1301
1301
str += ")" ;
1302
1302
str += "\n" + nspaces ( indent ) ;
1303
1303
}
1304
- }
1304
+ }
1305
1305
else {
1306
1306
str += this . uncleanArgument ( operator , args [ i ] , i , args ) ;
1307
1307
}
@@ -1319,10 +1319,10 @@ WOQLQuery.prototype.uncleanArguments = function(operator, args, indent, show_con
1319
1319
/**
1320
1320
* Passed as arguments: 1) the operator (and, triple, not, opt, etc)
1321
1321
* 2) the value of the argument
1322
- * 3) the index (position) of the argument.
1322
+ * 3) the index (position) of the argument.
1323
1323
*/
1324
1324
WOQLQuery . prototype . uncleanArgument = function ( operator , val , index , allArgs ) {
1325
- //numeric values go out untouched...
1325
+ //numeric values go out untouched...
1326
1326
const numeric_operators = [ "limit" , "start" , "eval" , "plus" , "minus" , "times" , "divide" , "exp" , "div" ] ;
1327
1327
if ( operator == "isa" ) {
1328
1328
val = ( index == 0 ? this . unclean ( val , 'subject' ) : this . unclean ( val , 'class' ) ) ;
@@ -1521,18 +1521,17 @@ TripleBuilder.prototype.addPO = function(p, o, g){
1521
1521
else var ttype = "triple" ;
1522
1522
var evstr = ttype + '("' + this . subject + '", "' + p + '", ' ;
1523
1523
if ( typeof o == "string" ) {
1524
- evstr += "'" + o + "'" ;
1525
- }
1524
+ evstr += "'" + o + "'" ;
1525
+ }
1526
1526
else if ( typeof o == "object" ) {
1527
- console . log ( JSON . stringify ( o ) ) ;
1528
1527
evstr += JSON . stringify ( o ) ;
1529
1528
}
1530
1529
else {
1531
1530
evstr += o ;
1532
1531
}
1533
1532
if ( ttype . substring ( ttype . length - 4 ) == "quad" || this . g ) {
1534
1533
var g = ( g ? g : ( this . g ? this . g : "db:schema" ) ) ;
1535
- evstr += ', "' + g + '"' ;
1534
+ evstr += ', "' + g + '"' ;
1536
1535
}
1537
1536
evstr += ")" ;
1538
1537
try {
0 commit comments