orientdb-gremlin
orientdb-gremlin copied to clipboard
[BUG/Feature] Light Weight Edge Support
The implementation now will fail if the edge is a lightweight edge. Some configuration of a lightweight
flag should be introduced and traverse of edge should take it into consideration.
Some changes below seems work:
// OrientVertex.java, :65
if (fieldValue instanceof ORidBag) {
if (graph.isLightWeightEdge()) { // light weight branch
streamVertices.add(asStream(((ORidBag) fieldValue).rawIterator())
.map(oIdentifiable -> new OrientVertex(graph, oIdentifiable)));
} else { // original
streamVertices.add(asStream(((ORidBag) fieldValue).rawIterator())
.map(oIdentifiable -> new OrientEdge(graph, oIdentifiable.getRecord()))
.map(edge -> edge.vertices(direction.opposite()))
.flatMap(vertices -> asStream(vertices)));
}
}
Any suggestion?