gr.forth.ics.rssdb.storage.specrepr
Class SpecReprMetaClass

java.lang.Object
  |
  +--gr.forth.ics.rssdb.storage.DBMetaClass
        |
        +--gr.forth.ics.rssdb.storage.specrepr.SpecReprMetaClass

public class SpecReprMetaClass
extends DBMetaClass

Version:
2.0 (23 July 2003)
Author:
Sofia Alexaki

Field Summary
protected static java.sql.PreparedStatement addMC
          PreparedStatement for adding tuples in the MetaClass table
protected static java.sql.PreparedStatement addMetaClassChild
          PreparedStatement for adding the metaclasses that are descendants of the current metaclass, through non-tree arcs in the MetaClass_Anc table
protected static java.sql.PreparedStatement addMetaPropertyChild
          PreparedStatement for adding the metaproperties that are descendants of the current metaproperty, through non-tree arcs in the MetaProperty_Anc table
protected static java.sql.PreparedStatement addSubMetaClass
          PreparedStatement for adding tuples in the SubMetaClass table
protected static java.sql.PreparedStatement addSubMetaProperty
          PreparedStatement for adding tuples in the SubMetaClass table
protected static java.sql.PreparedStatement isMC
          PreparedStatement for checking the kind of a MetaClass
 
Constructor Summary
SpecReprMetaClass(gr.forth.ics.vrp.corevrp.model.RDF_MetaClass metaclass, DBStorage storage)
           
 
Method Summary
 boolean checkStoredSubClass()
          Tests if the superclasses of the Metaclass are identical to those stored in DBMS for this metaclass.
static int[] contains(int mcid, java.lang.String URI, DBStorage storage)
          Indicates if the object with URI is instance of the metaclass/property with post number mcid
static java.util.HashMap getMetaClasses(java.sql.Connection con)
          Returns the metaclasses that are stored in the db.
static java.lang.String getURI(java.sql.Connection con, int id)
           
static void initPreparedStatements(java.sql.Connection con)
          Initializes the Prepared Statements required for storing an MetaClass object in the database.
static int isMetaClass(int mcid)
          Checks if the stored object with id is a MetaClass.
static boolean isSubClass(int subpost, int suppost, int subindex, int supindex, boolean includeClass, boolean isDAG, java.sql.Connection con)
          Returns true if the metaclass with post number is subclass of the metaclass with post number and index
 int store()
          Stores a MetaClass in the db.
 void storeMetaClass()
          Stores the RDF_MetaClass in the table MetaClass
 void storeSubMetaClass()
          Stores in the SubMetaClass/Property table the rdfs:subClassOf link that is defined on RDF_MetaClass object and is an arc of the tree constructed during the labeling on the metaclass/property hierarchy .
 
Methods inherited from class gr.forth.ics.rssdb.storage.DBMetaClass
getMetaClass, getStorage, setMetaClass, setStorage
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

addMC

protected static java.sql.PreparedStatement addMC
PreparedStatement for adding tuples in the MetaClass table

addSubMetaClass

protected static java.sql.PreparedStatement addSubMetaClass
PreparedStatement for adding tuples in the SubMetaClass table

addSubMetaProperty

protected static java.sql.PreparedStatement addSubMetaProperty
PreparedStatement for adding tuples in the SubMetaClass table

addMetaClassChild

protected static java.sql.PreparedStatement addMetaClassChild
PreparedStatement for adding the metaclasses that are descendants of the current metaclass, through non-tree arcs in the MetaClass_Anc table

addMetaPropertyChild

protected static java.sql.PreparedStatement addMetaPropertyChild
PreparedStatement for adding the metaproperties that are descendants of the current metaproperty, through non-tree arcs in the MetaProperty_Anc table

isMC

protected static java.sql.PreparedStatement isMC
PreparedStatement for checking the kind of a MetaClass
Constructor Detail

SpecReprMetaClass

public SpecReprMetaClass(gr.forth.ics.vrp.corevrp.model.RDF_MetaClass metaclass,
                         DBStorage storage)
Method Detail

initPreparedStatements

public static void initPreparedStatements(java.sql.Connection con)
                                   throws java.sql.SQLException
Initializes the Prepared Statements required for storing an MetaClass object in the database.

isMetaClass

public static int isMetaClass(int mcid)
                       throws java.sql.SQLException
Checks if the stored object with id is a MetaClass.
Parameters:
mcid - Represents the integer id
Returns:
The kind of MetaClass

isSubClass

public static boolean isSubClass(int subpost,
                                 int suppost,
                                 int subindex,
                                 int supindex,
                                 boolean includeClass,
                                 boolean isDAG,
                                 java.sql.Connection con)
                          throws java.sql.SQLException
Returns true if the metaclass with post number is subclass of the metaclass with post number and index
Parameters:
subpost - The post number of the subclass
suppost - The post number of the superclass
subindex - The index number of the subclass
supindex - The index number of the superclass
includeClass - If this parameter is true, the method will return true if the numbers subpost and suppost are equal.
Returns:
Returns true if the metaclass with post number is subclass of the metaclass with post number and index otherwise returns false.

store

public int store()
          throws java.sql.SQLException
Stores a MetaClass in the db.

storeMetaClass

public void storeMetaClass()
                    throws java.sql.SQLException
Stores the RDF_MetaClass in the table MetaClass

storeSubMetaClass

public void storeSubMetaClass()
                       throws java.sql.SQLException
Stores in the SubMetaClass/Property table the rdfs:subClassOf link that is defined on RDF_MetaClass object and is an arc of the tree constructed during the labeling on the metaclass/property hierarchy . Moreover stores the non tree arcs of the node in the MetaClass/Property_Anc table.

getMetaClasses

public static java.util.HashMap getMetaClasses(java.sql.Connection con)
                                        throws java.sql.SQLException
Returns the metaclasses that are stored in the db.
Parameters:
con - JBDC Connection Object
Returns:
A HashMap that contains the classes that are stored in the db. Keys are the metaclasses URIs and values are arrays of integers. The first element of the array is the identifier of the metaclass. The second element is the integer that are given by RQL to classes containing either class or properties.

checkStoredSubClass

public boolean checkStoredSubClass()
                            throws java.sql.SQLException
Tests if the superclasses of the Metaclass are identical to those stored in DBMS for this metaclass.

getURI

public static java.lang.String getURI(java.sql.Connection con,
                                      int id)
                               throws java.sql.SQLException
Parameters:
con - JBDC connection object
id - Database integer identifier of a metaclass
Returns:
The URI of a metaclass

contains

public static int[] contains(int mcid,
                             java.lang.String URI,
                             DBStorage storage)
                      throws java.sql.SQLException
Indicates if the object with URI is instance of the metaclass/property with post number mcid
Parameters:
mcid - The post number of the metaclass
Returns:
The post number and the index of the class
Throws:
java.sql.SQLException -