public final class GraphMLReader extends Object implements GraphReader
GraphMLReader
writes the data from a GraphML stream to a graph. Note that this format is lossy, in the
sense that data types and features of Gremlin Structure not supported by GraphML are not serialized. This format
is meant for external export of a graph to tools outside of Gremlin Structure graphs. Note that GraphML does not
support the notion of multi-properties or properties on properties.Modifier and Type | Class and Description |
---|---|
static class |
GraphMLReader.Builder
Allows configuration and construction of the GraphMLReader instance.
|
GraphReader.ReaderBuilder<T extends GraphReader>
Modifier and Type | Method and Description |
---|---|
static GraphMLReader.Builder |
build() |
Edge |
readEdge(InputStream inputStream,
Function<Attachable<Edge>,Edge> edgeAttachMethod)
This method is not supported for this reader.
|
void |
readGraph(InputStream graphInputStream,
Graph graphToWriteTo)
Reads an entire graph from an
InputStream . |
<C> C |
readObject(InputStream inputStream,
Class<? extends C> clazz)
This method is not supported for this reader.
|
Property |
readProperty(InputStream inputStream,
Function<Attachable<Property>,Property> propertyAttachMethod)
This method is not supported for this reader.
|
Vertex |
readVertex(InputStream inputStream,
Function<Attachable<Vertex>,Vertex> vertexAttachMethod)
This method is not supported for this reader.
|
Vertex |
readVertex(InputStream inputStream,
Function<Attachable<Vertex>,Vertex> vertexAttachMethod,
Function<Attachable<Edge>,Edge> edgeAttachMethod,
Direction attachEdgesOfThisDirection)
This method is not supported for this reader.
|
VertexProperty |
readVertexProperty(InputStream inputStream,
Function<Attachable<VertexProperty>,VertexProperty> vertexPropertyAttachMethod)
This method is not supported for this reader.
|
Iterator<Vertex> |
readVertices(InputStream inputStream,
Function<Attachable<Vertex>,Vertex> vertexAttachMethod,
Function<Attachable<Edge>,Edge> edgeAttachMethod,
Direction attachEdgesOfThisDirection)
This method is not supported for this reader.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
readVertex
public void readGraph(InputStream graphInputStream, Graph graphToWriteTo) throws IOException
GraphReader
InputStream
. This method is mean to load an empty Graph
.
It is up to individual implementations to manage transactions, but it is not required or enforced. Consult
the documentation of an implementation to understand the approach it takes.readGraph
in interface GraphReader
graphInputStream
- a stream containing an entire graph of vertices and edges as defined by the accompanying
GraphWriter.writeGraph(OutputStream, Graph)
.graphToWriteTo
- the graph to write to when reading from the stream.IOException
public Iterator<Vertex> readVertices(InputStream inputStream, Function<Attachable<Vertex>,Vertex> vertexAttachMethod, Function<Attachable<Edge>,Edge> edgeAttachMethod, Direction attachEdgesOfThisDirection) throws IOException
readVertices
in interface GraphReader
inputStream
- a stream containing at least one Vertex
as defined by the accompanying
GraphWriter.writeVertices(OutputStream, Iterator, Direction)
or
GraphWriter.writeVertices(OutputStream, Iterator)
methods.vertexAttachMethod
- a function that creates re-attaches a Vertex
to a Host
object.edgeAttachMethod
- a function that creates re-attaches a Edge
to a Host
object.attachEdgesOfThisDirection
- only edges of this direction are passed to the edgeMaker
.UnsupportedOperationException
- when called.IOException
public Vertex readVertex(InputStream inputStream, Function<Attachable<Vertex>,Vertex> vertexAttachMethod) throws IOException
readVertex
in interface GraphReader
inputStream
- a stream containing at least a single vertex as defined by the accompanying
GraphWriter.writeVertex(OutputStream, Vertex)
.vertexAttachMethod
- a function that creates re-attaches a Vertex
to a Host
object.UnsupportedOperationException
- when called.IOException
public Vertex readVertex(InputStream inputStream, Function<Attachable<Vertex>,Vertex> vertexAttachMethod, Function<Attachable<Edge>,Edge> edgeAttachMethod, Direction attachEdgesOfThisDirection) throws IOException
readVertex
in interface GraphReader
inputStream
- a stream containing at least one Vertex
as defined by the accompanying
GraphWriter.writeVertices(OutputStream, Iterator, Direction)
method.vertexAttachMethod
- a function that creates re-attaches a Vertex
to a Host
object.edgeAttachMethod
- a function that creates re-attaches a Edge
to a Host
object.attachEdgesOfThisDirection
- only edges of this direction are passed to the edgeMaker
.UnsupportedOperationException
- when called.IOException
public Edge readEdge(InputStream inputStream, Function<Attachable<Edge>,Edge> edgeAttachMethod) throws IOException
readEdge
in interface GraphReader
inputStream
- a stream containing at least one Edge
as defined by the accompanying
GraphWriter.writeEdge(OutputStream, Edge)
method.edgeAttachMethod
- a function that creates re-attaches a Edge
to a Host
object.UnsupportedOperationException
- when called.IOException
public VertexProperty readVertexProperty(InputStream inputStream, Function<Attachable<VertexProperty>,VertexProperty> vertexPropertyAttachMethod) throws IOException
readVertexProperty
in interface GraphReader
inputStream
- a stream containing at least one VertexProperty
as written by the accompanying
GraphWriter.writeVertexProperty(OutputStream, VertexProperty)
method.vertexPropertyAttachMethod
- a function that creates re-attaches a VertexProperty
to a
Host
object.UnsupportedOperationException
- when called.IOException
public Property readProperty(InputStream inputStream, Function<Attachable<Property>,Property> propertyAttachMethod) throws IOException
readProperty
in interface GraphReader
inputStream
- a stream containing at least one Property
as written by the accompanying
GraphWriter.writeProperty(OutputStream, Property)
method.propertyAttachMethod
- a function that creates re-attaches a Property
to a Host
object.UnsupportedOperationException
- when called.IOException
public <C> C readObject(InputStream inputStream, Class<? extends C> clazz) throws IOException
readObject
in interface GraphReader
inputStream
- a stream containing an object.clazz
- the class expected to be in the stream - may or may not be used by the underlying implementation.UnsupportedOperationException
- when called.IOException
public static GraphMLReader.Builder build()
Copyright © 2013–2022 Apache Software Foundation. All rights reserved.