
com.tinkerpop.gremlin.structure.io.GraphReader Maven / Gradle / Ivy
package com.tinkerpop.gremlin.structure.io;
import com.tinkerpop.gremlin.structure.Direction;
import com.tinkerpop.gremlin.structure.Edge;
import com.tinkerpop.gremlin.structure.Graph;
import com.tinkerpop.gremlin.structure.Vertex;
import com.tinkerpop.gremlin.util.function.SQuintFunction;
import com.tinkerpop.gremlin.util.function.STriFunction;
import java.io.IOException;
import java.io.InputStream;
import java.util.Iterator;
/**
* Functions for reading a graph and its graph elements from a different format.
*
* @author Stephen Mallette (http://stephen.genoprime.com)
*/
public interface GraphReader {
/**
* Reads an entire graph from an {@link InputStream}.
*
* @param inputStream a stream containing a single vertex as defined by the accompanying {@link GraphWriter}
*/
public void readGraph(final InputStream inputStream, final Graph graphToWriteTo) throws IOException;
/**
* Reads a single vertex from an {@link InputStream}. This method will read vertex properties but not edges.
*
* @param inputStream a stream containing a single vertex as defined by the accompanying {@link GraphWriter}
* @param vertexMaker a function to create a vertex where the first argument is the vertex identifier, the
* second argument is vertex label and the last is the list of properties for it
*/
public Vertex readVertex(final InputStream inputStream, final STriFunction
© 2015 - 2025 Weber Informatics LLC | Privacy Policy