Class OGraphMLReader
java.lang.Object
com.orientechnologies.orient.graph.graphml.OGraphMLReader
GraphMLReader writes the data from a GraphML stream to a graph. Derived from Blueprints
GraphMLReader. Supports also vertex labels.
- Author:
- Luca Garulli (l.garulli--(at)--orientdb.com) (l.garulli(at)orientdb.com), Marko A. Rodriguez (http://markorodriguez.com), Alex Averbuch (alex.averbuch-at-gmail.com), Joshua Shinavier (http://fortytwo.net)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondefineEdgeAttributeStrategy(String iAttributeName, OGraphMLImportStrategy iStrategy) Define custom strategy to use for edge attribute.defineVertexAttributeStrategy(String iAttributeName, OGraphMLImportStrategy iStrategy) Define custom strategy to use for vertex attribute.intintvoidinputGraph(com.tinkerpop.blueprints.Graph inputGraph, InputStream graphMLInputStream) Input the GraphML stream data into the graph.inputGraph(com.tinkerpop.blueprints.Graph inputGraph, InputStream graphMLInputStream, int bufferSize, String vertexIdKey, String edgeIdKey, String edgeLabelKey) Input the GraphML stream data into the graph.voidinputGraph(com.tinkerpop.blueprints.Graph inputGraph, String filename) Input the GraphML stream data into the graph.inputGraph(com.tinkerpop.blueprints.Graph inputGraph, String filename, int bufferSize, String vertexIdKey, String edgeIdKey, String edgeLabelKey) Input the GraphML stream data into the graph.inputGraph(InputStream graphMLInputStream) Input the GraphML stream data into the graph.inputGraph(InputStream graphMLInputStream, int bufferSize) Input the GraphML stream data into the graph.inputGraph(String filename) Input the GraphML stream data into the graph.inputGraph(String filename, int bufferSize) Input the GraphML stream data into the graph.booleanprotected voidprotected voidprintStatus(XMLStreamReader input, long importedVertices, long importedEdges) voidsetBatchSize(int batchSize) voidsetEdgeIdKey(String edgeIdKey) voidsetEdgeLabelKey(String edgeLabelKey) setOptions(Map<String, List<String>> opts) setOutput(OCommandOutputListener output) voidsetStoreVertexIds(boolean storeVertexIds) voidsetVertexIdKey(String vertexIdKey) voidsetVertexLabelIndex(int vertexLabelIndex)
-
Constructor Details
-
OGraphMLReader
- Parameters:
graph- the graph to populate with the GraphML data
-
-
Method Details
-
defineVertexAttributeStrategy
public OGraphMLReader defineVertexAttributeStrategy(String iAttributeName, OGraphMLImportStrategy iStrategy) Define custom strategy to use for vertex attribute.- Parameters:
iAttributeName- attribute nameiStrategy- strategy implementation
-
defineEdgeAttributeStrategy
public OGraphMLReader defineEdgeAttributeStrategy(String iAttributeName, OGraphMLImportStrategy iStrategy) Define custom strategy to use for edge attribute.- Parameters:
iAttributeName- attribute nameiStrategy- strategy implementation
-
inputGraph
public void inputGraph(com.tinkerpop.blueprints.Graph inputGraph, InputStream graphMLInputStream) throws IOException Input the GraphML stream data into the graph. In practice, usually the provided graph is empty.- Parameters:
inputGraph- the graph to populate with the GraphML datagraphMLInputStream- an InputStream of GraphML data- Throws:
IOException- thrown when the GraphML data is not correctly formatted
-
inputGraph
public void inputGraph(com.tinkerpop.blueprints.Graph inputGraph, String filename) throws IOException Input the GraphML stream data into the graph. In practice, usually the provided graph is empty.- Parameters:
inputGraph- the graph to populate with the GraphML datafilename- name of a file containing GraphML data- Throws:
IOException- thrown when the GraphML data is not correctly formatted
-
inputGraph
public OGraphMLReader inputGraph(com.tinkerpop.blueprints.Graph inputGraph, String filename, int bufferSize, String vertexIdKey, String edgeIdKey, String edgeLabelKey) throws IOException Input the GraphML stream data into the graph. More control over how data is streamed is provided by this method.- Parameters:
inputGraph- the graph to populate with the GraphML datafilename- name of a file containing GraphML databufferSize- the amount of elements to hold in memory before committing a transactions (only valid for TransactionalGraphs)vertexIdKey- if the id of a vertex is a <data/> property, fetch it from the data property.edgeIdKey- if the id of an edge is a <data/> property, fetch it from the data property.edgeLabelKey- if the label of an edge is a <data/> property, fetch it from the data property.- Throws:
IOException- thrown when the GraphML data is not correctly formatted
-
inputGraph
public OGraphMLReader inputGraph(com.tinkerpop.blueprints.Graph inputGraph, InputStream graphMLInputStream, int bufferSize, String vertexIdKey, String edgeIdKey, String edgeLabelKey) throws IOException Input the GraphML stream data into the graph. More control over how data is streamed is provided by this method.- Parameters:
inputGraph- the graph to populate with the GraphML datagraphMLInputStream- an InputStream of GraphML databufferSize- the amount of elements to hold in memory before committing a transactions (only valid for TransactionalGraphs)vertexIdKey- if the id of a vertex is a <data/> property, fetch it from the data property.edgeIdKey- if the id of an edge is a <data/> property, fetch it from the data property.edgeLabelKey- if the label of an edge is a <data/> property, fetch it from the data property.- Throws:
IOException- thrown when the GraphML data is not correctly formatted
-
getVertexLabelIndex
public int getVertexLabelIndex() -
setVertexLabelIndex
public void setVertexLabelIndex(int vertexLabelIndex) -
setVertexIdKey
- Parameters:
vertexIdKey- if the id of a vertex is a <data/> property, fetch it from the data property.
-
setEdgeIdKey
- Parameters:
edgeIdKey- if the id of an edge is a <data/> property, fetch it from the data property.
-
setEdgeLabelKey
- Parameters:
edgeLabelKey- if the label of an edge is a <data/> property, fetch it from the data property.
-
inputGraph
Input the GraphML stream data into the graph. In practice, usually the provided graph is empty.- Parameters:
graphMLInputStream- an InputStream of GraphML data- Throws:
IOException- thrown when the GraphML data is not correctly formatted
-
inputGraph
Input the GraphML stream data into the graph. In practice, usually the provided graph is empty.- Parameters:
filename- name of a file containing GraphML data- Throws:
IOException- thrown when the GraphML data is not correctly formatted
-
inputGraph
Input the GraphML stream data into the graph. In practice, usually the provided graph is empty.- Parameters:
graphMLInputStream- an InputStream of GraphML databufferSize- the amount of elements to hold in memory before committing a transactions (only valid for TransactionalGraphs)- Throws:
IOException- thrown when the GraphML data is not correctly formatted
-
inputGraph
Input the GraphML stream data into the graph. In practice, usually the provided graph is empty.- Parameters:
filename- name of a file containing GraphML databufferSize- the amount of elements to hold in memory before committing a transactions (only valid for TransactionalGraphs)- Throws:
IOException- thrown when the GraphML data is not correctly formatted
-
isStoreVertexIds
public boolean isStoreVertexIds() -
setStoreVertexIds
public void setStoreVertexIds(boolean storeVertexIds) -
setOptions
-
getBatchSize
public int getBatchSize() -
setBatchSize
public void setBatchSize(int batchSize) -
mapId
-
getOutput
-
setOutput
-
printStatus
-