@@ -29,14 +29,14 @@ const typedef = require('../typedef');
2929
3030// I HAVE TO REVIEW THE Inheritance and the prototype chain
3131class 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+ */
4040
4141 /**
4242 * Update a pattern matching rule for the triple (Subject, Predicate, oldObjValue) with the
@@ -373,7 +373,7 @@ WOQLQuery.prototype.and = function (...subqueries) {
373373 const onevar = this . jobj ( subqueries [ i ] ) ;
374374 if (
375375 onevar [ '@type' ] === 'And'
376- && onevar . and
376+ && onevar . and
377377 ) {
378378 for ( let j = 0 ; j < onevar . and . length ; j ++ ) {
379379 const qjson = onevar . and [ j ] ;
@@ -421,17 +421,14 @@ WOQLQuery.prototype.or = function (...subqueries) {
421421 */
422422
423423WOQLQuery . prototype . from = function ( graphRef , query ) {
424- // if (graph && graph === 'args')
425- // return ['graph', 'query']
426424 if ( this . cursor [ '@type' ] ) this . wrapCursorWithAnd ( ) ;
427425 this . cursor [ '@type' ] = 'From' ;
428- // FIXME: Fix the typeof check that should be graphRef, not graph
429- if ( ! graphRef || typeof graph !== 'string' ) {
426+ if ( ! graphRef || typeof graphRef !== 'string' ) {
430427 return this . parameterError (
431428 'The first parameter to from must be a Graph Filter Expression (string)' ,
432429 ) ;
433430 }
434- this . cursor . graph = graphRef ;
431+ this . cursor . graph = this . jlt ( graphRef ) ;
435432 return this . addSubQuery ( query ) ;
436433} ;
437434
@@ -1489,7 +1486,7 @@ WOQLQuery.prototype.order_by = function (...orderedVarlist) {
14891486 ) ;
14901487 }
14911488 const embedquery = typeof orderedVarlist [ orderedVarlist . length - 1 ] === 'object'
1492- && orderedVarlist [ orderedVarlist . length - 1 ] . json
1489+ && orderedVarlist [ orderedVarlist . length - 1 ] . json
14931490 ? orderedVarlist . pop ( )
14941491 : false ;
14951492
0 commit comments