@@ -29,14 +29,14 @@ const typedef = require('../typedef');
29
29
30
30
// I HAVE TO REVIEW THE Inheritance and the prototype chain
31
31
class WOQLQuery extends WOQLCore {
32
- /**
33
- * defines the internal functions of the woql query object - the
34
- * language API is defined in WOQLQuery
35
- * @module WOQLQuery
36
- * @constructor
37
- * @param {object } [query] json-ld query for initialisation
38
- * @returns {WOQLQuery }
39
- */
32
+ /**
33
+ * defines the internal functions of the woql query object - the
34
+ * language API is defined in WOQLQuery
35
+ * @module WOQLQuery
36
+ * @constructor
37
+ * @param {object } [query] json-ld query for initialisation
38
+ * @returns {WOQLQuery }
39
+ */
40
40
41
41
/**
42
42
* Update a pattern matching rule for the triple (Subject, Predicate, oldObjValue) with the
@@ -373,7 +373,7 @@ WOQLQuery.prototype.and = function (...subqueries) {
373
373
const onevar = this . jobj ( subqueries [ i ] ) ;
374
374
if (
375
375
onevar [ '@type' ] === 'And'
376
- && onevar . and
376
+ && onevar . and
377
377
) {
378
378
for ( let j = 0 ; j < onevar . and . length ; j ++ ) {
379
379
const qjson = onevar . and [ j ] ;
@@ -421,16 +421,14 @@ WOQLQuery.prototype.or = function (...subqueries) {
421
421
*/
422
422
423
423
WOQLQuery . prototype . from = function ( graphRef , query ) {
424
- // if (graph && graph === 'args')
425
- // return ['graph', 'query']
426
424
if ( this . cursor [ '@type' ] ) this . wrapCursorWithAnd ( ) ;
427
425
this . cursor [ '@type' ] = 'From' ;
428
- if ( ! graphRef || typeof graph !== 'string' ) {
426
+ if ( ! graphRef || typeof graphRef !== 'string' ) {
429
427
return this . parameterError (
430
428
'The first parameter to from must be a Graph Filter Expression (string)' ,
431
429
) ;
432
430
}
433
- this . cursor . graph = graphRef ;
431
+ this . cursor . graph = this . jlt ( graphRef ) ;
434
432
return this . addSubQuery ( query ) ;
435
433
} ;
436
434
@@ -1487,7 +1485,7 @@ WOQLQuery.prototype.order_by = function (...orderedVarlist) {
1487
1485
) ;
1488
1486
}
1489
1487
const embedquery = typeof orderedVarlist [ orderedVarlist . length - 1 ] === 'object'
1490
- && orderedVarlist [ orderedVarlist . length - 1 ] . json
1488
+ && orderedVarlist [ orderedVarlist . length - 1 ] . json
1491
1489
? orderedVarlist . pop ( )
1492
1490
: false ;
1493
1491
0 commit comments