-
Notifications
You must be signed in to change notification settings - Fork 114
SERVER ERROR: Not well formed WOQL JSON-LD #2156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SERVER ERROR: Not well formed WOQL JSON-LD #2156
Comments
I was quickly checking it, could you provide the similar output for the working example too for the similar query without js-style variables bindings (I.e. v:var notation)? It would help troubleshoot so that we can see the diff and see what needs to be done? |
I suspect this should be moved to the javascript client but let's confirm first! |
@hoijnet I updated the issue |
Thanks a lot, also for the diff. Should be possible to fix in the client and roll with the next release of it I hope! |
It's also working: let v = Vars("result1", "result2");
and(
evaluate(times(2,3), v.result1),
evaluate(times("v:result1",3), v.result2)
) But not this: let v = Vars("result1", "result2");
and(
evaluate(times(2,3), v.result1),
evaluate(times(v.result1,3), v.result2)
) And this is problem with every math operation: let v = Vars("result1", "result2");
and(
evaluate(minus(2,3), v.result1),
evaluate(minus(v.result1,3), v.result2)
) |
I did a first pass at checking it and there seems to be more to it than the example code, for which there is a clue in your diff. This works: let v = Vars("result1", "result2");
WOQL.limit(10).and(
WOQL.evaluate(WOQL.times(2,3), v.result1),
WOQL.evaluate(WOQL.times(v.result1,3), v.result2)
); This also works: let v = Vars("result1", "result2");
WOQL.limit(10).limit(10).and(
WOQL.evaluate(WOQL.times(2,3), v.result1),
WOQL.evaluate(WOQL.times(v.result1,3), v.result2)
); This works: let v = Vars("result1", "result2");
WOQL.count("v:Count").and(
WOQL.evaluate(WOQL.times(2,3), v.result1),
WOQL.evaluate(WOQL.times(v.result1,3), v.result2)
); This also works: let v = Vars("result1", "result2", "Count");
WOQL.count("v:Count").and(
WOQL.evaluate(WOQL.times(2,3), v.result1),
WOQL.evaluate(WOQL.times(v.result1,3), v.result2)
); This also works (as shown): WOQL.and(
WOQL.evaluate(WOQL.times(2,3), v.result1),
WOQL.evaluate(WOQL.times(v.result1,3), v.result2)
); Count you confirm that it is together with I have not been able to reproduce the issue getting "Value" with the example provided. The example provided does not correspond 1:1 with the WOQL output as there are multiple instances of Limit and Count that are not part of the original WOQL query. I'm unsure about why Value pops up instead of ArithmeticValue as I don't have an immediate explanation in the javascript code. Can you also confirm that you are using the latest client to rule out that potential issue. |
@hoijnet I added a PR to fix this completely. In the PR description I attach a test with proof that it works. |
@alexander-mart , please check if you get the same behaviour with eval() as you get with evaluate()? I believe evaluate() should be deprecated and there should be only one, and well-functioning arithmetic evaluation, are you of the same view? |
With With |
Ok, that sounds promising! I assume this issue refers to the dashboard component and that we should rebuild it with the latest client then? |
Yes it is. |
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Query from documentation about math operators with js-style variables binding:
❌ Return:
Request payload from devtools:
Response from devtools:
But similar query without js-style variables bindings:
✅ Return correct result:
Request payload from devtools:
Difference between non-working (
-
) and working (+
) requestExpected behavior
Screenshots
...
Info (please complete the following information):
terminusdb/terminusdb-server:v11.1.14
Additional context
Can't use
times()
and all of other math WOQL methods as described in the documentation with error:SERVER ERROR: The query you have sent has no viable mode. Some variables can not be bound under any reordering.
#2076SYNTAX ERROR: WOQL.limit(...).evaluate is not a function terminusdb-client-js#317
The text was updated successfully, but these errors were encountered: