Interface GraphWriter<V>

  • Type Parameters:
    V - the vertex type
    All Known Implementing Classes:
    GraphJson, GraphViz

    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 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 write
        location - 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 write
        location - the location to write to
        parameters - multimap of parameters used by the underling writer
        Throws:
        IOException - Something went wrong writing the graph