I am using OrientDB 'match' to get a path (on the graph) according to a criteria, but I get a result path that doesn't exist.
I have a "Person" vertex that has a "PhoneCall" edge to another "Person" vertex - only one path should be a match! so I expext to get as a result: vertex1-edgeX-vertex2 For example - "jonn Smith --phoneCallX-- dan smith"
What I actually get is 2 pathes:
- vertex1-edgeX-vertex2 (jonn Smith --phoneCallX-- dan smith) but also:
- vertex1-edgeX-vertex1 - it is not true since it is the same edge-@rid from the first result and also it is NOT a self edge: jonn Smith --phoneCallX-- jonn Smith
The query:
MATCH {class:person, as:E1, where:( ( firstName IN ['John'] ) )}.bothE(){class:phoneCall, as:R0}.bothV(){class:person, as:E0, where:( ( lastName IN ['Smith'] ) )} RETURN $paths
I think it is happening because of the "both()" method with the fact that the first vertex apply to both filters:
- firstName IN ['John']
- List item lastName IN ['Smith']
But still - I meant to find all paths of "John-phoneCall-Smith" and I got an edge (that doesn't exist) between this John to himself just because his name is Smith (which should be the condition of the OTHER entity of this relation) )
Please help me - what do I do wrong?