Skip to content

SYNTAX ERROR: WOQL.limit(...).evaluate is not a function #317

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

Open
alexander-mart opened this issue Apr 4, 2025 · 4 comments
Open

SYNTAX ERROR: WOQL.limit(...).evaluate is not a function #317

alexander-mart opened this issue Apr 4, 2025 · 4 comments
Labels
bug Something isn't working documentation Improvements or additions to documentation triage issue to be triage

Comments

@alexander-mart
Copy link
Contributor

Describe the bug
Error on using evaluate() instead of eval() from terminusdb-dashboard

To Reproduce
Attempt to call evaluate() in chain-style from limit():

WOQL.limit(100).evaluate(WOQL.times(2,3), "v:result")

Return query-parser error:
SYNTAX ERROR: WOQL.limit(...).evaluate is not a function

But

WOQL.limit(100).eval(WOQL.times(2,3), "v:result")

Successful return:

[
  {
    "result": {
      "@type": "xsd:decimal",
      "@value": 6
    }
  }
]

Expected behavior

Return result:

[
  {
    "result": {
      "@type": "xsd:decimal",
      "@value": 6
    }
  }
]

Screenshots
...

Info (please complete the following information):

  • terminus-server from docker-compose: terminusdb/terminusdb-server:latest

Additional context

There is no mention of evaluate here:
https://github.com/terminusdb/terminusdb/blob/main/src/core/query/json_woql.pl

Or there:
https://github.com/search?q=repo%3Aterminusdb%2Fterminusdb%20evaluate&type=code

But this is answer to why is evaluate was not found:
https://github.com/terminusdb/terminusdb-client-js/blob/main/lib/woql.js#L487

because only eval WOQL-method is exist, and evaluate() is only alias to eval()

See more about math operators in documentation:
https://terminusdb.com/docs/maths-based-queries-in-woql/

@alexander-mart
Copy link
Contributor Author

@hoijnet @GavinMendelGleason This is still a live bug in terminusdb-client-js v10.0.33

I added a test to terminusdb-client-js to check this:
#315

How can we fix it?
Please give me some direction so I can get started

@alexander-mart
Copy link
Contributor Author

Similar issue: #318

@alexander-mart
Copy link
Contributor Author

alexander-mart commented Apr 24, 2025

Answer to #315 (comment)

@hoijnet Test failing without any server (if I'm not mistaken), only with
https://github.com/terminusdb/terminusdb-client-js/pull/315/files

  149 passing (177ms)
  1 failing

  1) woql queries
       check limit().evaluate():
     TypeError: WOQL.limit(...).evaluate is not a function
      at Context.<anonymous> (test/woql.spec.js:503:40)
      at processImmediate (node:internal/timers:478:21)

I'll clarify again that I'm on the tag v.10.0.33 of terminusdb-client-js and this my new test will fail

@hoijnet hoijnet transferred this issue from terminusdb/terminusdb Apr 26, 2025
@hoijnet
Copy link
Collaborator

hoijnet commented Apr 26, 2025

@alexander-mart , I transferred this issue to the client from terminusdb/terminusdb

@github-actions github-actions bot added documentation Improvements or additions to documentation triage issue to be triage labels Apr 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation triage issue to be triage
Projects
None yet
Development

No branches or pull requests

2 participants