Interface GraphAlterationBuilder

All Known Subinterfaces:
GraphAlterationEmptyEdgeProviderBuilder, GraphAlterationEmptyProviderBuilder, GraphAlterationEmptyVertexProviderBuilder

public interface GraphAlterationBuilder
Builder to describe the alterations (graph schema modification) to perform to a graph. It is for example possible to add or remove vertex and edge providers.
Since:
20.1
  • Method Details

    • setDataSourceVersion

      void setDataSourceVersion(String version)
      Sets the version information for the built graph or snapshot
      Parameters:
      version - the version information
      Since:
      21.1
    • cascadeEdgeProviderRemovals

      GraphAlterationBuilder cascadeEdgeProviderRemovals(boolean cascadeEdgeProviderRemovals)
      Specifies if the edge providers associated to a vertex provider (the vertex provider is either the source or destination provider for that edge provider) being removed should be automatically removed too or not. By default, edge providers are not automatically removed whenever an associated vertex is removed. In that setting, if the associated edge providers are not specifically removed, an exception will be thrown to indicate that issue.
      Parameters:
      cascadeEdgeProviderRemovals - whether or not to automatically remove associated edge providers of removed vertex providers
      Returns:
      the current alteration builder
    • addVertexProvider

      GraphAlterationBuilder addVertexProvider(String pathToVertexProviderConfig) throws IOException
      Adds a vertex provider for which the configuration is in a file at the specified path
      Parameters:
      pathToVertexProviderConfig - the path to the JSON configuration of the vertex provider
      Returns:
      the current alteration builder
      Throws:
      IOException
    • addVertexProvider

      GraphAlterationBuilder addVertexProvider(EntityProviderConfig vertexProviderConfig)
      Adds a vertex provider specified by the provided configuration
      Parameters:
      vertexProviderConfig - the configuration of the vertex provider to add
      Returns:
      the current alteration builder
    • addEmptyVertexProvider

      GraphAlterationEmptyVertexProviderBuilder addEmptyVertexProvider(String providerName)
      Adds an empty vertex provider
      Parameters:
      providerName - the name of the vertex provider to add
      Returns:
      the builder to define the vertex provider
      Since:
      21.4
    • removeVertexProvider

      GraphAlterationBuilder removeVertexProvider(String vertexProviderName)
      Removes the vertex provider that has the given name. Also removes the associated edge providers if true was specified when calling cascadeEdgeProviderRemovals(boolean).
      Parameters:
      vertexProviderName - the name of the provider to remove
      Returns:
      the current alteration builder
    • addEdgeProvider

      GraphAlterationBuilder addEdgeProvider(String pathToEdgeProviderConfig) throws IOException
      Adds an edge provider for which the configuration is in a file at the specified path
      Parameters:
      pathToEdgeProviderConfig - the path to the JSON configuration of the edge provider
      Returns:
      the current alteration builder
      Throws:
      IOException
    • addEdgeProvider

      GraphAlterationBuilder addEdgeProvider(EntityProviderConfig edgeProviderConfig)
      Adds an edge provider specified by the provided configuration
      Parameters:
      edgeProviderConfig - the configuration of the edge provider to add
      Returns:
      the current alteration builder
    • addEmptyEdgeProvider

      GraphAlterationEmptyEdgeProviderBuilder addEmptyEdgeProvider(String providerName, String sourceProvider, String destProvider)
      Adds an empty edge provider
      Parameters:
      providerName - the name of the edge provider to add
      sourceProvider - the name of the vertex provider for the source of the edges
      destProvider - the name of the vertex provider for the destination of the edges
      Returns:
      the builder to define the edge provider
      Since:
      21.4
    • removeEdgeProvider

      GraphAlterationBuilder removeEdgeProvider(String edgeProviderName)
      Removes the edge provider that has the given name
      Parameters:
      edgeProviderName - the name of the provider to remove
      Returns:
      the current alteration builder
    • buildAsync

      PgxFuture<PgxGraph> buildAsync(String newGraphName)
      Create a new graph that is the result of the alteration of the current graph.
      Parameters:
      newGraphName - name of the new graph to create
      Returns:
      the current alteration builder
    • buildAsync

      default PgxFuture<PgxGraph> buildAsync()
      Create a new graph that is the result of the alteration of the current graph.
      Returns:
      a reference to the created graph
    • build

      default PgxGraph build(String newGraphName) throws ExecutionException, InterruptedException
      Create a new graph that is the result of the alteration of the current graph. (Blocking version of buildAsync(String))
      Parameters:
      newGraphName - name of the new graph to create
      Returns:
      a reference to the created graph
      Throws:
      InterruptedException - if the caller thread gets interrupted while waiting for completion.
      ExecutionException - if any exception occurred during asynchronous execution. The actual exception will be nested.
    • build

      Create a new graph that is the result of the alteration of the current graph. (Blocking version of buildAsync())
      Returns:
      a reference to the created graph
      Throws:
      InterruptedException - if the caller thread gets interrupted while waiting for completion.
      ExecutionException - if any exception occurred during asynchronous execution. The actual exception will be nested.
    • buildNewSnapshotAsync

      PgxFuture<PgxGraph> buildNewSnapshotAsync()
      Create a new snapshot for the current graph that is the result of the alteration of the current snapshot.
      Returns:
      a reference to the created graph snapshot
    • buildNewSnapshot

      default PgxGraph buildNewSnapshot() throws ExecutionException, InterruptedException
      Create a new snapshot for the current graph that is the result of the alteration of the current snapshot. (Blocking version of buildNewSnapshotAsync())
      Returns:
      a reference to the created graph snapshot
      Throws:
      InterruptedException - if the caller thread gets interrupted while waiting for completion.
      ExecutionException - if any exception occurred during asynchronous execution. The actual exception will be nested.