Description
Not sure what's happening but this traversal does not return any results with gremlin-python:
gremlin> g.V().hasLabel("person").has("age", P.not(P.lte(10).and(P.not(P.between(11, 20)))).and(P.lt(29).or(P.eq(35)))).values("name") ==>vadas ==>peter
When looking at the bytecode the python bytecode is different from the java bytecode. The java bytecode for the predicate is:
{ "@type": "g:P", "@value": { "predicate": "and", "value": [{ "@type": "g:P", "@value": { "predicate": "or", "value": [{ "@type": "g:P", "@value": { "predicate": "gt", "value": { "@type": "g:Int32", "@value": 10 } } }, { "@type": "g:P", "@value": { "predicate": "and", "value": [{ "@type": "g:P", "@value": { "predicate": "gte", "value": { "@type": "g:Int32", "@value": 11 } } }, { "@type": "g:P", "@value": { "predicate": "lt", "value": { "@type": "g:Int32", "@value": 20 } } }] } }] } }, { "@type": "g:P", "@value": { "predicate": "or", "value": [{ "@type": "g:P", "@value": { "predicate": "lt", "value": { "@type": "g:Int32", "@value": 29 } } }, { "@type": "g:P", "@value": { "predicate": "eq", "value": { "@type": "g:Int32", "@value": 35 } } }] } }] } }
The python bytecode is:
{ "@type": "g:P", "@value": { "predicate": "and", "value": [{ "@type": "g:P", "@value": { "predicate": "not", "value": { "@type": "g:P", "@value": { "predicate": "and", "value": [{ "@type": "g:P", "@value": { "predicate": "lte", "value": { "@type": "g:Int64", "@value": 10 } } }, { "@type": "g:P", "@value": { "predicate": "not", "value": { "@type": "g:P", "@value": { "predicate": "between", "value": [{ "@type": "g:Int64", "@value": 11 }, { "@type": "g:Int64", "@value": 20 }] } } } }] } } } }, { "@type": "g:P", "@value": { "predicate": "or", "value": [{ "@type": "g:P", "@value": { "predicate": "lt", "value": { "@type": "g:Int64", "@value": 29 } } }, { "@type": "g:P", "@value": { "predicate": "eq", "value": { "@type": "g:Int64", "@value": 35 } } }] } }] } }
This fix should likely be applied as part of TINKERPOP-1857 (or after it is merged) as there were a few modifications in that branch around P to resolve other issues.