Package com.gengoai.graph.io
Interface GraphWriter<V>
-
- Type Parameters:
V
- the vertex type
public interface GraphWriter<V>
Common interface for writing graphs from resources.
The vertices of the graph are first converted into an intermediate representation (
Vertex
), which defines a label and set of properties. Edges are translated into a property map.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
setEdgeEncoder(EdgeEncoder<V> encoder)
Sets the edge encoder.void
setVertexEncoder(VertexEncoder<V> encoder)
Sets the vertex encoderdefault void
write(Graph<V> graph, Resource location)
Writes the given graph to the give location in this format, using the defined vertex and edge encoders.void
write(Graph<V> graph, Resource location, Multimap<String,String> parameters)
Writes the given graph to the give location in this format, using the defined vertex and edge encoders.
-
-
-
Method Detail
-
setVertexEncoder
void setVertexEncoder(VertexEncoder<V> encoder)
Sets the vertex encoder- Parameters:
encoder
- the encoder
-
setEdgeEncoder
void setEdgeEncoder(EdgeEncoder<V> encoder)
Sets the edge encoder.- Parameters:
encoder
- the encoder
-
write
default void write(Graph<V> graph, Resource location) throws IOException
Writes the given graph to the give location in this format, using the defined vertex and edge encoders.- Parameters:
graph
- the graph to writelocation
- the location to write to- Throws:
IOException
- Something went wrong writing the graph
-
write
void write(Graph<V> graph, Resource location, Multimap<String,String> parameters) throws IOException
Writes the given graph to the give location in this format, using the defined vertex and edge encoders.- Parameters:
graph
- the graph to writelocation
- the location to write toparameters
- multimap of parameters used by the underling writer- Throws:
IOException
- Something went wrong writing the graph
-
-