public class TdbGraphRecord extends TdbRecord
THIS CLASS IS EXPERIMENTAL. METHOD SIGNATURES MAY CHANGE IN FUTURE RELEASES. USE WITH CAUTION.
Constructor and Description |
---|
TdbGraphRecord(TdbSession session)
Constructor, creates a blank graph record container.
|
TdbGraphRecord(TdbSession session,
java.lang.String name)
Constructor, associates the record with the named graph database.
|
TdbGraphRecord(TdbSession session,
TdbDatabaseDesign design)
Constructor, associates the graph record with the provided database design.
|
Modifier and Type | Method and Description |
---|---|
void |
addKeyword(java.lang.String keyword)
Add a keyword to this graph record.
|
TdbGraphRecordType |
getGraphRecordType()
Returns the type of the graph record
|
java.util.List<java.lang.String> |
getKeywords()
Return a list of all keywords assigned to this graph record.
|
java.lang.String |
getName()
Returns the name of the graph record.
|
java.lang.String |
getProperty(java.lang.String name)
Retrieve the value for a property.
|
int |
getPropertyCount()
Returns a count of the number of properties assigned to this graph database record.
|
java.lang.String |
getPropertyName(int index)
Returns the name of the property at the specified index.
|
java.lang.String |
getPropertyValue(int index)
Returns the value of the property at the specified index.
|
java.lang.String |
getReferenceDatabase()
Returns the database name for the record referenced from this graph record.
|
int |
getReferenceRecordId()
Returns the record ID of the record referenced from this graph record.
|
java.lang.String |
getSourceDatabase()
Returns the database name for record used as source vertex for this graph record.
|
int |
getSourceRecordId()
Returns the record ID of the record used as source vertex for this graph record.
|
java.lang.String |
getTargetDatabase()
Returns the database name for record used as target vertex for this graph record.
|
int |
getTargetRecordId()
Returns the record ID of the record used as target vertex for this graph record.
|
double |
getWeight()
Returns the weight value for an edge record.
|
boolean |
isEdge()
Returns true if this record is an edge.
|
boolean |
isVertex()
Returns true if this record is a vertex.
|
void |
removeKeyword(int index)
Remove a keyword from this graph record.
|
void |
removeKeyword(java.lang.String keyword)
Remove a keyword from this graph record.
|
void |
removeProperty(java.lang.String name)
Removes a named property from this graph record.
|
void |
setGraphRecordType(TdbGraphRecordType type)
Set the type of the graph record.
|
void |
setName(java.lang.String name)
Assigns the name of the record.
|
void |
setProperty(java.lang.String name,
java.lang.String value)
Assign a property to this graph record.
|
void |
setReference(java.lang.String databaseName,
int recordId,
java.lang.String recordName)
Set a reference to a pre-existing record.
|
void |
setReference(TdbRecord rec)
Set a reference to a pre-existing record.
|
void |
setSourceRecord(int recordId,
java.lang.String recordName)
Set the source record for a graph edge.
|
void |
setSourceRecord(java.lang.String databaseName,
int recordId)
Set the source record for a graph edge.
|
void |
setSourceRecord(TdbRecord rec)
Set the source record for a graph edge.
|
void |
setTargetRecord(int recordId,
java.lang.String recordName)
Set the target record for a graph edge.
|
void |
setTargetRecord(java.lang.String databaseName,
int recordId)
Set the target record for a graph edge.
|
void |
setTargetRecord(TdbRecord rec)
Set the target record for a graph edge.
|
void |
setWeight(double weight)
Set the weight value for an edge record.
|
addToTemplate, addToTemplate, addToTemplate, appendComponent, clear, commit, copy, copy, delete, deleteComponent, deleteComponent, get, get, getCategories, getComponent, getComponent, getDatabaseName, getFieldTemplates, getHead, getIndexOnCommit, getNlpInfo, getRank, getRawRank, getRecordId, getRecordName, getTimeStamp, insertAseList, isChanged, isDeleted, isGraphRecord, isXmlRecord, lock, parts, removeFromTemplate, setDatabaseName, setIndexOnCommit, setPartId, setPartNameField, setRecordId, setRecordName, setRecordNameField, setRecordNumberField, setRetrieveHead, setRetrieveParts, setTemplateMarkup, unlock, updateAseList
codeList, getLastCode, getLastMessage, hasMessages, messageList, resetMessages
cancel, getSession, isCancelable, setCancelable
public TdbGraphRecord(TdbSession session) throws TdbException
session
- Active sessionTdbException
public TdbGraphRecord(TdbSession session, TdbDatabaseDesign design) throws TdbException
session
- Active sessiondesign
- Database designTdbException
public TdbGraphRecord(TdbSession session, java.lang.String name) throws TdbException
session
- Active sessionname
- Name of the graph database.TdbException
public boolean isVertex()
public boolean isEdge()
public void setGraphRecordType(TdbGraphRecordType type) throws TdbException
This method can only be called if the record has no assigned type and is not already committed to the graph database.
type
- The type of the record to createTdbException
- If assignment cannot be performedpublic TdbGraphRecordType getGraphRecordType()
public void setName(java.lang.String name) throws TdbException
For an edge this is the name of the relation. For a vertex, this is a label that can is used to identify the vertex in illustrations, etc.
name
- Name of edge or label of vertexTdbException
- If assignment cannot be performedpublic java.lang.String getName() throws TdbException
For an edge this is the name of the relation. For a vertex, this is a label that can is used to identify the vertex in illustrations, etc.
TdbException
- If the value could not be retrievedpublic void setReference(TdbRecord rec) throws TdbException
This assignment is only valid for vertex records. The referenced record can contain additional data about the vertex.
rec
- Record to associate with the vertex record.TdbException
- If assignment failspublic void setReference(java.lang.String databaseName, int recordId, java.lang.String recordName) throws TdbException
This assignment is only valid for vertex records. The referenced record can contain additional data about the vertex.
databaseName
- Database in which the record is storedrecordId
- ID of the recordrecordName
- Record name of record (pass null if none or not known)TdbException
- If assignment failspublic int getReferenceRecordId() throws TdbException
Only vertex records may contain a reference to another record.
TdbException
- If the value could not be retrievedpublic java.lang.String getReferenceDatabase() throws TdbException
Only vertex records may contain a reference to another record.
TdbException
- If the value could not be retrievedpublic void setWeight(double weight) throws TdbException
weight
- Weight to set.TdbException
- If the assignment failspublic double getWeight() throws TdbException
TdbException
- If the record is not a graph edgepublic void setSourceRecord(TdbRecord rec) throws TdbException
rec
- The record to assign as source, must have been committed prior to assignment.TdbException
public void setSourceRecord(int recordId, java.lang.String recordName) throws TdbException
recordId
- The ID of the recordrecordName
- The record name of the recordTdbException
public void setSourceRecord(java.lang.String databaseName, int recordId) throws TdbException
databaseName
- The name of the database in which the record residesrecordId
- The ID of the recordTdbException
public int getSourceRecordId() throws TdbException
This property is only valid for edge records.
TdbException
- If the value could not be retrievedpublic java.lang.String getSourceDatabase() throws TdbException
This property is only valid for edge records.
TdbException
- If the value could not be retrievedpublic void setTargetRecord(TdbRecord rec) throws TdbException
rec
- The record to assign as target, must have been committed prior to assignment.TdbException
public void setTargetRecord(int recordId, java.lang.String recordName) throws TdbException
recordId
- The ID of the recordrecordName
- The record name of the recordTdbException
public void setTargetRecord(java.lang.String databaseName, int recordId) throws TdbException
databaseName
- The name of the database in which the record residesrecordId
- The ID of the recordTdbException
public int getTargetRecordId() throws TdbException
This property is only valid for edge records.
TdbException
- If the value could not be retrievedpublic java.lang.String getTargetDatabase() throws TdbException
This property is only valid for edge records.
TdbException
- If the value could not be retrievedpublic void setProperty(java.lang.String name, java.lang.String value) throws TdbException
name
- Name of propertyvalue
- Value of propertyTdbException
public void removeProperty(java.lang.String name) throws TdbException
name
- Name of property to removeTdbException
public java.lang.String getProperty(java.lang.String name) throws TdbException
name
- Name of property whose value to retrieve.TdbException
public int getPropertyCount() throws TdbException
TdbException
public java.lang.String getPropertyName(int index) throws TdbException
index
- Zero-based index of property whose name to retrieveTdbException
public java.lang.String getPropertyValue(int index) throws TdbException
index
- Zero-based index of property whose value to retrieveTdbException
public void addKeyword(java.lang.String keyword) throws TdbException
keyword
- Keyword to addTdbException
public java.util.List<java.lang.String> getKeywords() throws TdbException
TdbException
public void removeKeyword(java.lang.String keyword) throws TdbException
keyword
- Keyword to removeTdbException
public void removeKeyword(int index) throws TdbException
index
- Zero based index of keyword to removeTdbException