|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--gr.forth.ics.rssdb.storage.DBStorage
This is the main class required for the storage of RDF descriptions. For every different DB representation, a class that extends the class DBStorage should be implemented.
| Field Summary | |
protected java.sql.Connection |
con
|
static java.lang.String |
DATA_PROPERTY
The name of the table in which are stored all data properties |
static int |
EMPTY
Indicates that db is empty |
static java.lang.String |
ENUMERATION_ELEMENT_PROPERTY
|
HierarchyLabel |
hlabel
|
static java.lang.String |
RDFSUITE_NS
The name of the table in which are stored all data properties |
protected int |
repr
Indicates the representation under which the RDF descriptions will be stored |
protected java.util.HashMap |
resourcesIDs
|
static int |
SPECIFIC
Represents the Specific representation suitable for ORDBMS |
static int |
SPECIFIC_NOSUBTABLE
Represents the variation of Specific representation suitable for RDBMS. |
static int |
SPECIFIC_UNIQUETABLE
Represents the variation of Specific representation where a unique table is created for all classes and a unique table for each property type |
java.sql.Statement |
stmt
|
protected gr.forth.ics.vrp.corevrp.model.RDF_DAG |
subclass_dag
Contains the RDF classes of the VRP model in hierarchical order. |
protected gr.forth.ics.vrp.corevrp.model.RDF_DAG |
subproperty_dag
Contains the RDF properties of the VRP model in hierarchical order. |
gr.forth.ics.vrp.corevrp.model.Model |
VRPModel
VRP Model of RDF descriptions. |
| Constructor Summary | |
DBStorage()
|
|
| Method Summary | |
static void |
closeConnection(java.sql.Connection con)
|
protected void |
commitTransaction()
|
protected abstract boolean |
existMultipleLevelClassifiedResource()
Checks if there are resources in the db that are stored both at schema and data level. |
java.sql.Connection |
getConnection()
|
boolean |
getCreateIndex()
|
java.lang.String |
getCurrentNS()
Returns the current namespace URI |
static int |
getDBMSRepresentation(java.lang.String dbURL,
java.util.Properties prop)
Returns the type of the db Representation (SPECIFIC, SPECIFIC_NOSUBTABLE, SPECIFIC_UNIQUETABLE, EMPTY) |
int[] |
getDomainRangeTypeIds(gr.forth.ics.vrp.corevrp.model.RDF_Property rdf_property)
Returns an array |
DBStoragePanel |
getGUI()
|
int |
getMaxLiteralLength()
Returns the maximum length of a literal value |
int |
getMaxLpartLength()
Returns |
int |
getMaxPrefixLength()
Returns the maximum length of a namespace URI(e.g., http://www.w3.org/1999/XMLSchema-datatypes) |
int |
getMaxURILength()
Returns the maximum length of the URI of a resource |
int |
getNamespaceID(java.lang.String ns)
Returns the db id of the namespace |
boolean |
getNewData()
|
boolean |
getNewSchema()
|
int |
getNextAnonID()
|
int |
getNextNSID()
|
int |
getNextThesTypeEnumID()
|
java.lang.String |
getOutFile()
Returns the output file |
StorageOutput |
getOutput()
|
boolean |
getPermitSchemaRendundancies()
Returns true if we permit Rendundant information in the schema to be stored, otherwise false. |
java.lang.String |
getPropertyTableID(gr.forth.ics.vrp.corevrp.model.RDF_Property rdf_property)
|
int |
getRepr()
Returns the representation under which the RDF descriptions will be stored |
int |
getResourceID(java.lang.String resource_uri)
Returns the DBMS identifier of the resource. |
java.util.HashMap |
getResourceIDs()
|
int[] |
getResourceLabel(java.lang.String resource_uri)
Returns the post number and the index of the |
java.lang.String |
getResourceURI(int id)
Returns the URI identifier of the resource. |
java.sql.Statement |
getStatement()
|
(package private) void |
getStatistics(gr.forth.ics.vrp.corevrp.model.Model outModel,
gr.forth.ics.vrp.corevrp.model.RDF_DAG class_dag,
gr.forth.ics.vrp.corevrp.model.RDF_DAG property_dag)
Prints statistics |
boolean |
getStoredData()
|
java.util.ArrayList |
getStoredNS()
Contains the URIs namespace of the stored schemas |
boolean |
getStoredSchema()
|
boolean |
getVerbose()
|
gr.forth.ics.vrp.corevrp.model.Model |
getVRPModel()
Returns the VRP Model of the RDF descriptions |
static int |
getXMLSchemaDTID(java.lang.String xmlSchemaDT_uri)
Returns the DBMS identifier of the xml datatype. |
static int |
getXMLSchemaDTRQLID(java.lang.String xmlSchemaDT_uri)
|
protected abstract void |
initPreparedStatements()
Initialize prepared statements used for the storage |
void |
initResourceIDs()
|
boolean |
isHierarchyDAG()
Returns true if the stored class/metaclass/property hierarchies are dags. |
static void |
isJDBCDriverAccessible()
|
static boolean |
isXMLSchemaDTID(int id)
|
static java.sql.Connection |
openConnection(java.lang.String dbURL,
java.util.Properties prop)
|
void |
rollbackTransaction()
Rollback the transaction |
void |
setAuthentication(java.lang.String log,
java.lang.String pass)
Sets your login and password. |
void |
setCreateIndex(boolean b)
|
void |
setDBFunctionsPath(java.lang.String dbfunctionsPath)
Sets the path for the rql-spi-api.so path. |
void |
setDomainRangeTypeIds(gr.forth.ics.vrp.corevrp.model.RDF_Property rdf_property,
int[] dRType)
|
void |
setGUI(DBStoragePanel gui)
|
void |
setHierarchyDAG(boolean b)
Sets the type (i.e., dag or tree) of the class/metaclass/property hierarchy. |
void |
setMaxLiteralLength(int len)
Sets the maximum length of a literal value |
void |
setMaxLpartLength(int len)
Sets the maximum length of a class or property name (e.g., Artist) |
void |
setMaxPrefixLength(int len)
Sets the maximum length of a namespace URI(e.g., http://www.w3.org/1999/XMLSchema-datatypes) |
void |
setMaxURILength(int len)
Sets the maximum length of the URI of a resource |
void |
setModelStatistics(int i,
boolean b)
Set the desired model statistics setModelStatistics(0, true): Prints the number of triples, RDF class, properties, containers, statements and resources found in the input file setModelStatistics(1, true): For subclass hierarchy, prints the number of classes contained, the average/maximum number of subclasses and the average/maximum number length of the paths setModelStatistics(2, true): similar to setModelStatistics(1, true) for property hierachy setModelStatistics(3, true): Prints the number of instances per classes setModelStatistics(4, true): Similar to setModelStatistics(1, true) but prints the statistics for every subclass hierarchy setModelStatistics(5, true): Similar to setModelStatistics(2, true) but prints the statistics for every subproperty hierarchy and not totally |
void |
setModifiedNamespace(java.lang.String modifiedNS)
Set the namespace you wish to be stored in the db for the input local file/thesaurus |
void |
setNewData(boolean b)
Validation and Storage of data descriptions is performed. |
void |
setNewSchema(boolean b)
Validation and storage of schema descriptions of a new RDF schema. |
void |
setOutFile(java.lang.String file)
Sets the output file |
void |
setPropertyTableID(gr.forth.ics.vrp.corevrp.model.RDF_Property rdf_property,
java.lang.String tableID)
|
void |
setResourceID(java.lang.String resource_uri,
int[] label)
Sets the DBMS identifier of the resource |
void |
setResourceIDs(java.util.HashMap hm)
|
void |
setResourceURI(int id,
java.lang.String resource_uri)
Sets the URI identifier of the resource |
void |
setStoredData(boolean b)
Validation and Storage of data descriptions is performed. |
void |
setStoredSchema(boolean b)
Validation and storage of schema descriptions of a new RDF schema. |
void |
setTimeStatistics(boolean b)
Enable the time statistics for validation and storage |
void |
setVerbose(boolean b)
Prints messages about the actions that are being performed by the RSSDB and the descriptions are being stored. |
protected boolean |
store(java.lang.String input,
java.lang.String dbPath)
Validates and store RDF descriptions. |
protected abstract int |
storeClass(DBValidator dbv)
Stores classes |
protected abstract void |
storeClassDescriptions()
Stores classes data descriptions |
protected abstract int |
storeMetaClass()
Stores metaclasses |
protected void |
storePrimitiveFunctions(java.sql.Statement stmt)
Stores the primitive functions |
protected abstract void |
storePrimitiveSchema()
Stores primitive schema |
protected abstract int |
storeProperty(DBValidator dbv)
Stores properties |
protected abstract void |
storePropertyLinks()
Stores property data descriptions |
protected abstract void |
storeResource()
Stores data resources |
protected boolean |
storeThesaurus(java.lang.String input,
java.lang.String dbPath)
Stores thesauri that conform to the CWTH DTD. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public static final int SPECIFIC
public static final int SPECIFIC_NOSUBTABLE
public static final int SPECIFIC_UNIQUETABLE
public static final int EMPTY
public static final java.lang.String DATA_PROPERTY
public static final java.lang.String RDFSUITE_NS
public static final java.lang.String ENUMERATION_ELEMENT_PROPERTY
protected int repr
protected java.sql.Connection con
public java.sql.Statement stmt
public HierarchyLabel hlabel
protected java.util.HashMap resourcesIDs
public gr.forth.ics.vrp.corevrp.model.Model VRPModel
protected gr.forth.ics.vrp.corevrp.model.RDF_DAG subclass_dag
protected gr.forth.ics.vrp.corevrp.model.RDF_DAG subproperty_dag
| Constructor Detail |
public DBStorage()
| Method Detail |
public void setGUI(DBStoragePanel gui)
public DBStoragePanel getGUI()
public java.sql.Connection getConnection()
public java.sql.Statement getStatement()
public void setDBFunctionsPath(java.lang.String dbfunctionsPath)
public void setOutFile(java.lang.String file)
public java.lang.String getOutFile()
public StorageOutput getOutput()
public void setVerbose(boolean b)
public boolean getVerbose()
public void setCreateIndex(boolean b)
public boolean getCreateIndex()
public void setTimeStatistics(boolean b)
public int getMaxURILength()
public void setMaxURILength(int len)
public int getMaxLiteralLength()
public void setMaxLiteralLength(int len)
public int getMaxPrefixLength()
public void setMaxPrefixLength(int len)
public int getMaxLpartLength()
public void setMaxLpartLength(int len)
public java.util.ArrayList getStoredNS()
public gr.forth.ics.vrp.corevrp.model.Model getVRPModel()
public java.util.HashMap getResourceIDs()
public void setResourceIDs(java.util.HashMap hm)
public java.lang.String getCurrentNS()
public void setModifiedNamespace(java.lang.String modifiedNS)
modifiedNS - The namespace that will be stored in the db for the input local file/thesauruspublic void initResourceIDs()
public void setNewSchema(boolean b)
public boolean getNewSchema()
public void setStoredSchema(boolean b)
public boolean getStoredSchema()
public void setNewData(boolean b)
public boolean getNewData()
public int getRepr()
public boolean isHierarchyDAG()
public void setHierarchyDAG(boolean b)
b - if the hierarchies are DAGS b should be true.
If the hierarchies are treis b should be false.public boolean getPermitSchemaRendundancies()
public void setStoredData(boolean b)
public boolean getStoredData()
public void setModelStatistics(int i,
boolean b)
public int getNamespaceID(java.lang.String ns)
throws java.sql.SQLException
public static int getDBMSRepresentation(java.lang.String dbURL,
java.util.Properties prop)
throws java.sql.SQLException,
java.lang.ClassNotFoundException
public static int getXMLSchemaDTID(java.lang.String xmlSchemaDT_uri)
public static boolean isXMLSchemaDTID(int id)
public static int getXMLSchemaDTRQLID(java.lang.String xmlSchemaDT_uri)
public int getNextAnonID()
public int getNextNSID()
public int getNextThesTypeEnumID()
public void setAuthentication(java.lang.String log,
java.lang.String pass)
login - as a postgreSQL userpass - password as a postgreSQL user
public void setResourceID(java.lang.String resource_uri,
int[] label)
public int getResourceID(java.lang.String resource_uri)
public int[] getResourceLabel(java.lang.String resource_uri)
public int[] getDomainRangeTypeIds(gr.forth.ics.vrp.corevrp.model.RDF_Property rdf_property)
rdf_property -
public void setDomainRangeTypeIds(gr.forth.ics.vrp.corevrp.model.RDF_Property rdf_property,
int[] dRType)
public void setPropertyTableID(gr.forth.ics.vrp.corevrp.model.RDF_Property rdf_property,
java.lang.String tableID)
public java.lang.String getPropertyTableID(gr.forth.ics.vrp.corevrp.model.RDF_Property rdf_property)
public void setResourceURI(int id,
java.lang.String resource_uri)
public java.lang.String getResourceURI(int id)
protected void commitTransaction()
throws java.sql.SQLException
public void rollbackTransaction()
throws java.sql.SQLException
public static void isJDBCDriverAccessible()
throws java.lang.ClassNotFoundException
public static java.sql.Connection openConnection(java.lang.String dbURL,
java.util.Properties prop)
throws java.sql.SQLException
public static void closeConnection(java.sql.Connection con)
throws java.sql.SQLException
protected abstract boolean existMultipleLevelClassifiedResource()
throws java.sql.SQLException
protected abstract void storePrimitiveSchema()
throws java.sql.SQLException
protected abstract int storeMetaClass()
throws java.sql.SQLException
protected abstract int storeClass(DBValidator dbv)
throws java.sql.SQLException
protected abstract void storeClassDescriptions()
throws java.sql.SQLException
protected abstract int storeProperty(DBValidator dbv)
throws java.sql.SQLException
protected abstract void storePropertyLinks()
throws java.sql.SQLException
protected abstract void storeResource()
throws java.sql.SQLException
protected abstract void initPreparedStatements()
throws java.sql.SQLException
protected void storePrimitiveFunctions(java.sql.Statement stmt)
throws java.sql.SQLException
void getStatistics(gr.forth.ics.vrp.corevrp.model.Model outModel,
gr.forth.ics.vrp.corevrp.model.RDF_DAG class_dag,
gr.forth.ics.vrp.corevrp.model.RDF_DAG property_dag)
protected boolean storeThesaurus(java.lang.String input,
java.lang.String dbPath)
input - the thesaurus file.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
protected boolean store(java.lang.String input,
java.lang.String dbPath)
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
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||