The VTable
class (vertex-table) stores graph-relational data and implements graph-relational algebra operators. Supported domains/data-types are 'D'ouble, 'I'nt, 'L'ong, 'S'tring, and 'T'imeNum.
Value parameters
- domain_
-
the domains/data-types for attributes ('D', 'I', 'L', 'S', 'X', 'T')
- key_
-
the attributes forming the primary key
- name_
-
the name of the vertex-table
- schema_
-
the attributes for the vertex-table
Attributes
- Companion
- object
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Add a vertex to this vertex-table (vertex contains a tuple).
Add a vertex to this vertex-table (vertex contains a tuple).
Value parameters
- v
-
the vertex to add
Attributes
Add two edges from vertex u to vertex v and from v to u both with edge-label elab.
Add two edges from vertex u to vertex v and from v to u both with edge-label elab.
Value parameters
- elab
-
the edge-label, e.g., taughtBy (pid)
- elab2
-
the edge-label in the reverse direction, e.g., teaches (cid)
- u
-
the source vertex, course
- v
-
the target vertex, e.g., professor teaching the course
- vtab
-
the target vertex's vertex-table
Attributes
Add an edge from vertex u to vertex v with edge-label elab.
Add an edge from vertex u to vertex v with edge-label elab.
Value parameters
- eLab
-
the edge-label, e.g., taughtBy
- u
-
the source vertex, course
- v
-
the target vertex, e.g., professor teaching the course
Attributes
Add an edge type to this vertex-table (analog of a foreign key).
Add an edge type to this vertex-table (analog of a foreign key).
Value parameters
- elab
-
the edge-label for this edge type
- to
-
the vertex-table/vertex type for the target vertices
- unique
-
whether the target vertex is unique, e.g., many-to-one relationship
Attributes
Add edges from vertex u to vertices vs with edge-label elab.
Add edges from vertex u to vertices vs with edge-label elab.
Value parameters
- elab
-
the edge-label, e.g., teaches (cid)
- u
-
the source vertex, e.g., professor
- vs
-
the target vertices, e.g., courses being taught
Attributes
Create and add a vertex to this vertex-table.
Create and add a vertex to this vertex-table.
Value parameters
- t
-
the tuple for creating a vertex to add
Attributes
Create an edge table containing all edges with the given edges label connecting vertices in this vertex-table to vertices in the reference table. FIX - allow wild-card (e.g., *) for matching any edge-label
Create an edge table containing all edges with the given edges label connecting vertices in this vertex-table to vertices in the reference table. FIX - allow wild-card (e.g., *) for matching any edge-label
Value parameters
- ref
-
the foreign key reference (edge-label, referenced table)
Attributes
Compute the EDGE JOIN of this vertex-table and the referenced table keeping concatenated vertices that are linked with edges having the given edge-label. Replaces fkey = pkey join and uses INDEX-FREE ADJACENCY. FIX - allow wild-card (e.g., *) for matching any edge-label
Compute the EDGE JOIN of this vertex-table and the referenced table keeping concatenated vertices that are linked with edges having the given edge-label. Replaces fkey = pkey join and uses INDEX-FREE ADJACENCY. FIX - allow wild-card (e.g., *) for matching any edge-label
Value parameters
- ref
-
the foreign key reference (edge-label, referenced table, back edge-label)
Attributes
EXPAND from this to the referenced vertex-table and extract schema x from this vertex-table and the referenced table. Acts as a lightweight join-project operator that only extracts attributes in schema x and does not create new edges.
EXPAND from this to the referenced vertex-table and extract schema x from this vertex-table and the referenced table. Acts as a lightweight join-project operator that only extracts attributes in schema x and does not create new edges.
Value parameters
- ref
-
the foreign key reference (edge-label, referenced table)
- x
-
the attributes to extract/collect from this and the referenced table.
Attributes
Return the primary key for the given vertex.
Return the primary key for the given vertex.
Value parameters
- v
-
the given vertex
Attributes
INTERSECT this vertex-table and r2. Check that the two tables are compatible. If they are not, return the first table.
Compute this vertex-table MINUS (set difference) table r2 (this - r2). Check that the two tables are compatible. If they are not, return the first table.
Reset the width of column col to w.
Reset the width of column col to w.
Value parameters
- col
-
the column whose width is to be adjusted
- w
-
the new width (# chars) for column col
Attributes
- Definition Classes
SELECT the vertices in this vertex-table that satisfy the given simple (3 token) condition.
UNION this vertex-table and r2. Check that the two tables are compatible. If they are not, return the first table. Caveat: Assumes the key from the first table still works (@see create_index) Acts like union-all, so to remove duplicates call create_index after union.
UNION this vertex-table and r2. Check that the two tables are compatible. If they are not, return the first table. Caveat: Assumes the key from the first table still works (@see create_index) Acts like union-all, so to remove duplicates call create_index after union.
Value parameters
- r2
-
the second table (may be a Table or VTable)
Attributes
- Definition Classes
Inherited methods
ADD (insert) tuple t into this table checking to make sure the domains are correct. Also, checks referential integrity for any foreign keys in the tuple. Return true iff the tuple passes the type check and reference check.
ADD (insert) tuple t into this table checking to make sure the domains are correct. Also, checks referential integrity for any foreign keys in the tuple. Return true iff the tuple passes the type check and reference check.
Value parameters
- t
-
the tuple to be inserted
Attributes
- Inherited from:
- Table
Add LINKAGE from this table to the refTab, by adding a FOREIGN KEY CONSTRAINT to this table specifying the foreign key attribute fkey and the table it references refTab. If refTab does not have a primary index already, make one. Caveat: a foreign key may not be composite.
Add LINKAGE from this table to the refTab, by adding a FOREIGN KEY CONSTRAINT to this table specifying the foreign key attribute fkey and the table it references refTab. If refTab does not have a primary index already, make one. Caveat: a foreign key may not be composite.
Value parameters
- fkey
-
the foreign key attribute
- refTab
-
the table being referenced (to its primary key)
Attributes
- Inherited from:
- Table
Value parameters
- ag
-
the attribute the table has been grouped on
- f_as
-
the aggregate function and the attribute to apply it to (as varargs)
Attributes
- Inherited from:
- Table
Return the table restricted to the given collection of rows.
Return the table restricted to the given collection of rows.
Value parameters
- pos
-
the given collection of rows
Attributes
- Inherited from:
- Table
Return the table restricted to the given range of rows.
Return the table restricted to the given range of rows.
Value parameters
- r
-
the given range of rows
Attributes
- Inherited from:
- Table
Return the j-th column in this table (or the passed in tuples) as an array of value-type.
Return the j-th column in this table (or the passed in tuples) as an array of value-type.
Value parameters
- j
-
the column to return
- tups
-
the collection of tuples to use (defaults to all tuples in this table)
Attributes
- Inherited from:
- Table
Return the range of columns numbers for the table.
Return the size in terms of number of columns in the table.
CREATE/recreate the primary INDEX that maps the primary key to the tuple containing it. Warning, creating an index will remove DUPLICATES based on maintaining UNIQUENESS CONSTRAINT of primary key values.
CREATE/recreate the primary INDEX that maps the primary key to the tuple containing it. Warning, creating an index will remove DUPLICATES based on maintaining UNIQUENESS CONSTRAINT of primary key values.
Value parameters
- rebuild
-
if rebuild is true, use old index to build new index; otherwise, create new index
Attributes
- Inherited from:
- Table
CREATE a non-unique INDEX (multi-valued) that maps a non-unique attribute to the tuple containing it.
CREATE a non-unique INDEX (multi-valued) that maps a non-unique attribute to the tuple containing it.
Value parameters
- atr
-
the attribute/column to create the non-unique index on
Attributes
- See also
-
scalation.database.MultiMap
- Inherited from:
- Table
CREATE a secondary unique INDEX that maps a secondary key to the tuple containing it. Has no effect on duplicates; should first create a primary index to remove duplicates, otherwise, this index may skip tuples.
CREATE a secondary unique INDEX that maps a secondary key to the tuple containing it. Has no effect on duplicates; should first create a primary index to remove duplicates, otherwise, this index may skip tuples.
Value parameters
- atr
-
the attribute/column to create the index on
Attributes
- Inherited from:
- Table
DELETE all tuples in this table satisfying the deletion predicate. If there is an index, remove those tuples from the index as well. Return true iff at least one tuple is deleted.
DELETE all tuples in this table satisfying the deletion predicate. If there is an index, remove those tuples from the index as well. Return true iff at least one tuple is deleted.
Value parameters
- predicate
-
the predicate that specifies which tuples to delete
Attributes
- Inherited from:
- Table
Return the cardinality (number of tuples) and arity (number of attributes).
Return the cardinality (number of tuples) and arity (number of attributes).
Attributes
- Inherited from:
- Tabular
DROP the primary INDEX that maps the primary key to the tuple containing it.
DROP the primary INDEX that maps the primary key to the tuple containing it.
Attributes
- Inherited from:
- Table
DROP a non-unique INDEX that maps a non-unique attribute to the tuple containing it.
DROP a non-unique INDEX that maps a non-unique attribute to the tuple containing it.
Attributes
- Inherited from:
- Table
DROP a secondary INDEX that maps a secondary key to the tuple containing it.
DROP a secondary INDEX that maps a secondary key to the tuple containing it.
Attributes
- Inherited from:
- Table
Return the i-th primary key.
Return the i-th primary key.
Value parameters
- i
-
the index in the tuples/row index
Attributes
- Inherited from:
- Table
Determine whether this table and r2 are incompatible by having differing domains.
Determine whether this table and r2 are incompatible by having differing domains.
Value parameters
- r2
-
the second table
Attributes
- Inherited from:
- Tabular
Return the range of row numbers for the table.
Value parameters
- ref
-
the foreign key reference (foreign key attribute, referenced table)
Attributes
- Inherited from:
- Table
Value parameters
- r2
-
the second table
- x
-
the subschema/attributes for the first/this table
- y
-
the subschema/attributes for the second table
Attributes
- Inherited from:
- Table
Value parameters
- condition
-
the simple condition "a1 op a2"
- r2
-
the second table
Attributes
- Inherited from:
- Table
Value parameters
- predicate
-
the join predicate to be satisfied
- r2
-
the second table
Attributes
- Inherited from:
- Table
Value parameters
- ref
-
the foreign key reference (foreign key attribute, referenced table)
Attributes
- Inherited from:
- Table
Value parameters
- r2
-
the second table
- x
-
the subschema/attributes for the left/first/this table
- y
-
the subschema/attributes for the right/second table
Attributes
- Inherited from:
- Table
Compute the LEFT-JOIN of this table and r2 keeping concatenated tuples that are equal on specified attributes. Also, keep all tuples in the left table padding the missing attributes with null.
Compute the LEFT-JOIN of this table and r2 keeping concatenated tuples that are equal on specified attributes. Also, keep all tuples in the left table padding the missing attributes with null.
Value parameters
- r2
-
the second table
Attributes
- Inherited from:
- Tabular
Create a tuple with missing values for each column according to the given domains. This method is used by leftJoin.
Create a tuple with missing values for each column according to the given domains. This method is used by leftJoin.
Value parameters
- domain
-
the domains of the table for which a null tuple is required
Attributes
- Inherited from:
- Tabular
Attributes
- Inherited from:
- Product
Attributes
- Inherited from:
- Product
PRINT value-type v with a width of w.
PRINT value-type v with a width of w.
Value parameters
- v
-
the value to be printed
- w
-
the width (# chars) for the column
Attributes
- Inherited from:
- Table
Pull the domains out of this table for the attributes in subschema column positions cp.
Pull the domains out of this table for the attributes in subschema column positions cp.
Value parameters
- cp
-
the subschema/attribute column positions to be collected
Attributes
- Inherited from:
- Tabular
Pull the domains out of this table for the attributes in subschema x.
Pull the domains out of this table for the attributes in subschema x.
Value parameters
- x
-
the subschema/attributes to be collected
Attributes
- Inherited from:
- Tabular
Pull a value out of tuple t for attribute a.
Pull a value out of tuple t for attribute a.
Value parameters
- a
-
the attribute to be collected
- t
-
the given tuple to pull value out of
Attributes
- Inherited from:
- Tabular
Pull the values out of row t for the attributes in subschema column positions cp.
Pull the values out of row t for the attributes in subschema column positions cp.
Value parameters
- cp
-
the subschema/attribute column positions to be collected
- t
-
the given row to pull values out of
Attributes
- Inherited from:
- Tabular
Pull the values out of row t for the attributes in subschema x.
Pull the values out of row t for the attributes in subschema x.
Value parameters
- t
-
the given row to pull values out of
- x
-
the subschema/attributes to be collected
Attributes
- Inherited from:
- Tabular
Pull the values out of tuple t for the attributes in subschema column positions cp.
Pull the values out of tuple t for the attributes in subschema column positions cp.
Value parameters
- cp
-
the subschema/attribute column positions to be collected
- t
-
the given tuple to pull values out of
Attributes
- Inherited from:
- Tabular
Pull the values out of tuple t for the attributes in subschema x.
Pull the values out of tuple t for the attributes in subschema x.
Value parameters
- t
-
the given tuple to pull values out of
- x
-
the subschema/attributes to be collected
Attributes
- Inherited from:
- Tabular
Check that all the foreign keys values in tuple t satisfy their REFERENTIAL INTEGRITY CONSTRAINTS.
Check that all the foreign keys values in tuple t satisfy their REFERENTIAL INTEGRITY CONSTRAINTS.
Value parameters
- t
-
the tuple being checked for referential integrity
Attributes
- Inherited from:
- Table
Compute the RIGHT-JOIN of this table and r2 keeping concatenated tuples that are equal on specified attributes. Also, keep all tuples in the right table padding the missing attributes with null.
Compute the RIGHT-JOIN of this table and r2 keeping concatenated tuples that are equal on specified attributes. Also, keep all tuples in the right table padding the missing attributes with null.
Value parameters
- r2
-
the second table
Attributes
- Inherited from:
- Tabular
Compute the RIGHT-EQUI-JOIN of this table and r2 keeping concatenated tuples that are equal on specified attributes. Also, keep all tuples in the right table padding the missing attributes with null.
Compute the RIGHT-EQUI-JOIN of this table and r2 keeping concatenated tuples that are equal on specified attributes. Also, keep all tuples in the right table padding the missing attributes with null.
Value parameters
- r2
-
the second table
- x
-
the subschema/attributes for the left/first/this table
- y
-
the subschema/attributes for the right/second table
Attributes
- Inherited from:
- Tabular
Return the cardinality (number of tuples) in this table.
SAVE this table in a file using serialization.
SAVE this table in a file using serialization.
Attributes
- See also
-
load in
Table
object - Inherited from:
- Table
Value parameters
- a
-
the attribute name of the column used for selection
- apred
-
the atomic predicate (
Boolean
function) to be satisfied
Attributes
- Inherited from:
- Table
Value parameters
- a
-
the attribute name of the column used for selection
- apred
-
the atomic predicate (
Boolean
function) to be satisfied
Attributes
- Inherited from:
- Table
Convert the tuples in tups into a string, e.g., for displaying a collection of tuples.
Convert the tuples in tups into a string, e.g., for displaying a collection of tuples.
Value parameters
- tups
-
the tuples to be converted to a string
Attributes
- Inherited from:
- Tabular
SHOW/print this table's foreign keys.
SHOW/print this table's primary index.
Return the basic statistics for each column of this table.
Convert a String
into a ValueType
with the given domain.
Convert a String
into a ValueType
with the given domain.
Value parameters
- dom
-
the domain/data-type to convert it into
- str
-
the given string
Attributes
- Inherited from:
- Table
CONVERT this table to a matrix of doubles by making the necessary type transformations.
CONVERT this table to a matrix of doubles by making the necessary type transformations.
Value parameters
- cols
-
the column positions to use for forming the matrix
Attributes
- See also
-
the
fromMatrix
method - Inherited from:
- Table
CONVERT this table to a matrix and a vector of doubles by making the necessary type transformations. Usage: table -> (X, y) for linear algebra/regression problem Xb = y.
CONVERT this table to a matrix and a vector of doubles by making the necessary type transformations. Usage: table -> (X, y) for linear algebra/regression problem Xb = y.
Value parameters
- colj
-
the column position to use for forming the vector
- cols
-
the column positions to use for forming the matrix
Attributes
- Inherited from:
- Table
CONVERT the colj column of this table into a vector of doubles, etc.
CONVERT the colj column of this table into a vector of doubles, etc.
Value parameters
- colj
-
the column position to use for the vector
Attributes
- Inherited from:
- Table
Check the size of the tuple (number of elements) as well as the type of each value to ensure it is from the right domain (satisfies the DOMAIN CONSTRAINTS).
Check the size of the tuple (number of elements) as well as the type of each value to ensure it is from the right domain (satisfies the DOMAIN CONSTRAINTS).
Value parameters
- t
-
the tuple to be type checked
Attributes
- Inherited from:
- Tabular
UPDATE the column with attribute name a using function func for elements with value matchVal. Return true iff at least one tuple is updated.
UPDATE the column with attribute name a using function func for elements with value matchVal. Return true iff at least one tuple is updated.
Value parameters
- a
-
the attribute name for the column to be updated
- func
-
the function used to assign updated values
- matchVal
-
the value to be matched to elements
Attributes
- Inherited from:
- Table
UPDATE the column with attribute name a using newVal for elements with value matchVal. Return true iff at least one tuple is updated.
UPDATE the column with attribute name a using newVal for elements with value matchVal. Return true iff at least one tuple is updated.
Value parameters
- a
-
the attribute name for the column to be updated
- matchVal
-
the value to be matched to elements
- newVal
-
the value used to assign updated values
Attributes
- Inherited from:
- Table
WRITE this table into a Comma-Separated-Value (CSV) file with each tuple written to a line.
WRITE this table into a Comma-Separated-Value (CSV) file with each tuple written to a line.
Value parameters
- fileName
-
the file name of the data file (defaults to "name.csv")
Attributes
- Inherited from:
- Table
WRITE this table into a JavaScript Object Notation (JSON) file.
WRITE this table into a JavaScript Object Notation (JSON) file.
Value parameters
- fileName
-
the file name of the data file
Attributes
- Inherited from:
- Table
Attributes
- Inherited from:
- Tabular
Attributes
- Inherited from:
- Tabular
Attributes
- Inherited from:
- Tabular
Attributes
- Inherited from:
- Tabular