Interface GraphBuilder<VID>

    • Method Detail

      • setDataSourceVersion

        void setDataSourceVersion​(java.lang.String version)
        Sets the version information for the built graph or snapshot
        Parameters:
        version - the version information
        Since:
        21.1
      • addVertex

        VertexBuilder<VID> addVertex​(VID vertexId)
        Adds the vertex with the given id to the graph builder. If the vertex doesn't exist it is added, if it exists a builder for that vertex is returned Throws an UnsupportedOperationException if vertex Id generation strategy is set to IdGenerationStrategy.AUTO_GENERATED
        Parameters:
        vertexId - the ID of the new vertex
        Returns:
        a vertex builder instance
      • addVertex

        VertexBuilder<VID> addVertex()
        Adds a vertex with an implicit id to the graph builder. A builder for that vertex is returned Throws an UnsupportedOperationException if vertex Id generation strategy is set to IdGenerationStrategy.USER_IDS
        Returns:
        a vertex builder instance
        Since:
        3.1.0
      • resetVertex

        GraphBuilder<VID> resetVertex​(VID vertexId)
        Resets any change for the vertex with the given ID. Does nothing if no change for the given vertex ID exists.
        Parameters:
        vertexId - the ID of the vertex which should be reset
        Returns:
        this graph builder
      • resetEdge

        GraphBuilder<VID> resetEdge​(long edgeId)
        Resets any change for the edge with the given ID. Does nothing if no change for the given edge ID exists.
        Parameters:
        edgeId - the ID of the edge which should be reset
        Returns:
        this graph builder
      • resetEdge

        GraphBuilder<VID> resetEdge​(java.lang.String edgeId)
        Resets any change for the edge with the given ID. Does nothing if no change for the given edge ID exists.
        Parameters:
        edgeId - the ID of the edge which should be reset
        Returns:
        this graph builder
        Since:
        22.3.0
      • addEdge

        EdgeBuilder<VID> addEdge​(long edgeId,
                                 VID srcVertex,
                                 VID dstVertex)
        Adds an edge with the given edge ID and the given source and destination vertices. If the edge doesn't exist it is added, if it exists a builder for that edge is returned Vertices that don't yet exist in the graph are added on the fly. Throws an UnsupportedOperationException if edge Id generation strategy is set to IdGenerationStrategy.AUTO_GENERATED
        Parameters:
        edgeId - the ID of the new edge
        srcVertex - the source ID of the new edge
        dstVertex - the destination ID of the new edge
        Returns:
        an edge builder instance
      • addEdge

        EdgeBuilder<VID> addEdge​(java.lang.String edgeId,
                                 VID srcVertex,
                                 VID dstVertex)
        Adds an edge with the given edge ID and the given source and destination vertices. If the edge doesn't exist it is added, if it exists a builder for that edge is returned Vertices that don't yet exist in the graph are added on the fly. Throws an UnsupportedOperationException if edge Id generation strategy is set to IdGenerationStrategy.AUTO_GENERATED
        Parameters:
        edgeId - the ID of the new edge
        srcVertex - the source ID of the new edge
        dstVertex - the destination ID of the new edge
        Returns:
        an edge builder instance
      • addEdge

        EdgeBuilder<VID> addEdge​(VID srcVertex,
                                 VID dstVertex)
        Adds an edge with an implicit ID and the given source and destination vertices. Vertices that don't yet exist in the graph are added on the fly. Throws an UnsupportedOperationException if edge Id generation strategy is set to IdGenerationStrategy.USER_IDS
        Parameters:
        srcVertex - the source ID of the new edge
        dstVertex - the destination ID of the new edge
        Returns:
        an edge builder instance
        Since:
        3.1.0
      • addEdge

        EdgeBuilder<VID> addEdge​(java.lang.String edgeId,
                                 VertexBuilder<VID> srcVertex,
                                 VertexBuilder<VID> dstVertex)
        Adds an edge with the given edge ID and the given source and destination vertices. If the edge doesn't exist it is added, if it exists a builder for that edge is returned Throws an UnsupportedOperationException if edge Id generation strategy is set to IdGenerationStrategy.AUTO_GENERATED
        Parameters:
        edgeId - the ID of the new edge
        srcVertex - a VertexBuilderImpl instance representing the source vertex
        dstVertex - a VertexBuilderImpl instance representing the destination vertex
        Returns:
        an edge builder instance
        See Also:
        VertexBuilderImpl
      • buildAsync

        PgxFuture<PgxGraph> buildAsync​(java.lang.String newGraphName)
        Builds a new graph out of the changes in this graph builder
        Parameters:
        newGraphName - the new name of the graph. If null a name is generated
        Returns:
        a new graph
      • build

        PgxGraph build​(java.lang.String newGraphName)
                throws java.util.concurrent.ExecutionException,
                       java.lang.InterruptedException
        Blocking version of buildAsync(String). Calls buildAsync(String) and waits for the returned PgxFuture to complete.
        Throws:
        java.lang.InterruptedException - if the caller thread gets interrupted while waiting for completion.
        java.util.concurrent.ExecutionException - if any exception occurred during asynchronous execution. The actual exception will be nested.
      • build

        PgxGraph build()
                throws java.util.concurrent.ExecutionException,
                       java.lang.InterruptedException
        Blocking version of buildAsync(). Calls buildAsync() and waits for the returned PgxFuture to complete.
        Throws:
        java.lang.InterruptedException - if the caller thread gets interrupted while waiting for completion.
        java.util.concurrent.ExecutionException - if any exception occurred during asynchronous execution. The actual exception will be nested.
      • partitionedVertexIds

        GraphBuilder<VID> partitionedVertexIds​(boolean partitionedIds)
        Specifies if the final graph should use IdStrategy.PARTITIONED_IDS for vertices. Partitioned Ids can be used only in the context of building a partitioned graph, and only if the original Ids are retained, that is, only if the client is configured to build partitioned graphs and setRetainVertexIds(boolean) both are set to true
        Parameters:
        partitionedIds - whether or not to use IdStrategy.PARTITIONED_IDS for vertices in the final graph
        Returns:
        this graph builder
        Since:
        25.1
      • partitionedEdgeIds

        GraphBuilder<VID> partitionedEdgeIds​(boolean partitionedIds)
        Specifies if the final graph should use IdStrategy.PARTITIONED_IDS for edges. Partitioned Ids can be used only in the context of building a partitioned graph, and only if the original Ids are retained, that is, only if the client is configured to build partitioned graphs and setRetainEdgeIds(boolean) both are set to true
        Parameters:
        partitionedIds - whether or not to use IdStrategy.PARTITIONED_IDS for edges in the final graph
        Returns:
        this graph builder
        Since:
        25.1
      • getConfigParameter

        java.lang.Object getConfigParameter​(GraphBuilderConfig.Field parameter)
        Retrieve the value for the given config parameter
        Parameters:
        parameter - the config parameter to get the value for
        Returns:
        the value for the given config parameter
        Since:
        2.4.0
      • setRetainEdgeIds

        GraphBuilder<VID> setRetainEdgeIds​(boolean retainEdgeIds)
        Controls whether the edge ids provided in this graph builder are to be retained in the final graph. If true retain the edge ids, if false use internally generated edge ids.
        Parameters:
        retainEdgeIds - whether or not to retain edge ids
        Returns:
        this graph builder
        Since:
        2.4.0
      • setRetainVertexIds

        GraphBuilder<VID> setRetainVertexIds​(boolean retainVertexIds)
        Controls whether to retain the vertex ids provided in this graph builder are to be retained in the final graph. If true retain the vertex ids, if false use internally generated vertex ids of type Integer
        Parameters:
        retainVertexIds - whether or not to retain vertex ids
        Returns:
        this graph builder
        Since:
        2.4.0