@Override
    public Iterator<Edge> edges(final Object... edgeIds) {
        this.tx().readWrite();
        if (0 == edgeIds.length) {
            return IteratorUtils.stream(this.getBaseGraph().allRelationships())
                    .map(relationship -> (Edge) new Neo4jEdge(relationship, this)).iterator();
        } else {
            return Stream.of(edgeIds)
                    .map(id -> {
                        if (id instanceof Number)
                            return ((Number) id).longValue();
                        else if (id instanceof String)
                            return Long.valueOf(id.toString());
                        else if (id instanceof Edge && ((Edge) id).id() instanceof Number)
                            return ((Number) ((Edge) id).id()).longValue();
                        else if (null == id)
                            return null;
                        else
                            throw new IllegalArgumentException("Unknown edge id type: " + id);
                    })
                    .flatMap(id -> {
                        // can't have a null id so just filter
                        if (null == id) return Stream.empty();
                        try {
                            return Stream.of(this.baseGraph.getRelationshipById(id));
                        } catch (final RuntimeException e) {
                            if (Neo4jHelper.isNotFound(e)) return Stream.empty();
                            throw e;
                        }
                    })
                    .map(relationship -> (Edge) new Neo4jEdge(relationship, this)).iterator();
        }
    }
Construct a Neo4jGraph instance using an existing Neo4j raw instance.
neo4j-gremlin/src/main/java/org/apache/tinkerpop/gremlin/neo4j/structure/Neo4jGraph.java