Skip to content

Commit 04fba2a

Browse files
Remove arbitrary random casting
1 parent 449e3fd commit 04fba2a

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

lib/query/woqlCore.js

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,9 @@ WOQLQuery.prototype.cleanDataValue = function(o, t) {
336336
} else if (typeof o == 'number') {
337337
t = t || 'xsd:decimal'
338338
obj['data'] = this.jlt(o, t)
339+
} else if (typeof o == 'boolean') {
340+
t = t || 'xsd:boolean'
341+
obj['data'] = this.jlt(o, t)
339342
} else if (typeof o == 'object' && o) {
340343
if (o['@value']) obj['data'] = o
341344
else return o
@@ -370,34 +373,11 @@ WOQLQuery.prototype.cleanNodeValue = function(o, t) {
370373
obj['node'] = o
371374
}
372375
} else if (typeof o == 'object' && o) {
373-
if (o['@value']) obj['data'] = o
374-
else return o
376+
return o
375377
}
376378
return obj
377379
}
378380

379-
/*
380-
* check if can be a class in the object
381-
*/
382-
WOQLQuery.prototype.looksLikeClass = function(o) {
383-
//if it is like User or Person it is a class
384-
if (o.indexOf('v:') === -1) return true
385-
386-
let pref = o.split(':')[0]
387-
if (
388-
pref == 'csv' ||
389-
pref == 'v' ||
390-
pref == 'scm' ||
391-
pref == 'doc' ||
392-
pref == 'terminusdb' ||
393-
pref == 'http' ||
394-
pref == 'https'
395-
)return true
396-
397-
if (UTILS.standard_urls[pref]) return true
398-
return false
399-
}
400-
401381
/**
402382
* Transforms a graph filter or graph id into the proper json-ld form
403383
*/

0 commit comments

Comments
 (0)