When querying the same data via memgraphlab with the following query:
MATCH p =(m:ProjLibMainNode)<-[:PROPERTIES_OF]-(n {PropStatus:"Current"})-[:REFERENCES]->(q)
WHERE n.ReviewStatus = "Approved" OR n.ReviewStatus = "Re-Opened"
RETURN n.Name, n.PropStatus, n.ReviewStatus
Results in 590 lines being returned
When trying to setup the equivalent query in python using gqlalchemy on the same data:
QGchecklist = list(
Match()
.node(variable="m", labels="ProjLibMainNode")
.from_(relationship_type="PROPERTIES_OF", directed=True)
.node(variable="n", labels="ProjLibPropNode")
.to(relationship_type="REFERENCES", directed=True)
.node(variable="q")
.where(item="n.PropStatus", operator=Operator.EQUAL, literal="Current")
.and_where(item="n.ReviewStatus", operator=Operator.EQUAL, literal="Approved")
.or_where(item="n.ReviewStatus", operator=Operator.EQUAL, literal="Re-Opened")
.return_(["n.Name, n.PropStatus", "n.ReviewStatus"])
.execute()
)
I get list with a size of 597, ie 598 rows.
The cypher looks like a nested: AND(Current(OR(Approved,Re-Opened)))
Whereas the GQAlchemy python query looks more like a AND(Current,Approved)OR(Re-Opened)
How do I correctly nest the AND OR in GQLAlchemy python to match the cypher?