Class OGraphSONReader
java.lang.Object
com.orientechnologies.orient.graph.graphml.OGraphSONReader
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidinputGraph(InputStream jsonInputStream) Input the JSON stream data into the graph.voidinputGraph(InputStream jsonInputStream, int bufferSize) voidinputGraph(InputStream jsonInputStream, int bufferSize, Set<String> edgePropertyKeys, Set<String> vertexPropertyKeys) Input the JSON stream data into the graph.voidinputGraph(String filename) Input the JSON stream data into the graph.voidinputGraph(String filename, int bufferSize) voidinputGraph(String filename, int bufferSize, Set<String> edgePropertyKeys, Set<String> vertexPropertyKeys) Input the JSON stream data into the graph.protected voidprintStatus(com.fasterxml.jackson.core.JsonParser jp, long importedVertices, long importedEdges) setOutput(OCommandOutputListener output)
-
Constructor Details
-
OGraphSONReader
public OGraphSONReader(com.tinkerpop.blueprints.Graph graph) - Parameters:
graph- the graph to populate with the JSON data
-
-
Method Details
-
inputGraph
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
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
- Throws:
IOException
-
inputGraph
- 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 databufferSize- 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 databufferSize- 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
-
setOutput
-
printStatus
protected void printStatus(com.fasterxml.jackson.core.JsonParser jp, long importedVertices, long importedEdges)
-