Closed Yicheng-Wang closed 2 years ago
Confirmed this bug with master
branch (0.6.0). Tried the above queries with TinkerGraph and they work there but fail with JanusGraph.
I can confirm it too. Seems this is because JanusGraph requires the condition to be in QNF form. QNF for JanusGraph is a variant of CNF (conjunctive normal form) with negation inlined where possible. The failed query is translated into
eq(0.8446159d) OR (>= 0.22740966d AND <= 0.029379308d) which is not in QNF form, thus the exception.
At the moment I am not sure why JanusGraph requires QNF form...
UPDATE: all tests pass when I remove QNF checks: df4a5da0614927267cf1721a61bd2e973dedb2c7
I can confirm it too. Seems this is because JanusGraph requires the condition to be in QNF form. QNF for JanusGraph is a variant of CNF (conjunctive normal form) with negation inlined where possible. The failed query is translated into
eq(0.8446159d) OR (>= 0.22740966d AND <= 0.029379308d) which is not in QNF form, thus the exception.
At the moment I am not sure why JanusGraph requires QNF form...
UPDATE: all tests pass when I remove QNF checks: df4a5da
Thanks for your response~
While we encountered another query which raises IllegalArgumentException
, here is an example to reproduce:
Vertex Moly = g.addV("student").property("grade", 9).next();
Vertex notebook = g.addV("homework").property("subject", "Math").next();
Edge edge1 = g.addE("write").from(Moly).to(notebook).property("date","19980604").next();
String query0 = "g.E().has('date',inside('19980601','19980630').or(lt('19980101')))";
String query1 = "g.V().bothE('write').has('date',inside('19980601','19980630').or(lt('19980101')))";
query0 works, while query1 raises IllegalArgumentException
just as original issue, not sure whether they are caused by the same problem, so we ask here first, could you please help us with this? @li-boxuan
@Yicheng-Wang It is likely the same issue because I cannot reproduce it on master. Can you build JanusGraph again using latest master branch and try?
@Yicheng-Wang It is likely the same issue because I cannot reproduce it on master. Can you build JanusGraph again using latest master branch and try?
Thanks for your reply, maybe we will try using the next release.
Please include configurations and logs if available.
For confirmed bugs, please report:
"g.E().inV().outE('write').has('duration', eq(0.8446159d).or(outside(0.22740966d,0.029379308d)))"
"g.E().inV().outE('write').has('duration', eq(0.8446159d).or(not(outside(0.22740966d,0.029379308d))))"
These queries are illogical, because they are generated randomly just for test. However, we expecte both of them could be accepted in JanusGraph, as both queries within the same code could be accepted in Neo4j.IllegalArgumentException
raised in the second query.Steps to Reproduce:
Stack Trace (if you have one)