public abstract class TdbGraphSet
extends java.lang.Object
THIS CLASS IS EXPERIMENTAL. USE WITH CAUTION! ITS INTERFACE MAY CHANGE IN FUTURE RELEASES.
Modifier and Type | Method and Description |
---|---|
TdbGraphSet |
backtrack(java.lang.String edge,
int sourceSet)
Creates a subgraph by following a particular edge type backwards
from target vertex in the current graph set to source vertex in
the specified source set.
|
TdbGraphPath[] |
findPaths(int startSet,
java.lang.String[] edgeNames,
int targetSet,
int maxDepth,
boolean reverse)
Locate all paths associated with the current graph set that use vertices in
the specified start set as origins.
|
TdbGraphSet |
follow(java.lang.String edge,
int targetSet)
Creates a subgraph by locating targets for the source vertices
in the current graph set such that they are related via a particular
edge (a.k.a. relation, link).
|
int |
getEdgeCount()
Returns the count of edges in this graph set.
|
TdbGraph |
getGraph()
Returns the TdbGraph instance that this graph set is associated with.
|
TdbGraphRecord |
getRecord(int index)
Returns a TdbGraphRecord object for a record in the the current graph set.
|
int |
getSearchId()
Returns the TRIP search set ID for this graph set.
|
TdbGraphSet |
merge(TdbGraphSet otherSet)
Merge this graph set with another, producing the union of both sets.
|
TdbGraphQueryResult |
query(java.lang.String expression)
Execute a query using the TRIP graph query language.
|
TdbSearchSet |
resolveSources()
Resolve target vertices to a search set of the regular records they
represent.
|
TdbSearchSet |
resolveTargets()
Resolve target vertices to a search set of the regular records they
represent.
|
TdbGraphPath |
shortestPath(int startSet,
java.lang.String[] edgeNames,
int targetSet)
Determine the shortest path associated with the current graph set that use vertices in
the specified start set as origins.
|
TdbGraphSet |
source(int searchSet)
Create a subgraph with edges where source vertices can be found
in the specified (regular) search set.
|
TdbGraphSet |
target(int searchSet)
Create a subgraph with edges where target vertices can be found
in the specified (regular) search set.
|
TdbGraphSet |
transitive(int sourceSet,
int targetSet,
java.lang.String[] edgeNames,
int maxDepth,
boolean reverse,
boolean allEdges)
Creates a subgraph of the current graph set where the specified source
and target records are connected via path.
|
public TdbGraph getGraph()
public int getSearchId()
public int getEdgeCount()
public TdbGraphRecord getRecord(int index) throws TdbException
index
- The zero-based index of the record in the set.TdbException
public TdbGraphSet source(int searchSet) throws TdbException
searchSet
- Normal search set to find outgoing edges for.TdbException
public TdbGraphSet target(int searchSet) throws TdbException
searchSet
- Normal search set to find incoming edges for.TdbException
public TdbGraphSet follow(java.lang.String edge, int targetSet) throws TdbException
edge
- Name of edge (a.k.a. relation, link) to followtargetSet
- Positive search set number (from regular database)TdbException
public TdbGraphSet backtrack(java.lang.String edge, int sourceSet) throws TdbException
edge
- Name of edge (a.k.a. relation, link) to follow backwardssourceSet
- Positive search set number (from regular database)TdbException
public TdbSearchSet resolveTargets() throws TdbException
TdbException
public TdbSearchSet resolveSources() throws TdbException
TdbException
public TdbGraphSet transitive(int sourceSet, int targetSet, java.lang.String[] edgeNames, int maxDepth, boolean reverse, boolean allEdges) throws TdbException
sourceSet
- The positive number for a regular search set that specifies the source vertices (must not be zero).targetSet
- The positive number for a regular search set that specifies the target vertices (or zero to locate all potential targets)edgeNames
- An array of names of the edge types to traverse - pass null or an empty array to traverse all edge types.maxDepth
- The maximum depth to search - pass zero for no depth limitreverse
- Pass true to do transitive search by following edges in reverse direction.allEdges
- Pass true to retrieve all edges explored by the operation, and false to only retrieve the final, outer edges.TdbException
public TdbGraphQueryResult query(java.lang.String expression) throws TdbException
expression
- Query expression in TRIP graph query language syntax.TdbException
public TdbGraphPath[] findPaths(int startSet, java.lang.String[] edgeNames, int targetSet, int maxDepth, boolean reverse) throws TdbException
startSet
- Regular search set specifying the vertex record(s) to use as starting point(s) for the paths.edgeNames
- Names of edges to follow or pass null or an empty array to follow all edges.targetSet
- Regular search set specifying the vertex record(s) to use as end point(s) for the paths.maxDepth
- The maximum traversal depth or pass zero for no limit.reverse
- Pass true to explore paths in reverse direction.TdbException
public TdbGraphPath shortestPath(int startSet, java.lang.String[] edgeNames, int targetSet) throws TdbException
startSet
- Regular search set specifying the vertex record(s) to use as starting point for the paths.edgeNames
- Names of edges to follow or pass null or an empty array to follow all edges.targetSet
- Regular search set specifying the vertex record(s) to use as end points for the paths.TdbException
public TdbGraphSet merge(TdbGraphSet otherSet) throws TdbException
otherSet
- Other graph set to merge with.TdbException