> what's an example of the "same edges with two directions"?

Such as there are two vertices: `person1` and `person2`, one edge with id 
"follow_1_2" linked from `person1` to `person2`, it can be expressed like this: 
`person1 -- follow -> person2`.
When querying edges from vertex `person1` by `g.V(person1).outE()`, got an edge 
with OUT direction:
  `person1 -- follow -> person2`
and querying edges from vertex `person2` by `g.V(person2).inE()`, got an edge 
with IN direction:
  `person2 <- follow -- person1`. 
These two edges are essentially one edge, so it makes sense their comparison 
should be equal, but it's not equal for StarOutEdge and StarInEdge, no such 
issue for TinkerEdge.

There seem to be 2 ways to fix OUT & IN StarEdge comparison:

1. Override edge id of StarEdge, like [add StarEdgeId 
class](https://github.com/apache/tinkerpop/pull/1224/commits/8f604df919bdb9452068eb7ea41273e7aee5b2a7).
 (but there are still some problems: not registered kryo)
  ```c
org.apache.tinkerpop.gremlin.driver.exception.ResponseException: Error during 
serialization: java.lang.IllegalArgumentException: Class is not registered: 
org.apache.tinkerpop.gremlin.structure.util.star.StarGraph$StarEdgeId
Note: To register this class use: 
kryo.register(org.apache.tinkerpop.gremlin.structure.util.star.StarGraph$StarEdgeId.class);
        at 
org.apache.tinkerpop.gremlin.server.GremlinResultSetIntegrateTest.shouldHandleTinkerGraphResult(GremlinResultSetIntegrateTest.java:207)
Caused by: org.apache.tinkerpop.gremlin.driver.exception.ResponseException: 
Error during serialization: java.lang.IllegalArgumentException: Class is not 
registered: 
org.apache.tinkerpop.gremlin.structure.util.star.StarGraph$StarEdgeId
Note: To register this class use: 
kryo.register(org.apache.tinkerpop.gremlin.structure.util.star.StarGraph$StarEdgeId.class);
```
2. Override StarEdge equals()

Which way is better, or any other ideas?

[ Full content available at: https://github.com/apache/tinkerpop/pull/1224 ]
This message was relayed via gitbox.apache.org for [email protected]

Reply via email to