DexNet 4.7.0
Public Member Functions
com::sparsity::dex::gdb::Graph Class Reference

Graph class. More...

List of all members.

Public Member Functions

void SetAttributeText (long oid, int attr, com.sparsity.dex.gdb.TextStream tstream)
 Sets the writable TextStream for the given text attribute and OID.
void DumpData (System.String file) throws System.IO.IOException, System.ApplicationException
 Dumps logical data to a file.
com.sparsity.dex.gdb.TypeList FindTypes ()
 Gets all existing Dex node and edge type identifiers.
void SetAttribute (long oid, int attr, com.sparsity.dex.gdb.Value v)
 Sets the Value for the given attribute and OID.
com.sparsity.dex.gdb.Objects Select (int attr, com.sparsity.dex.gdb.Condition cond, com.sparsity.dex.gdb.Value v)
 Selects all OIDs satisfying the given condition for the given attribute.
long GetAttributeIntervalCount (int attr, com.sparsity.dex.gdb.Value lower, bool includeLower, com.sparsity.dex.gdb.Value higher, bool includeHigher)
 Gets how many objects have a value into the given range for the given attribute.
void TailsAndHeads (com.sparsity.dex.gdb.Objects edges, com.sparsity.dex.gdb.Objects tails, com.sparsity.dex.gdb.Objects heads)
 Gets all the tails and heads from the given edges collection.
long Degree (long oid, int etype, com.sparsity.dex.gdb.EdgesDirection dir)
 Gets the number of edges from or to the given node OID and for the given edge type.
void DumpStorage (System.String file) throws System.IO.IOException, System.ApplicationException
 Dumps internal storage data to a file.
com.sparsity.dex.gdb.Objects Neighbors (com.sparsity.dex.gdb.Objects objs, int etype, com.sparsity.dex.gdb.EdgesDirection dir)
 Selects all neighbor nodes from or to each of the node OID in the given collection and for the given edge type.
void Export (System.String file, com.sparsity.dex.gdb.ExportType type, com.sparsity.dex.gdb.ExportManager e)
 Exports the Graph.
com.sparsity.dex.gdb.AttributeList GetAttributes (long oid)
 Gets all Dex attribute identifiers with a non-NULL value for the given Dex OID.
com.sparsity.dex.gdb.AttributeStatistics GetAttributeStatistics (int attr, bool basic)
 Gets statistics from the given attribute.
long NewNode (int type)
 Creates a new node instance.
com.sparsity.dex.gdb.TextStream GetAttributeText (long oid, int attr)
 Gets the read-only TextStream for the given text attribute and OID.
long CountEdges ()
 Gets the number of edges.
com.sparsity.dex.gdb.Objects Select (int attr, com.sparsity.dex.gdb.Condition cond, com.sparsity.dex.gdb.Value lower, com.sparsity.dex.gdb.Value higher)
 Selects all OIDs satisfying the given condition for the given attribute.
com.sparsity.dex.gdb.TypeList FindEdgeTypes ()
 Gets all existing Dex edge type identifiers.
void IndexAttribute (int attr, com.sparsity.dex.gdb.AttributeKind kind)
 Updates the index of the given attribute.
com.sparsity.dex.gdb.Type GetType (int type)
 Gets information about the given type.
void SetAttributeDefaultValue (int attr, com.sparsity.dex.gdb.Value v)
 Sets a default value for an attribute.
int FindAttribute (int type, System.String name)
 Gets the Dex attribute identifier for the given type identifier and attribute name.
int NewAttribute (int type, System.String name, com.sparsity.dex.gdb.DataType dt, com.sparsity.dex.gdb.AttributeKind kind)
 Creates a new attribute.
com.sparsity.dex.gdb.Objects Edges (int etype, long tail, long head)
 Gets all the edges of the given type between two given nodes (tail and head).
com.sparsity.dex.gdb.Objects Select (int type)
 Selects all OIDs belonging to the given type.
com.sparsity.dex.gdb.TypeList FindNodeTypes ()
 Gets all existing Dex node type identifiers.
com.sparsity.dex.gdb.Value GetAttribute (long oid, int attr)
 Gets the Value for the given attribute and OID.
void RemoveAttribute (int attr)
 Removes the given attribute.
void Backup (System.String file) throws System.IO.IOException, System.ApplicationException
 Dumps all the data to a backup file.
int NewSessionAttribute (int type, com.sparsity.dex.gdb.DataType dt, com.sparsity.dex.gdb.AttributeKind kind, com.sparsity.dex.gdb.Value defaultValue)
 Creates a new Session attribute with a default value.
com.sparsity.dex.gdb.AttributeList FindAttributes (int type)
 Gets all existing Dex attribute identifiers for the given type identifier.
long CountNodes ()
 Gets the number of nodes.
com.sparsity.dex.gdb.EdgeData GetEdgeData (long edge)
 Gets information about an edge.
com.sparsity.dex.gdb.Objects Neighbors (long oid, int etype, com.sparsity.dex.gdb.EdgesDirection dir)
 Selects all neighbor nodes from or to the given node OID and for the given edge type.
com.sparsity.dex.gdb.Objects Explode (com.sparsity.dex.gdb.Objects objs, int etype, com.sparsity.dex.gdb.EdgesDirection dir)
 Selects all edges from or to each of the node OID in the given collection and for the given edge type.
int NewNodeType (System.String name)
 Creates a new node type.
int NewSessionAttribute (int type, com.sparsity.dex.gdb.DataType dt, com.sparsity.dex.gdb.AttributeKind kind)
 Creates a new Session attribute.
com.sparsity.dex.gdb.Objects Tails (com.sparsity.dex.gdb.Objects edges)
 Gets all the tails from the given edges collection.
void Drop (long oid)
 Drops the given OID.
int NewEdgeType (System.String name, bool directed, bool neighbors)
 Creates a new edge type.
com.sparsity.dex.gdb.Objects Heads (com.sparsity.dex.gdb.Objects edges)
 Gets all the heads from the given edges collection.
long FindEdge (int etype, long tail, long head)
 Gets any of the edges of the given type between two given nodes (tail and head).
com.sparsity.dex.gdb.Objects Explode (long oid, int etype, com.sparsity.dex.gdb.EdgesDirection dir)
 Selects all edges from or to the given node OID and for the given edge type.
void Drop (com.sparsity.dex.gdb.Objects objs)
 Drops all the OIDs from the given collection.
int NewAttribute (int type, System.String name, com.sparsity.dex.gdb.DataType dt, com.sparsity.dex.gdb.AttributeKind kind, com.sparsity.dex.gdb.Value defaultValue)
 Creates a new attribute with a default value.
int GetObjectType (long oid)
 Gets the Dex node or edge type identifier for the given OID.
com.sparsity.dex.gdb.Attribute GetAttribute (int attr)
 Gets information about the given attribute.
long NewEdge (int type, int tailAttr, com.sparsity.dex.gdb.Value tailV, int headAttr, com.sparsity.dex.gdb.Value headV)
 Creates a new edge instance.
com.sparsity.dex.gdb.Values GetValues (int attr)
 Gets the Value collection for the given attribute.
long GetEdgePeer (long edge, long node)
 Gets the other end for the given edge.
long FindObject (int attr, com.sparsity.dex.gdb.Value v)
 Finds one object having the given Value for the given attribute.
long NewEdge (int type, long tail, long head)
 Creates a new edge instance.
int FindType (System.String name)
 Gets the Dex type identifier for the given type name.
void GetAttribute (long oid, int attr, com.sparsity.dex.gdb.Value v)
 Gets the Value for the given attribute and OID.
void RemoveType (int type)
 Removes the given type.
int NewRestrictedEdgeType (System.String name, int tail, int head, bool neighbors)
 Creates a new restricted edge type.

Detailed Description

Graph class.

Each Database has a Graph associated, which is the persistent graph which contains all data stored into the graph database.

It allows for manipulating the Database as a graph. Especially, it allows for the manipulation of an attributed labeled and directed multigraph (labels represent object types).

A Graph has the following characteristics: (i) It belongs to a Database and a Session. (ii) It has nodes which belong to node types and edges which belong to a edge types. (iii) Nodes and edges both can have attributes. (iv) There is no limit in the number of edges between two nodes, even if they belong to the same edge type. (v) Nodes and edges have an unique identifier (object identifier, OID) in the Graph. (vi) Object types (node and edge types) and attributes have also an unique identifier in the Graph.

Edge types

There are different kind of edge types. They are classified as undirected or directed.

Directed edges have a node which is the tail (the source of the edge) and a node which is the head (the destination of the edge). In case of undirected edges, two nodes at the extreme of the edge play the two roles, head and tail. Whereas undirected edges allow for any kind of navigation, directed edges restrict the navigation to the direction of the edge.

Also, edges can be clasified as restricted or unrestricted. Restricted edges define which must be the type of the tail nodes and the type of the head nodes, thus edges only will be allowed between nodes belonging to the specified types in the restriction. In case of unrestricted edges, there is no restriction and edges are allowed between nodes belonging to any type.

It is important to note that restricted edges are directed edges.

Indexed neighbors

Neighbors for each OID can be indexed in order to significantly increase the performance of the neighbors methods.

Unfortunately, it slightly decreases the performance of the construction of new edge instances. So, only if you will make intensive use of neighbors method should force materialize neighbors. This can be done by means of a parameter at the definition of new edge types.

Attributes

Basically attributes are restricted to a given node or edge type when they are created. That is, only node or edge objects of the corresponding restricting type can set and get values from that attribute identifier.

But also, attributes can be global. That is, all node or edge objects (no matters which type they belong to) can set and get values from that attribute identifier. To do that, Type::GlobalType must be used when creating the attribute.

There are three kind of attributes, but all of them allows for storing a value and run query methods (such as Select): (i) Basic: It allows the same usage as any other type, but the performance at query methods is not the best. (ii) Indexed: Like Basic, but have better performance at query methods. (iii) Unique: it works as Indexed but additionally they have a constraint: two different objects cannot have the same value (but NULL).

Virtual edges

Previous version of Dex (v4.1.x and older) have another type of edges called virtual edges. Check out the documentation of previous version of Dex to have a detailed explanation about the functionality of virtual edges.

Although virtual edges have been removed, the functionality they provided can be simulated as follows.

Let's suppose we have a virtual edge defined between the attributes ATTR_A and ATTR_B. These edges allow for navigating from any object OBJ having an attribute value for the attribute ATTR_A to those objects having the same attribute value for the attribute ATTR_B. That is, this can be done as follows: (i) Getting the value of OBJ for the attribute ATTR_A. (ii) Selecting the objects having the retrieved value for attribute ATTR_B.

Author:
Sparsity Technologies http://www.sparsity-technologies.com

Member Function Documentation

void com::sparsity::dex::gdb::Graph::Backup ( System.String  file) throws System.IO.IOException, System.ApplicationException

Dumps all the data to a backup file.

See Dex::Restore.

Parameters:
file[in] Output backup file path.
Exceptions:
System.IO.IOExceptionIf the given file cannot be created.
System.ApplicationExceptionnull
long com::sparsity::dex::gdb::Graph::CountEdges ( )

Gets the number of edges.

Returns:
The number of edges.
long com::sparsity::dex::gdb::Graph::CountNodes ( )

Gets the number of nodes.

Returns:
The number of nodes.
long com::sparsity::dex::gdb::Graph::Degree ( long  oid,
int  etype,
com.sparsity.dex.gdb.EdgesDirection  dir 
)

Gets the number of edges from or to the given node OID and for the given edge type.

Parameters:
oid[in] Dex node OID.
etype[in] Dex edge type identifier.
dir[in] Direction.
Returns:
The number of edges.
void com::sparsity::dex::gdb::Graph::Drop ( long  oid)

Drops the given OID.

It also removes its egdges as well as its attribute values.

Parameters:
oid[in] Dex OID to be removed.
void com::sparsity::dex::gdb::Graph::Drop ( com.sparsity.dex.gdb.Objects  objs)

Drops all the OIDs from the given collection.

See Drop method with the single OID parameter. This performs that call for all the elements into the collection.

Parameters:
objs[in] Objects collection with the OIDs to be removed.
void com::sparsity::dex::gdb::Graph::DumpData ( System.String  file) throws System.IO.IOException, System.ApplicationException

Dumps logical data to a file.

Parameters:
file[in] Output file path.
Exceptions:
System.IO.IOExceptionIf the given file cannot be created.
System.ApplicationExceptionnull
void com::sparsity::dex::gdb::Graph::DumpStorage ( System.String  file) throws System.IO.IOException, System.ApplicationException

Dumps internal storage data to a file.

Parameters:
file[in] Output file path.
Exceptions:
System.IO.IOExceptionIf the given file cannot be created.
System.ApplicationExceptionnull
com.sparsity.dex.gdb.Objects com::sparsity::dex::gdb::Graph::Edges ( int  etype,
long  tail,
long  head 
)

Gets all the edges of the given type between two given nodes (tail and head).

type[in] Dex edge type identifier.

Parameters:
etypenull
tail[in] Tail node identifier.
head[in] Head node identifier.
Returns:
Objects instance.
com.sparsity.dex.gdb.Objects com::sparsity::dex::gdb::Graph::Explode ( com.sparsity.dex.gdb.Objects  objs,
int  etype,
com.sparsity.dex.gdb.EdgesDirection  dir 
)

Selects all edges from or to each of the node OID in the given collection and for the given edge type.

Parameters:
objs[in] Dex node OID collection.
etype[in] Dex edge type identifier.
dir[in] Direction.
Returns:
Objects instance.
com.sparsity.dex.gdb.Objects com::sparsity::dex::gdb::Graph::Explode ( long  oid,
int  etype,
com.sparsity.dex.gdb.EdgesDirection  dir 
)

Selects all edges from or to the given node OID and for the given edge type.

Parameters:
oid[in] Dex node OID.
etype[in] Dex edge type identifier.
dir[in] Direction.
Returns:
Objects instance.
void com::sparsity::dex::gdb::Graph::Export ( System.String  file,
com.sparsity.dex.gdb.ExportType  type,
com.sparsity.dex.gdb.ExportManager  e 
)

Exports the Graph.

Parameters:
file[in] Output file.
type[in] Export type.
e[in] Defines how to do the export for each graph object.
int com::sparsity::dex::gdb::Graph::FindAttribute ( int  type,
System.String  name 
)

Gets the Dex attribute identifier for the given type identifier and attribute name.

Parameters:
type[in] Dex type identifier.
name[in] Unique attribute name.
Returns:
The Dex attribute identifier for the given type and attribute name or Attribute::InvalidAttribute if there is no attribute with the given name for the given type.
com.sparsity.dex.gdb.AttributeList com::sparsity::dex::gdb::Graph::FindAttributes ( int  type)

Gets all existing Dex attribute identifiers for the given type identifier.

Parameters:
type[in] Dex type identifier.
Returns:
Dex attribute identifier list.
long com::sparsity::dex::gdb::Graph::FindEdge ( int  etype,
long  tail,
long  head 
)

Gets any of the edges of the given type between two given nodes (tail and head).

If there are more than one, then any of them will be returned. And in case there are no edge between the given tail and head, Objects::InvalidOID will be returned.

Parameters:
etype[in] Dex edge type identifier.
tail[in] Tail node identifier.
head[in] Head node identifier.
Returns:
Any of the edges or Objects::InvalidOID.
com.sparsity.dex.gdb.TypeList com::sparsity::dex::gdb::Graph::FindEdgeTypes ( )

Gets all existing Dex edge type identifiers.

Returns:
Dex edge type identifier list.
com.sparsity.dex.gdb.TypeList com::sparsity::dex::gdb::Graph::FindNodeTypes ( )

Gets all existing Dex node type identifiers.

Returns:
Dex node type identifier list.
long com::sparsity::dex::gdb::Graph::FindObject ( int  attr,
com.sparsity.dex.gdb.Value  v 
)

Finds one object having the given Value for the given attribute.

If there are more than one, then any of them will be returned. And in case there are no object having this Value, Objects::InvalidOID will be returned.

Parameters:
attr[in] Dex attribute identifier.
v[in] Value.
Returns:
Dex OID or Objects::InvalidOID.
int com::sparsity::dex::gdb::Graph::FindType ( System.String  name)

Gets the Dex type identifier for the given type name.

Parameters:
name[in] Unique type name.
Returns:
The Dex type identifier for the given type name or Type::InvalidType if there is no type with the given name.
com.sparsity.dex.gdb.TypeList com::sparsity::dex::gdb::Graph::FindTypes ( )

Gets all existing Dex node and edge type identifiers.

Returns:
Dex node and edge type identifier list.
void com::sparsity::dex::gdb::Graph::GetAttribute ( long  oid,
int  attr,
com.sparsity.dex.gdb.Value  v 
)

Gets the Value for the given attribute and OID.

Parameters:
oid[in] Dex OID.
attr[in] Dex attribute identifier.
v[in|out] Value for the given attribute and for the given OID.
com.sparsity.dex.gdb.Attribute com::sparsity::dex::gdb::Graph::GetAttribute ( int  attr)

Gets information about the given attribute.

Parameters:
attr[in] Dex attribute identifier.
Returns:
The Attribute for the given Dex attribute identifier.
com.sparsity.dex.gdb.Value com::sparsity::dex::gdb::Graph::GetAttribute ( long  oid,
int  attr 
)

Gets the Value for the given attribute and OID.

The other version of this call, where the Value is an output parameter instead of the return, is better because it allows the user to reuse an existing Value instance, whereas this call always creates a new Value instance to be returned.

It never returns NULL. Thus, in case the OID has a NULL value for the attribute it returns a NULL Value instance.

Parameters:
oid[in] Dex OID.
attr[in] Dex attribute identifier.
Returns:
A new Value instance having the attribute value for the given OID.
long com::sparsity::dex::gdb::Graph::GetAttributeIntervalCount ( int  attr,
com.sparsity.dex.gdb.Value  lower,
bool  includeLower,
com.sparsity.dex.gdb.Value  higher,
bool  includeHigher 
)

Gets how many objects have a value into the given range for the given attribute.

This only works for AttributeKind::Indexed or AttributeKind::Unique attributes.

Given values must belong to the same DataType than the attribute.

Parameters:
attr[in] Dex attribute identifier.
lower[in] Lower bound Value of the range.
includeLower[in] If TRUE, include lower bound Value of the range.
higher[in] Higher bound Value of the range.
includeHigher[in] If TRUE, include higher bound Value of the range.
Returns:
Number of objects having a value into the given range.
com.sparsity.dex.gdb.AttributeList com::sparsity::dex::gdb::Graph::GetAttributes ( long  oid)

Gets all Dex attribute identifiers with a non-NULL value for the given Dex OID.

Parameters:
oid[in] Dex OID.
Returns:
Dex attribute identifier list.
com.sparsity.dex.gdb.AttributeStatistics com::sparsity::dex::gdb::Graph::GetAttributeStatistics ( int  attr,
bool  basic 
)

Gets statistics from the given attribute.

Parameters:
attr[in] Dex attribute identifier.
basic[in] If FALSE all statistics are computed, if TRUE just those statistics marked as basic will be computed (see description of the AttributeStatistics class). Of course, computing just basic statistics will be faster than computing all of them.
Returns:
An AttributeStatistics instace.
com.sparsity.dex.gdb.TextStream com::sparsity::dex::gdb::Graph::GetAttributeText ( long  oid,
int  attr 
)

Gets the read-only TextStream for the given text attribute and OID.

Parameters:
oid[in] Dex OID.
attr[in] Dex attribute identifier.
Returns:
A TextStream. This returns a TextStream to read.
com.sparsity.dex.gdb.EdgeData com::sparsity::dex::gdb::Graph::GetEdgeData ( long  edge)

Gets information about an edge.

Parameters:
edge[in] Dex edge identifier.
Returns:
An EdgeData instance.
long com::sparsity::dex::gdb::Graph::GetEdgePeer ( long  edge,
long  node 
)

Gets the other end for the given edge.

Parameters:
edge[in] Dex edge identifier.
node[in] Dex node identifier. It must be one of the ends of the edge.
Returns:
The other end of the edge.
int com::sparsity::dex::gdb::Graph::GetObjectType ( long  oid)

Gets the Dex node or edge type identifier for the given OID.

Parameters:
oid[in] Dex OID.
Returns:
Dex node or edge type identifier.
com.sparsity.dex.gdb.Type com::sparsity::dex::gdb::Graph::GetType ( int  type)

Gets information about the given type.

Parameters:
type[in] Dex type identifier.
Returns:
The Type for the given Dex type identifier.
com.sparsity.dex.gdb.Values com::sparsity::dex::gdb::Graph::GetValues ( int  attr)

Gets the Value collection for the given attribute.

Parameters:
attr[in] Dex attribute identifier.
com.sparsity.dex.gdb.Objects com::sparsity::dex::gdb::Graph::Heads ( com.sparsity.dex.gdb.Objects  edges)

Gets all the heads from the given edges collection.

Parameters:
edges[in] Dex edge identifier collection.
Returns:
The heads collection.
void com::sparsity::dex::gdb::Graph::IndexAttribute ( int  attr,
com.sparsity.dex.gdb.AttributeKind  kind 
)

Updates the index of the given attribute.

This just works if the current index of the attribute corresponds to AttributeKind::Basic and the new one is AttributeKind::Indexed or AttributeKind::Unique.

Parameters:
attr[in] Dex attribute identifier.
kind[in] Attribute kind.
com.sparsity.dex.gdb.Objects com::sparsity::dex::gdb::Graph::Neighbors ( long  oid,
int  etype,
com.sparsity.dex.gdb.EdgesDirection  dir 
)

Selects all neighbor nodes from or to the given node OID and for the given edge type.

Parameters:
oid[in] Dex node OID.
etype[in] Dex edge type identifier.
dir[in] Direction.
Returns:
Objects instance.
com.sparsity.dex.gdb.Objects com::sparsity::dex::gdb::Graph::Neighbors ( com.sparsity.dex.gdb.Objects  objs,
int  etype,
com.sparsity.dex.gdb.EdgesDirection  dir 
)

Selects all neighbor nodes from or to each of the node OID in the given collection and for the given edge type.

Parameters:
objs[in] Dex node OID collection.
etype[in] Dex edge type identifier.
dir[in] Direction.
Returns:
Objects instance.
int com::sparsity::dex::gdb::Graph::NewAttribute ( int  type,
System.String  name,
com.sparsity.dex.gdb.DataType  dt,
com.sparsity.dex.gdb.AttributeKind  kind 
)

Creates a new attribute.

Parameters:
type[in] Dex node or edge type identifier.
name[in] Unique name for the new attribute.
dt[in] Data type for the new attribute.
kind[in] Attribute kind.
Returns:
Unique Dex attribute identifier.
int com::sparsity::dex::gdb::Graph::NewAttribute ( int  type,
System.String  name,
com.sparsity.dex.gdb.DataType  dt,
com.sparsity.dex.gdb.AttributeKind  kind,
com.sparsity.dex.gdb.Value  defaultValue 
)

Creates a new attribute with a default value.

Parameters:
type[in] Dex node or edge type identifier.
name[in] Unique name for the new attribute.
dt[in] Data type for the new attribute.
kind[in] Attribute kind.
defaultValue[in] The default value to use in each new node/edge.
Returns:
Unique Dex attribute identifier.
long com::sparsity::dex::gdb::Graph::NewEdge ( int  type,
int  tailAttr,
com.sparsity.dex.gdb.Value  tailV,
int  headAttr,
com.sparsity.dex.gdb.Value  headV 
)

Creates a new edge instance.

The tail of the edge will be any node having the given tailV Value for the given tailAttr attribute identifier, and the head of the edge will be any node having the given headV Value for the given headAttr attribute identifier.

Parameters:
type[in] Dex type identifier.
tailAttr[in] Dex attribute identifier.
tailV[in] Value.
headAttr[in] Dex attribute identifier.
headV[in] Value.
Returns:
Unique OID of the new edge instance.
long com::sparsity::dex::gdb::Graph::NewEdge ( int  type,
long  tail,
long  head 
)

Creates a new edge instance.

Parameters:
type[in] Dex type identifier.
tail[in] Source Dex OID.
head[in] Target Dex OID.
Returns:
Unique OID of the new edge instance.
int com::sparsity::dex::gdb::Graph::NewEdgeType ( System.String  name,
bool  directed,
bool  neighbors 
)

Creates a new edge type.

Parameters:
name[in] Unique name for the new edge type.
directed[in] If TRUE, this creates a directed edge type, otherwise this creates a undirected edge type.
neighbors[in] If TRUE, this indexes neighbor nodes, otherwise not.
Returns:
Unique Dex type identifier.
long com::sparsity::dex::gdb::Graph::NewNode ( int  type)

Creates a new node instance.

Parameters:
type[in] Dex type identifier.
Returns:
Unique OID of the new node instance.
int com::sparsity::dex::gdb::Graph::NewNodeType ( System.String  name)

Creates a new node type.

Parameters:
name[in] Unique name for the new node type.
Returns:
Unique Dex type identifier.
int com::sparsity::dex::gdb::Graph::NewRestrictedEdgeType ( System.String  name,
int  tail,
int  head,
bool  neighbors 
)

Creates a new restricted edge type.

Parameters:
name[in] Unique name for the new edge type.
tail[in] Tail Dex node type identifier.
head[in] Head Dex node type identifier.
neighbors[in] If TRUE, this indexes neighbor nodes, otherwise not.
Returns:
Unique Dex type identifier.
int com::sparsity::dex::gdb::Graph::NewSessionAttribute ( int  type,
com.sparsity.dex.gdb.DataType  dt,
com.sparsity.dex.gdb.AttributeKind  kind 
)

Creates a new Session attribute.

Session attributes are exclusive for the Session (just its Session can use the attribute) and are automatically removed when the Session is closed (thus, attribute data is not persistent into the database).

Since they are not persistent, they cannot be retrieved from the database, so they do not have an identifier name.

Parameters:
type[in] Dex node or edge type identifier.
dt[in] Data type for the new attribute.
kind[in] Attribute kind.
Returns:
Unique Dex attribute identifier.
int com::sparsity::dex::gdb::Graph::NewSessionAttribute ( int  type,
com.sparsity.dex.gdb.DataType  dt,
com.sparsity.dex.gdb.AttributeKind  kind,
com.sparsity.dex.gdb.Value  defaultValue 
)

Creates a new Session attribute with a default value.

Session attributes are exclusive for the Session (just its Session can use the attribute) and are automatically removed when the Session is closed (thus, attribute data is not persistent into the database).

Since they are not persistent, they cannot be retrieved from the database, so they do not have an identifier name.

Parameters:
type[in] Dex node or edge type identifier.
dt[in] Data type for the new attribute.
kind[in] Attribute kind.
defaultValue[in] The default value to use in each new node/edge.
Returns:
Unique Dex attribute identifier.
void com::sparsity::dex::gdb::Graph::RemoveAttribute ( int  attr)

Removes the given attribute.

Parameters:
attr[in] Dex attribute identifier.
void com::sparsity::dex::gdb::Graph::RemoveType ( int  type)

Removes the given type.

This fails if there exist attributes defined for the type or if there exist restricted edges referencing this type.

Parameters:
type[in] Dex type identifier.
com.sparsity.dex.gdb.Objects com::sparsity::dex::gdb::Graph::Select ( int  attr,
com.sparsity.dex.gdb.Condition  cond,
com.sparsity.dex.gdb.Value  lower,
com.sparsity.dex.gdb.Value  higher 
)

Selects all OIDs satisfying the given condition for the given attribute.

This allows to perform the Condition::Between operation, thus it has two Value arguments.

Parameters:
attr[in] Dex attribute identifier.
cond[in] Condition to be satisfied. It must be Condition::Between.
lower[in] Lower-bound Value to be satisfied.
higher[in] Higher-bound Value to be satisfied.
Returns:
Objects instance.
com.sparsity.dex.gdb.Objects com::sparsity::dex::gdb::Graph::Select ( int  attr,
com.sparsity.dex.gdb.Condition  cond,
com.sparsity.dex.gdb.Value  v 
)

Selects all OIDs satisfying the given condition for the given attribute.

Parameters:
attr[in] Dex attribute identifier.
cond[in] Condition to be satisfied.
v[in] Value to be satisfied.
Returns:
Objects instance.
com.sparsity.dex.gdb.Objects com::sparsity::dex::gdb::Graph::Select ( int  type)

Selects all OIDs belonging to the given type.

Parameters:
type[in] Dex type identifier.
Returns:
Objects instance.
void com::sparsity::dex::gdb::Graph::SetAttribute ( long  oid,
int  attr,
com.sparsity.dex.gdb.Value  v 
)

Sets the Value for the given attribute and OID.

Parameters:
oid[in] Dex OID.
attr[in] Dex attribute identifier.
v[in] Value for the given attribute and for the given OID.
void com::sparsity::dex::gdb::Graph::SetAttributeDefaultValue ( int  attr,
com.sparsity.dex.gdb.Value  v 
)

Sets a default value for an attribute.

The default value will be applied to all the new nodes or edges.

The given value must have the same DataType as the attribute or be a NULL value to remove the current default value.

Parameters:
attr[in] The attribute.
v[in] The default value to use for this attribute.
void com::sparsity::dex::gdb::Graph::SetAttributeText ( long  oid,
int  attr,
com.sparsity.dex.gdb.TextStream  tstream 
)

Sets the writable TextStream for the given text attribute and OID.

Parameters:
oid[in] Dex OID.
attr[in] Dex attribute identifier.
tstream[in] New Text value. This corresponds to a TextStream to write.
com.sparsity.dex.gdb.Objects com::sparsity::dex::gdb::Graph::Tails ( com.sparsity.dex.gdb.Objects  edges)

Gets all the tails from the given edges collection.

Parameters:
edges[in] Dex edge identifier collection.
Returns:
The tails collection.
void com::sparsity::dex::gdb::Graph::TailsAndHeads ( com.sparsity.dex.gdb.Objects  edges,
com.sparsity.dex.gdb.Objects  tails,
com.sparsity.dex.gdb.Objects  heads 
)

Gets all the tails and heads from the given edges collection.

Parameters:
edges[in] Dex edge identifier collection.
tails[in|out] If not NULL, all the tails will be stored here.
heads[in|out] If not NULL, all the heads will be stored here.