orientdb-gremlin icon indicating copy to clipboard operation
orientdb-gremlin copied to clipboard

[BUG/Feature] Light Weight Edge Support

Open du00cs opened this issue 7 years ago • 0 comments

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?

du00cs avatar Feb 27 '17 08:02 du00cs