public final class TdbGraph extends TdbMessageProvider
THIS CLASS IS EXPERIMENTAL. USE WITH CAUTION! ITS INTERFACE MAY CHANGE IN FUTURE RELEASES.
Constructor and Description |
---|
TdbGraph(TdbSession session,
java.lang.String databaseOrCluster)
Opens a graph database or cluster of graph databases.
|
TdbGraph(TdbSession session,
TdbDatabaseDesign graphdb)
Opens a graph database.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close this TdbGraph object and release all resources associated with it,
including search sets generated through its use.
|
TdbGraphRecord |
createEdge(java.lang.String name,
int sourceRecordId,
int targetRecordId,
boolean commit)
Create an edge in the graph database currently associated with
this TdbGraph instance.
|
TdbGraphRecord |
createEdge(java.lang.String name,
java.lang.String sourceDatabase,
int sourceRecordId,
java.lang.String targetDatabase,
int targetRecordId,
boolean commit)
Create an edge in the graph database currently associated with
this TdbGraph instance.
|
TdbGraphRecord |
createEdge(java.lang.String name,
TdbRecord source,
TdbRecord target,
boolean commit)
Create an edge in the graph database currently associated with
this TdbGraph instance.
|
TdbGraphRecord |
createVertex(java.lang.String label,
java.lang.String databaseName,
int recordId,
java.lang.String recordName,
boolean commit)
Create a vertex record in the graph database currently associated with
this TdbGraph instance.
|
TdbGraphRecord |
createVertex(java.lang.String label,
TdbRecord reference,
boolean commit)
Create a vertex record in the graph database currently associated with
this TdbGraph instance.
|
java.lang.String |
getGraphDatabaseName()
Returns the name of the graph database or cluster associated with this
TdbGraph instance.
|
TdbGraphSet |
getGraphSet()
Returns the graph set associated with the entire graph database
or cluster associated with this TdbGraph instance.
|
boolean |
getNotificationType(TdbGraphNotificationType type)
Returns true if the notification detail type is enabled and false if it
is disabled.
|
void |
setNotificationType(TdbGraphNotificationType type,
boolean enable)
Enable or disable graph analysis notification detail type.
|
codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages
cancel, getSession, isCancelable, setCancelable
public TdbGraph(TdbSession session, java.lang.String databaseOrCluster) throws TdbException
session
- Active session objectdatabaseOrCluster
- Name of graph database or clusterTdbException
public TdbGraph(TdbSession session, TdbDatabaseDesign graphdb) throws TdbException
session
- Active session objectgraphdb
- Database design object representing a graph databaseTdbException
public void close() throws TdbException
TdbException
public TdbGraphSet getGraphSet()
public java.lang.String getGraphDatabaseName()
public void setNotificationType(TdbGraphNotificationType type, boolean enable)
type
- Notification detail type to enable or disableenable
- True to enable and false to disablepublic boolean getNotificationType(TdbGraphNotificationType type)
type
- Notification type to checkpublic TdbGraphRecord createEdge(java.lang.String name, TdbRecord source, TdbRecord target, boolean commit) throws TdbException
If a weight and/or other properties are required data for the edge, the 'commit' parameter should be set to false. The record object is then not yet committed. Assign the required data to this object and call commit() for the application code in a normal fashion.
name
- Name of edgesource
- Source record for this edgetarget
- Target record for this edgecommit
- Pass true to commit record and false to return it uncommitted.TdbException
public TdbGraphRecord createEdge(java.lang.String name, java.lang.String sourceDatabase, int sourceRecordId, java.lang.String targetDatabase, int targetRecordId, boolean commit) throws TdbException
This method is used to create edges where the vertex records are located in regular, non-graph databases.
If a weight and/or other properties are required data for the edge, the 'commit' parameter should be set to false. The record object is then not yet committed. Assign the required data to this object and call commit() for the application code in a normal fashion.
name
- Name of edgesourceDatabase
- Source record's database namesourceRecordId
- Source record IDtargetDatabase
- Target record's database nametargetRecordId
- Target record IDcommit
- Pass true to commit record and false to return it uncommitted.TdbException
public TdbGraphRecord createEdge(java.lang.String name, int sourceRecordId, int targetRecordId, boolean commit) throws TdbException
This method is used to create edges where the vertex records are located within the graph database associated with this object.
If a weight and/or other properties are required data for the edge, the 'commit' parameter should be set to false. The record object is then not yet committed. Assign the required data to this object and call commit() for the application code in a normal fashion.
name
- Name of edgesourceRecordId
- Record ID of graph vertex record in this databasetargetRecordId
- Record ID of graph vertex record in this databasecommit
- Pass true to commit record and false to return it uncommitted.TdbException
public TdbGraphRecord createVertex(java.lang.String label, TdbRecord reference, boolean commit) throws TdbException
If other properties are required data for the vertex, the 'commit' parameter should be set to false. The record object is then not yet committed. Assign the required data to this object and call commit() for the application code in a normal fashion.
label
- Label for the vertex in this graphreference
- Optional reference to record with additional data for this vertex (pass null if not relevant).commit
- Pass true to commit record and false to return it uncommitted.TdbException
public TdbGraphRecord createVertex(java.lang.String label, java.lang.String databaseName, int recordId, java.lang.String recordName, boolean commit) throws TdbException
If other properties are required data for the vertex, the 'commit' parameter should be set to false. The record object is then not yet committed. Assign the required data to this object and call commit() for the application code in a normal fashion.
If a the vertex is to refer to a record in another database that has additional information on this vertex, all the parameters databaseName, recordId and recordName must be specified. If the database lacks record names, pass null for recordName.
label
- Label for the vertex in this graphdatabaseName
- Name of database in which a record with additional data for this vertex is located (pass null if not relevant)recordId
- ID of record with additional data for this vertex is located (pass zero if not relevant)recordName
- Name of record with additional data for this vertex is located (pass null if not relevant)commit
- Pass true to commit record and false to return it uncommitted.TdbException