Skip to content
This repository was archived by the owner on Feb 5, 2020. It is now read-only.

Commit 9b94fe2

Browse files
committed
Correct comparison operators.
1 parent 0bc08f2 commit 9b94fe2

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/util/SparqlExpressionEvaluator.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ operators = {
158158
};
159159

160160
// Tag all operators that expect their arguments to be numeric
161+
// TODO: Comparison operators can take simple literals and strings as well
161162
[
162163
'+', '-', '*', '/', '<', '<=', '>', '>=',
163164
'http://www.w3.org/2001/XMLSchema#double',
@@ -174,14 +175,15 @@ operators = {
174175

175176
// Tag all operators that have numeric results
176177
[
177-
'+', '-', '*', '/', '<', '<=', '>', '>=',
178+
'+', '-', '*', '/',
178179
].forEach(function (operatorName) {
179-
operators[operatorName].type = operators[operatorName].resultType = 'numeric';
180+
operators[operatorName].resultType = 'numeric';
180181
});
181182

182183
// Tag all operators that have boolean results
183184
[
184-
'!', '&&', '||', '=', '<', '<=', '>', '>=', 'langmatches', 'contains', 'regex',
185+
'!', '&&', '||', '=', '!=', '<', '<=', '>', '>=',
186+
'langmatches', 'contains', 'regex',
185187
].forEach(function (operatorName) {
186188
operators[operatorName].resultType = 'boolean';
187189
});

0 commit comments

Comments
 (0)