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

java.lang.Object
  |
  +--gr.forth.ics.rssdb.storage.DBStorage
        |
        +--gr.forth.ics.rssdb.storage.specrepr.SpecReprDBStorage
Direct Known Subclasses:
SpecReprVar1DBStorage

public class SpecReprDBStorage
extends DBStorage

Validates and Stores RDF descriptions in SPECIFIC/SPECIFIC_NOSUBTABLE representation

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

Fields inherited from class gr.forth.ics.rssdb.storage.DBStorage
con, DATA_PROPERTY, EMPTY, ENUMERATION_ELEMENT_PROPERTY, hlabel, RDFSUITE_NS, repr, resourcesIDs, SPECIFIC, SPECIFIC_NOSUBTABLE, SPECIFIC_UNIQUETABLE, stmt, subclass_dag, subproperty_dag, VRPModel
 
Constructor Summary
SpecReprDBStorage(int repr)
           
 
Method Summary
protected  void createInitIndexes(java.sql.Statement stmt)
          Indexes are created on the core database tables and on the table where data resources are stored.
protected  void createPrimitiveTableIndexes(java.sql.Statement stmt)
          Indexes are defined on the primitive tables.
protected  void createPrimitiveTables(java.sql.Statement stmt)
          The core/primitive tables of the database representation are created and they are populated with data.
protected  boolean existMultipleLevelClassifiedResource()
          Checks if there are resources in the db that are stored both at schema and data level.
protected  void initPreparedStatements()
          Initialize prepared statements used for the storage
 boolean store(java.lang.String input, java.lang.String dbPath)
          Validates and store RDF descriptions
protected  int storeClass(DBValidator dbv)
          Stores classes
protected  void storeClassDescriptions()
          Stores classes data descriptions
protected  int storeMetaClass()
          Stores metaclasses
protected  void storePrimitiveSchema()
          Stores primitive schema
protected  int storeProperty(DBValidator dbv)
          Stores properties
protected  void storePropertyLinks()
          Stores property data descriptions
protected  void storeResource()
          Stores data resources
 boolean storeThesaurus(java.lang.String input, java.lang.String dbPath)
          Stores thesauri that conform to the CWTH DTD.
 
Methods inherited from class gr.forth.ics.rssdb.storage.DBStorage
closeConnection, commitTransaction, getConnection, getCreateIndex, getCurrentNS, getDBMSRepresentation, getDomainRangeTypeIds, getGUI, getMaxLiteralLength, getMaxLpartLength, getMaxPrefixLength, getMaxURILength, getNamespaceID, getNewData, getNewSchema, getNextAnonID, getNextNSID, getNextThesTypeEnumID, getOutFile, getOutput, getPermitSchemaRendundancies, getPropertyTableID, getRepr, getResourceID, getResourceIDs, getResourceLabel, getResourceURI, getStatement, getStatistics, getStoredData, getStoredNS, getStoredSchema, getVerbose, getVRPModel, getXMLSchemaDTID, getXMLSchemaDTRQLID, initResourceIDs, isHierarchyDAG, isJDBCDriverAccessible, isXMLSchemaDTID, openConnection, rollbackTransaction, setAuthentication, setCreateIndex, setDBFunctionsPath, setDomainRangeTypeIds, setGUI, setHierarchyDAG, setMaxLiteralLength, setMaxLpartLength, setMaxPrefixLength, setMaxURILength, setModelStatistics, setModifiedNamespace, setNewData, setNewSchema, setOutFile, setPropertyTableID, setResourceID, setResourceIDs, setResourceURI, setStoredData, setStoredSchema, setTimeStatistics, setVerbose, storePrimitiveFunctions
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SpecReprDBStorage

public SpecReprDBStorage(int repr)
Method Detail

createPrimitiveTables

protected void createPrimitiveTables(java.sql.Statement stmt)
                              throws java.sql.SQLException
The core/primitive tables of the database representation are created and they are populated with data.

storePrimitiveSchema

protected void storePrimitiveSchema()
                             throws java.sql.SQLException
Description copied from class: DBStorage
Stores primitive schema
Overrides:
storePrimitiveSchema in class DBStorage

createPrimitiveTableIndexes

protected void createPrimitiveTableIndexes(java.sql.Statement stmt)
                                    throws java.sql.SQLException
Indexes are defined on the primitive tables.

createInitIndexes

protected void createInitIndexes(java.sql.Statement stmt)
                          throws java.sql.SQLException
Indexes are created on the core database tables and on the table where data resources are stored.

initPreparedStatements

protected void initPreparedStatements()
                               throws java.sql.SQLException
Description copied from class: DBStorage
Initialize prepared statements used for the storage
Overrides:
initPreparedStatements in class DBStorage

storeMetaClass

protected int storeMetaClass()
                      throws java.sql.SQLException
Description copied from class: DBStorage
Stores metaclasses
Overrides:
storeMetaClass in class DBStorage

storeClass

protected int storeClass(DBValidator dbv)
                  throws java.sql.SQLException
Description copied from class: DBStorage
Stores classes
Overrides:
storeClass in class DBStorage

storeClassDescriptions

protected void storeClassDescriptions()
                               throws java.sql.SQLException
Description copied from class: DBStorage
Stores classes data descriptions
Overrides:
storeClassDescriptions in class DBStorage

storeProperty

protected int storeProperty(DBValidator dbv)
                     throws java.sql.SQLException
Description copied from class: DBStorage
Stores properties
Overrides:
storeProperty in class DBStorage

storePropertyLinks

protected void storePropertyLinks()
                           throws java.sql.SQLException
Description copied from class: DBStorage
Stores property data descriptions
Overrides:
storePropertyLinks in class DBStorage

existMultipleLevelClassifiedResource

protected boolean existMultipleLevelClassifiedResource()
                                                throws java.sql.SQLException
Checks if there are resources in the db that are stored both at schema and data level.
Overrides:
existMultipleLevelClassifiedResource in class DBStorage

storeResource

protected void storeResource()
                      throws java.sql.SQLException
Description copied from class: DBStorage
Stores data resources
Overrides:
storeResource in class DBStorage

store

public boolean store(java.lang.String input,
                     java.lang.String dbPath)
Validates and store RDF descriptions
Overrides:
store in class DBStorage
Parameters:
input - The file or the URL you want to store (e.g., http://www.ics.forth.gr/isl/RDF/VRP/Examples/cweb.rdf).
dbPath - The database URL. The format is: <postgreSQL server>:<port>/<dbname> postgreSQL server: The machine where postgreSQL server is running. port: The port where postgreSQL server is running. dbname: database name, e.g., athena.ics.forth.gr:8080/testdb
Returns:
True if the file is valid and has been stored in the db, otherwise returns false

storeThesaurus

public boolean storeThesaurus(java.lang.String input,
                              java.lang.String dbPath)
Stores thesauri that conform to the CWTH DTD. It considers that thesaurus is valid.
Overrides:
storeThesaurus in class DBStorage
Parameters:
input - the thesaurus file. Note: Make sure that the thesaurus file has read permissions for PostgreSQL account (i.e. the person that has run the postgreSQL commands initdb and postmaster) and that the path to the file is accessible by the machine where postgreSQL server is running.
dbPath - The database URL. The format is: <postgreSQL server>:<port>/<dbname> postgreSQL server: The machine where postgreSQL server is running. port: The port where postgreSQL server is running. dbname: database name, e.g., athena.ics.forth.gr:8080/testdb
Returns:
True if the thesaurus has been stored in the db, otherwise returns false