Package oracle.pgx.api
Interface GraphBuilder<VID>
-
- All Known Subinterfaces:
EdgeBuilder<VID>
,EdgeModifier<VID>
,GraphChangeSet<VID>
,VertexBuilder<VID>
,VertexModifier<VID>
- All Known Implementing Classes:
EdgeBuilderImpl
,EdgeModifierImpl
,GraphBuilderImpl
,GraphChangeSetImpl
,VertexBuilderImpl
,VertexModifierImpl
public interface GraphBuilder<VID>
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description EdgeBuilder<VID>
addEdge(long edgeId, VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)
Adds an edge with the given edge ID and the given source and destination vertices.EdgeBuilder<VID>
addEdge(long edgeId, VID srcVertex, VID dstVertex)
Adds an edge with the given edge ID and the given source and destination vertices.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.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.EdgeBuilder<VID>
addEdge(VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)
Adds an edge with an implicit ID and the given source and destination vertices.EdgeBuilder<VID>
addEdge(VID srcVertex, VID dstVertex)
Adds an edge with an implicit ID and the given source and destination vertices.VertexBuilder<VID>
addVertex()
Adds a vertex with an implicit id to the graph builder.VertexBuilder<VID>
addVertex(VID vertexId)
Adds the vertex with the given id to the graph builder.PgxGraph
build()
Blocking version ofbuildAsync()
.PgxGraph
build(java.lang.String newGraphName)
Blocking version ofbuildAsync(String)
.PgxFuture<PgxGraph>
buildAsync()
Shortcut forbuildAsync(String)
without a namePgxFuture<PgxGraph>
buildAsync(java.lang.String newGraphName)
Builds a new graph out of the changes in this graph builderjava.lang.Object
getConfigParameter(GraphBuilderConfig.Field parameter)
Retrieve the value for the given config parameterGraphBuilder<VID>
resetEdge(long edgeId)
Resets any change for the edge with the given ID.GraphBuilder<VID>
resetEdge(java.lang.String edgeId)
Resets any change for the edge with the given ID.GraphBuilder<VID>
resetVertex(VertexBuilder<VID> vertex)
Resets any change for the given vertex.GraphBuilder<VID>
resetVertex(VID vertexId)
Resets any change for the vertex with the given ID.void
setConfigParameter(GraphBuilderConfig.Field parameter, java.lang.Object value)
Set the given configuration parameter to the given valuevoid
setDataSourceVersion(java.lang.String version)
Sets the version information for the built graph or snapshotdefault GraphBuilder<VID>
setRetainEdgeIds(boolean retainEdgeIds)
Controls whether the edge ids provided in this graph builder are to be retained in the final graph.default GraphBuilder<VID>
setRetainIds(boolean retainIds)
Controls for both vertex and edge ids whether to retain them in the final graph.default 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.
-
-
-
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 anUnsupportedOperationException
if vertex Id generation strategy is set toIdGenerationStrategy.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 anUnsupportedOperationException
if vertex Id generation strategy is set toIdGenerationStrategy.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
-
resetVertex
GraphBuilder<VID> resetVertex(VertexBuilder<VID> vertex)
Resets any change for the given vertex.- Parameters:
vertex
- aVertexBuilder
- 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 anUnsupportedOperationException
if edge Id generation strategy is set toIdGenerationStrategy.AUTO_GENERATED
- Parameters:
edgeId
- the ID of the new edgesrcVertex
- the source ID of the new edgedstVertex
- 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 anUnsupportedOperationException
if edge Id generation strategy is set toIdGenerationStrategy.AUTO_GENERATED
- Parameters:
edgeId
- the ID of the new edgesrcVertex
- the source ID of the new edgedstVertex
- 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 anUnsupportedOperationException
if edge Id generation strategy is set toIdGenerationStrategy.USER_IDS
- Parameters:
srcVertex
- the source ID of the new edgedstVertex
- the destination ID of the new edge- Returns:
- an edge builder instance
- Since:
- 3.1.0
-
addEdge
EdgeBuilder<VID> addEdge(long 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 anUnsupportedOperationException
if edge Id generation strategy is set toIdGenerationStrategy.AUTO_GENERATED
- Parameters:
edgeId
- the ID of the new edgesrcVertex
- aVertexBuilderImpl
instance representing the source vertexdstVertex
- aVertexBuilderImpl
instance representing the destination vertex- Returns:
- an edge builder instance
- See Also:
VertexBuilderImpl
-
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 anUnsupportedOperationException
if edge Id generation strategy is set toIdGenerationStrategy.AUTO_GENERATED
- Parameters:
edgeId
- the ID of the new edgesrcVertex
- aVertexBuilderImpl
instance representing the source vertexdstVertex
- aVertexBuilderImpl
instance representing the destination vertex- Returns:
- an edge builder instance
- See Also:
VertexBuilderImpl
-
addEdge
EdgeBuilder<VID> addEdge(VertexBuilder<VID> srcVertex, VertexBuilder<VID> dstVertex)
Adds an edge with an implicit ID and the given source and destination vertices. Throws anUnsupportedOperationException
if edge Id generation strategy is set toIdGenerationStrategy.USER_IDS
- Parameters:
srcVertex
- aVertexBuilderImpl
instance representing the source vertexdstVertex
- aVertexBuilderImpl
instance representing the destination vertex- Returns:
- an edge builder instance
- Since:
- 3.1.0
- 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. Ifnull
a name is generated- Returns:
- a new graph
-
buildAsync
PgxFuture<PgxGraph> buildAsync()
Shortcut forbuildAsync(String)
without a name- Returns:
- a new graph
-
build
PgxGraph build(java.lang.String newGraphName) throws java.util.concurrent.ExecutionException, java.lang.InterruptedException
Blocking version ofbuildAsync(String)
. CallsbuildAsync(String)
and waits for the returnedPgxFuture
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 ofbuildAsync()
. CallsbuildAsync()
and waits for the returnedPgxFuture
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.
-
setConfigParameter
void setConfigParameter(GraphBuilderConfig.Field parameter, java.lang.Object value)
Set the given configuration parameter to the given value- Parameters:
parameter
- the config parameter to setvalue
- the new value for the config parameter- Since:
- 2.4.0
-
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
default GraphBuilder<VID> setRetainEdgeIds(boolean retainEdgeIds)
Controls whether the edge ids provided in this graph builder are to be retained in the final graph. Iftrue
retain the edge ids, iffalse
use internally generated edge ids.- Parameters:
retainEdgeIds
- whether or not to retain edge ids- Returns:
- this graph builder
- Since:
- 2.4.0
-
setRetainVertexIds
default 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. Iftrue
retain the vertex ids, iffalse
use internally generated vertex ids of typeInteger
- Parameters:
retainVertexIds
- whether or not to retain vertex ids- Returns:
- this graph builder
- Since:
- 2.4.0
-
setRetainIds
default GraphBuilder<VID> setRetainIds(boolean retainIds)
Controls for both vertex and edge ids whether to retain them in the final graph.- Parameters:
retainIds
- whether or not to retain vertex and edge ids- Returns:
- this graph builder
- Since:
- 2.4.0
- See Also:
setRetainEdgeIds(boolean)
,setRetainVertexIds(boolean)
-
-