@@ -56,15 +56,15 @@ WOQL.greater = function(v1, v2){ return new WOQLQuery().greater(v1, v2); }
56
56
57
57
58
58
/* Mathematical Processing */
59
- WOQL . eval = function ( arith , v ) { return new WOQLQuery ( ) . eval ( arith , v ) ; }
59
+ WOQL . eval = function ( arith , v ) { return new WOQLQuery ( ) . eval ( arith , v ) ; }
60
60
WOQL . plus = function ( ...args ) { return new WOQLQuery ( ) . plus ( ...args ) ; }
61
61
WOQL . minus = function ( ...args ) { return new WOQLQuery ( ) . minus ( ...args ) ; }
62
62
WOQL . times = function ( ...args ) { return new WOQLQuery ( ) . times ( ...args ) ; }
63
63
WOQL . divide = function ( ...args ) { return new WOQLQuery ( ) . divide ( ...args ) ; }
64
64
WOQL . exp = function ( a , b ) { return new WOQLQuery ( ) . exp ( a , b ) ; }
65
65
WOQL . div = function ( ...args ) { return new WOQLQuery ( ) . div ( ...args ) ; }
66
66
WOQL . comment = function ( arg ) { return new WOQLQuery ( ) . comment ( arg ) ; }
67
- WOQL . length = function ( var1 , res ) { return new WOQLQuery ( ) . length ( var1 , res ) ; }
67
+ WOQL . length = function ( var1 , res ) { return new WOQLQuery ( ) . length ( var1 , res ) ; }
68
68
69
69
70
70
//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
@@ -123,7 +123,7 @@ WOQLQuery.prototype.get = function(arr1, arr2, target){
123
123
target = arr2 ;
124
124
}
125
125
else {
126
- var map = this . buildAsClauses ( arr1 , arr2 ) ;
126
+ var map = this . buildAsClauses ( arr1 , arr2 ) ;
127
127
}
128
128
if ( target ) {
129
129
if ( target . json ) target = target . json ( ) ;
@@ -194,7 +194,7 @@ WOQLQuery.prototype.group_by = function(gvarlist, groupedvar, groupquery, output
194
194
if ( typeof groupedvar == "object" && Array . isArray ( groupedvar ) ) {
195
195
ng = [ ] ;
196
196
for ( var i = 0 ; i < groupedvar . length ; i ++ ) {
197
- ng . push ( groupedvar [ i ] . substring ( 0 , 2 ) != "v:" ? "v:" + groupedvar [ i ] : groupedvar [ i ] ) ;
197
+ ng . push ( groupedvar [ i ] . substring ( 0 , 2 ) != "v:" ? "v:" + groupedvar [ i ] : groupedvar [ i ] ) ;
198
198
}
199
199
groupedvar = { "list" : ng } ;
200
200
}
@@ -203,7 +203,7 @@ WOQLQuery.prototype.group_by = function(gvarlist, groupedvar, groupquery, output
203
203
}
204
204
args . push ( groupedvar ) ;
205
205
if ( output ) {
206
- groupquery = groupquery . json ? groupquery . json ( ) : groupquery ;
206
+ groupquery = groupquery . json ? groupquery . json ( ) : groupquery ;
207
207
args . push ( groupquery ) ;
208
208
}
209
209
else {
@@ -522,7 +522,7 @@ WOQLQuery.prototype.eval = function(arith, v){
522
522
}
523
523
524
524
WOQLQuery . prototype . plus = function ( ...args ) {
525
- this . cursor . plus = [ ] ;
525
+ this . cursor . plus = [ ] ;
526
526
for ( var i = 0 ; i < args . length ; i ++ ) {
527
527
this . cursor . plus . push ( args [ i ] . json ? args [ i ] . json ( ) : args [ i ] ) ;
528
528
}
@@ -669,7 +669,7 @@ WOQLQuery.prototype.as = function(a, b){
669
669
b = ( b . indexOf ( ":" ) == - 1 ? "v:" + b : b ) ;
670
670
var val = ( typeof a == "object" ? a : { "@value" : a } ) ;
671
671
this . query . push ( { as : [ val , b ] } ) ;
672
- return this ;
672
+ return this ;
673
673
}
674
674
675
675
/**
@@ -1217,7 +1217,7 @@ WOQLQuery.prototype.prettyPrint = function(indent, show_context, q, fluent){
1217
1217
str += this . getWOQLPrelude ( operator , fluent , indent - this . indent ) ;
1218
1218
var val = q [ operator ] ;
1219
1219
if ( this . chainable ( operator , val [ val . length - 1 ] ) ) {
1220
- //all arguments up until the last are regular function arguments
1220
+ //all arguments up until the last are regular function arguments
1221
1221
str += this . uncleanArguments ( operator , val . slice ( 0 , val . length - 1 ) , indent , show_context ) ;
1222
1222
if ( newlining_operators . indexOf ( operator ) !== - 1 ) {
1223
1223
//some fluent function calls demand a linebreak..
@@ -1248,7 +1248,7 @@ WOQLQuery.prototype.getWOQLPrelude = function(operator, fluent, inline){
1248
1248
if ( fluent ) {
1249
1249
return "." + operator ;
1250
1250
}
1251
- return ( inline ? "\n" + nspaces ( inline ) : "" ) + "WOQL." + operator ;
1251
+ return ( inline ? "\n" + nspaces ( inline ) : "" ) + "WOQL." + operator ;
1252
1252
}
1253
1253
1254
1254
/**
@@ -1296,7 +1296,7 @@ WOQLQuery.prototype.uncleanArguments = function(operator, args, indent, show_con
1296
1296
str += ")" ;
1297
1297
str += "\n" + nspaces ( indent ) ;
1298
1298
}
1299
- }
1299
+ }
1300
1300
else {
1301
1301
str += this . uncleanArgument ( operator , args [ i ] , i , args ) ;
1302
1302
}
@@ -1314,10 +1314,10 @@ WOQLQuery.prototype.uncleanArguments = function(operator, args, indent, show_con
1314
1314
/**
1315
1315
* Passed as arguments: 1) the operator (and, triple, not, opt, etc)
1316
1316
* 2) the value of the argument
1317
- * 3) the index (position) of the argument.
1317
+ * 3) the index (position) of the argument.
1318
1318
*/
1319
1319
WOQLQuery . prototype . uncleanArgument = function ( operator , val , index , allArgs ) {
1320
- //numeric values go out untouched...
1320
+ //numeric values go out untouched...
1321
1321
const numeric_operators = [ "limit" , "start" , "eval" , "plus" , "minus" , "times" , "divide" , "exp" , "div" ] ;
1322
1322
if ( operator == "isa" ) {
1323
1323
val = ( index == 0 ? this . unclean ( val , 'subject' ) : this . unclean ( val , 'class' ) ) ;
@@ -1516,18 +1516,17 @@ TripleBuilder.prototype.addPO = function(p, o, g){
1516
1516
else var ttype = "triple" ;
1517
1517
var evstr = ttype + '("' + this . subject + '", "' + p + '", ' ;
1518
1518
if ( typeof o == "string" ) {
1519
- evstr += "'" + o + "'" ;
1520
- }
1519
+ evstr += "'" + o + "'" ;
1520
+ }
1521
1521
else if ( typeof o == "object" ) {
1522
- console . log ( JSON . stringify ( o ) ) ;
1523
1522
evstr += JSON . stringify ( o ) ;
1524
1523
}
1525
1524
else {
1526
1525
evstr += o ;
1527
1526
}
1528
1527
if ( ttype . substring ( ttype . length - 4 ) == "quad" || this . g ) {
1529
1528
var g = ( g ? g : ( this . g ? this . g : "db:schema" ) ) ;
1530
- evstr += ', "' + g + '"' ;
1529
+ evstr += ', "' + g + '"' ;
1531
1530
}
1532
1531
evstr += ")" ;
1533
1532
try {
0 commit comments