@@ -155,19 +155,6 @@ WOQLQuery.prototype.asv = function(colname_or_index, vname, type) {
155
155
return asvar
156
156
}
157
157
158
- /**
159
- * Adds a variable to a json-ld as variable list
160
- */
161
- WOQLQuery . prototype . addASV = function ( cursor , asv ) {
162
- if ( asv [ '@type' ] == 'IndexedAsVar' ) {
163
- if ( ! cursor [ 'indexed_as_var' ] ) cursor [ 'indexed_as_var' ] = [ ]
164
- cursor [ 'indexed_as_var' ] . push ( asv )
165
- } else {
166
- if ( ! cursor [ 'named_as_var' ] ) cursor [ 'named_as_var' ] = [ ]
167
- cursor [ 'named_as_var' ] . push ( asv )
168
- }
169
- }
170
-
171
158
/**
172
159
* JSON LD Format Descriptor
173
160
* @param {object } opts
@@ -320,18 +307,17 @@ WOQLQuery.prototype.cleanPathPredicate = function(p) {
320
307
WOQLQuery . prototype . cleanObject = function ( o , t ) {
321
308
let obj = { '@type' : 'Value' }
322
309
if ( typeof o === 'string' ) {
323
- if ( this . looksLikeClass ( o ) ) {
324
- return this . cleanClass ( o )
325
- } else if ( this . vocab && this . vocab [ o ] ) {
326
- return this . cleanClass ( this . vocab [ o ] )
327
- } else if ( s . indexOf ( 'v:' ) !== - 1 ) {
310
+ if ( o . indexOf ( 'v:' ) !== - 1 ) {
328
311
return this . expandValueVariable ( o )
329
312
} else {
330
- obj [ 'data ' ] = this . jlt ( o , t )
313
+ obj [ 'node ' ] = o
331
314
}
332
315
} else if ( typeof o == 'number' ) {
333
316
t = t || 'xsd:decimal'
334
317
obj [ 'data' ] = this . jlt ( o , t )
318
+ } else if ( typeof o == 'boolean' ) {
319
+ t = t || 'xsd:boolean'
320
+ obj [ 'data' ] = this . jlt ( o , t )
335
321
} else if ( typeof o == 'object' && o ) {
336
322
if ( o [ '@value' ] ) obj [ 'data' ] = o
337
323
else return o
0 commit comments