@Override
    public void writeVertex(final OutputStream outputStream, final Vertex v, final Direction direction) throws IOException {
        mapper.writeValue(outputStream, new DirectionalStarGraph(StarGraph.of(v), direction));
    }
Writes a single {@link Vertex} to stream where edges only from the specified direction are written.
Under this serialization model, edges are grouped by label.

@param direction the direction of edges to write or null if no edges are to be written.
gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONWriter.java