spo.src.SPDB.DocumentImpl
Class Relation

java.lang.Object
  |
  +--spo.src.SPDB.DocumentImpl.Relation

public class Relation
extends java.lang.Object

A class that represents a set of SPOs


Field Summary
(package private)  DBUtil dbutil
           
(package private) static int MAX_SPO_NUMBER
           
(package private)  java.lang.String name
           
(package private)  int rid
           
(package private)  java.lang.String schemaURL
           
(package private)  int size
           
(package private)  java.util.Vector spos
           
 
Constructor Summary
Relation(DBUtil dbutil)
          Initialize an instance for the class
Relation(java.lang.String name, DBUtil dbutil)
          Initialize an instance for the class
Relation(java.lang.String name, java.lang.String schemaURL, DBUtil dbutil)
          Initialize an instance for the class
Relation(java.lang.String name, java.util.Vector spos, DBUtil dbutil)
          Initialize an instance for the class
 
Method Summary
 void conditionalize(java.util.ArrayList query)
          Conditionalize SPOs from the relation by Table
 int create()
          Create the relation
 void delete(java.lang.String[] where)
          Delete SPOs which satisfy the condition
 int drop()
          Drop the relation
 boolean getInitialized()
           
 java.lang.String getName()
           
 java.lang.String getNames()
          Get names of the relations in the database
 int getRID()
           
 java.lang.String getSchema()
          Get the schema name of the current relation
 java.lang.String getSchemaURL()
           
 int getSize()
           
 java.util.Vector getSPOs()
           
 void insert()
          Insert the relation into database
 void join(Relation relation)
          Left Join with another relation
 void product(Relation relation)
          Cartesian product with another relation
 void project(java.util.ArrayList query)
          Project SPOs from the relation
 void projectAll()
          new methods start here.
 void projectOnCONS(java.lang.String[] subquery, java.lang.String type)
          Project SPOs from the relation by CONS
 void projectOnVAR(java.lang.String[] subquery)
          Project SPOs from the relation by VAR
 void reset(org.w3c.dom.NodeList spoList, int ith)
           
 void select(java.util.ArrayList query)
          Select SPOs from the relation
 void selectAll()
          Select all the SPOs in the relation
 void selectOnCONS(java.lang.String[] subquery, java.lang.String type)
          Select SPOs from the relation by CONS
 void selectOnProbability(java.lang.String[] subquery)
          Select SPOs from the relation by Probability
 void selectOnTable(java.lang.String[] subquery)
          Select SPOs from the relation by Table
 void selectOnVAR(java.lang.String[] subquery)
          Select SPOs from the relation by VAR
 void set(org.w3c.dom.NodeList spoList)
          Initialize an instance for the class
 void setInitialized(boolean init)
           
 void setName(java.lang.String name)
           
 void setRID(int rid)
           
 void setSchemaURL(java.lang.String schema)
           
 void setSize(int size)
           
 void setSPOs(java.util.Vector spos)
           
 java.lang.String toXML()
          Transform a relation object to XML
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rid

int rid

size

int size

name

java.lang.String name

schemaURL

java.lang.String schemaURL

spos

java.util.Vector spos

dbutil

DBUtil dbutil

MAX_SPO_NUMBER

static final int MAX_SPO_NUMBER
See Also:
Constant Field Values
Constructor Detail

Relation

public Relation(DBUtil dbutil)
Initialize an instance for the class

Parameters:
dbutil - A DBUtil utility object

Relation

public Relation(java.lang.String name,
                DBUtil dbutil)
Initialize an instance for the class

Parameters:
name - name of the relation
dbutil - A DBUtil utility object

Relation

public Relation(java.lang.String name,
                java.lang.String schemaURL,
                DBUtil dbutil)
Initialize an instance for the class

Parameters:
name - name of the relation
schemaURL - URL name of the schema
dbutil - A DBUtil utility object

Relation

public Relation(java.lang.String name,
                java.util.Vector spos,
                DBUtil dbutil)
Initialize an instance for the class

Parameters:
name - name of the relation
spos - the SPO objects in Vector format
dbutil - A DBUtil utility object
Method Detail

set

public void set(org.w3c.dom.NodeList spoList)
Initialize an instance for the class

Parameters:
spoList - the SPO objects in XML DOM NodeList format

reset

public void reset(org.w3c.dom.NodeList spoList,
                  int ith)

getNames

public java.lang.String getNames()
Get names of the relations in the database


getSchema

public java.lang.String getSchema()
Get the schema name of the current relation


create

public int create()
Create the relation


drop

public int drop()
Drop the relation


insert

public void insert()
Insert the relation into database


delete

public void delete(java.lang.String[] where)
Delete SPOs which satisfy the condition

Parameters:
where - the condition where clause

toXML

public java.lang.String toXML()
Transform a relation object to XML


selectAll

public void selectAll()
               throws java.lang.Exception
Select all the SPOs in the relation

java.lang.Exception

select

public void select(java.util.ArrayList query)
            throws java.lang.Exception
Select SPOs from the relation

Parameters:
query - the structured query in ArrayList format
java.lang.Exception

projectAll

public void projectAll()
                throws java.lang.Exception
new methods start here. Project all the SPOs in the relation

java.lang.Exception

project

public void project(java.util.ArrayList query)
             throws java.lang.Exception
Project SPOs from the relation

Parameters:
query - the structured query in ArrayList format
java.lang.Exception

conditionalize

public void conditionalize(java.util.ArrayList query)
                    throws java.lang.Exception
Conditionalize SPOs from the relation by Table

Parameters:
query - the structured query in Hashtable format
java.lang.Exception

product

public void product(Relation relation)
             throws java.lang.Exception
Cartesian product with another relation

Parameters:
relation - right operand of the cartesian operator
java.lang.Exception

join

public void join(Relation relation)
          throws java.lang.Exception
Left Join with another relation

Parameters:
relation - right operand of the left Join operator
java.lang.Exception

selectOnCONS

public void selectOnCONS(java.lang.String[] subquery,
                         java.lang.String type)
                  throws java.lang.Exception
Select SPOs from the relation by CONS

java.lang.Exception

selectOnVAR

public void selectOnVAR(java.lang.String[] subquery)
                 throws java.lang.Exception
Select SPOs from the relation by VAR

java.lang.Exception

selectOnTable

public void selectOnTable(java.lang.String[] subquery)
                   throws java.lang.Exception
Select SPOs from the relation by Table

java.lang.Exception

selectOnProbability

public void selectOnProbability(java.lang.String[] subquery)
                         throws java.lang.Exception
Select SPOs from the relation by Probability

java.lang.Exception

projectOnCONS

public void projectOnCONS(java.lang.String[] subquery,
                          java.lang.String type)
                   throws java.lang.Exception
Project SPOs from the relation by CONS

java.lang.Exception

projectOnVAR

public void projectOnVAR(java.lang.String[] subquery)
                  throws java.lang.Exception
Project SPOs from the relation by VAR

java.lang.Exception

setRID

public void setRID(int rid)

getRID

public int getRID()

setName

public void setName(java.lang.String name)

getName

public java.lang.String getName()

setSize

public void setSize(int size)

getSize

public int getSize()

setSchemaURL

public void setSchemaURL(java.lang.String schema)

getSchemaURL

public java.lang.String getSchemaURL()

setInitialized

public void setInitialized(boolean init)

getInitialized

public boolean getInitialized()

setSPOs

public void setSPOs(java.util.Vector spos)

getSPOs

public java.util.Vector getSPOs()


Copyright © 2003 UKCS. All Rights Reserved.