Class OGraphSONReader

java.lang.Object
com.orientechnologies.orient.graph.graphml.OGraphSONReader

public class OGraphSONReader extends Object
GraphSONReader reads the data from a TinkerPop JSON stream to a graph.
Author:
Stephen Mallette (http://stephen.genoprime.com), Luca Garulli (l.garulli--(at)--orientdb.com)
  • Constructor Details

    • OGraphSONReader

      public OGraphSONReader(com.tinkerpop.blueprints.Graph graph)
      Parameters:
      graph - the graph to populate with the JSON data
  • Method Details

    • inputGraph

      public void inputGraph(InputStream jsonInputStream) throws IOException
      Input the JSON stream data into the graph. In practice, usually the provided graph is empty.
      Parameters:
      jsonInputStream - an InputStream of JSON data
      Throws:
      IOException - thrown when the JSON data is not correctly formatted
    • inputGraph

      public void inputGraph(String filename) throws IOException
      Input the JSON stream data into the graph. In practice, usually the provided graph is empty.
      Parameters:
      filename - name of a file of JSON data
      Throws:
      IOException - thrown when the JSON data is not correctly formatted
    • inputGraph

      public void inputGraph(InputStream jsonInputStream, int bufferSize) throws IOException
      Throws:
      IOException
    • inputGraph

      public void inputGraph(String filename, int bufferSize) throws IOException
      Throws:
      IOException
    • inputGraph

      public void inputGraph(String filename, int bufferSize, Set<String> edgePropertyKeys, Set<String> vertexPropertyKeys) throws IOException
      Input the JSON stream data into the graph. More control over how data is streamed is provided by this method.
      Parameters:
      filename - name of a file of JSON data
      bufferSize - the amount of elements to hold in memory before committing a transactions (only valid for TransactionalGraphs)
      Throws:
      IOException - thrown when the JSON data is not correctly formatted
    • inputGraph

      public void inputGraph(InputStream jsonInputStream, int bufferSize, Set<String> edgePropertyKeys, Set<String> vertexPropertyKeys) throws IOException
      Input the JSON stream data into the graph. More control over how data is streamed is provided by this method.
      Parameters:
      jsonInputStream - an InputStream of JSON data
      bufferSize - the amount of elements to hold in memory before committing a transactions (only valid for TransactionalGraphs)
      Throws:
      IOException - thrown when the JSON data is not correctly formatted
    • getOutput

      public OCommandOutputListener getOutput()
    • setOutput

      public OGraphSONReader setOutput(OCommandOutputListener output)
    • printStatus

      protected void printStatus(com.fasterxml.jackson.core.JsonParser jp, long importedVertices, long importedEdges)