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
Schema query error: SERVER ERROR: Not well formed WOQL JSON-LD
#2077
Comments
Good find. The documentation mentions both triple and quad forms for this query. I think this is a bug indeed, or a client issue. For others seeing this later, check the documentation and use the quad style for now, but there are situations where there are many operations in the schema that really needs the Great catch @alexander-mart |
This is a client bug, the generated JSON is: {"@type":"Limit","limit":10,
"query":{"@type":"And",
"and":[{"@type":"From"},
{"@type":"Triple",
"subject":{"@type":"NodeValue","variable":"cls"},
"predicate":{"@type":"NodeValue","node":"rdf:type"},
"object":{"@type":"Value","node":"sys:Class"}}]}} Fluent syntax apparently does not work here, You can use the two argument call to from for now, and we can fix the documentation, but it would probably be nice if the fluent syntax worked to generate the right code here. |
I'd like to just check my understanding so that I interpret the fluent style correctly, the fluent style continuation is from my understanding always an extra appended parameter to the argument list? I was thinking about this for the WOQL-TS client and what was the correct interpretation. Should thus the below be what should be in the doc link? let v = Vars("cls");
from("schema", WOQL.triple(v.cls, "rdf:type", "sys:Class")) With triple being the last argument of |
Yes, for example convention in Ramda (Functional Programming JS-library):The primary distinguishing features of Ramda are:
The last two points together make it very easy to build functions as sequences of simpler functions, each of which transforms the data and passes it along to the next. Ramda is designed to support this style of coding. Source: https://ramdajs.com/ How is currying work:These queries should be identical (if
|
For those who are looking for a solution 👍 WOQL.quad("v:cls", "rdf:type", "sys:Class", "schema") See: https://terminusdb.com/docs/javascript/#fromgraphrefquery Instead of from("schema", triple("v:cls", "rdf:type", "sys:Class")) |
Describe the bug
Schema query error:
SERVER ERROR: Not well formed WOQL JSON-LD
To Reproduce
SERVER ERROR: Not well formed WOQL JSON-LD
Expected behavior
—
Screenshots
—
Info (please complete the following information):
?
Additional context
—
The text was updated successfully, but these errors were encountered: