gr.forth.ics.rdfsuite.rssdb.repr
Class SSWSRepresentation

java.lang.Object
  extended by gr.forth.ics.rdfsuite.rssdb.repr.DBRepresentation
      extended by gr.forth.ics.rdfsuite.rssdb.repr.SSWSRepresentation

public class SSWSRepresentation
extends DBRepresentation


Field Summary
 java.lang.String class1
           
 java.lang.String index_class2
           
static java.sql.PreparedStatement isMC
           
 int repr
           
 java.lang.String ttable1
           
 
Fields inherited from class gr.forth.ics.rdfsuite.rssdb.repr.DBRepresentation
anon_ids, bag_types, classAnc1, cluster_namespace, enumeration1, enumeration2, function_add_propertyQuery, function_create_instanceQuery, function_delete_objectQuery, function_delete_propertyQuery, function_update_propertyQuery, generator1, generator2, graph_table, graphspace_dep, graphspace1, graphspace2, index_bagtype1, index_bagtype2, index_bagtype3, index_class1, index_classanc1, index_classanc2, index_classanc3, index_classanc4, index_enumeration1, index_graph, index_metaclass1, index_metaclass2, index_metaclass3, index_metaproperty1, index_metaproperty2, index_metaproperty3, index_namespace, index_propertyanc1, index_propertyanc2, index_propertyanc3, index_propertyanc4, index_seqtype1, index_seqtype2, index_seqtype3, index_seqtype4, index_subclass1, index_subclass2, index_subclass3, index_subclass4, index_submetaclass1, index_submetaclass2, index_submetaclass3, index_submetaproperty1, index_submetaproperty2, index_submetaproperty3, index_subproperty1, index_subproperty2, index_subproperty3, index_subproperty4, literal1, literal2, log, logquery, max_postorder1, max_postorder2, metaclass1, metaclass10, metaclass11, metaclass2, metaclass3, metaclass4, metaclass5, metaclass6, metaclass7, metaclass8, model, namespace_dep, namespace1, namespace3, namespace4, namespace5, namespace6, propertyAnc1, representation1, seq_types, subClass1, subClass2, subProperty1, thesaurus1, thesaurus2
 
Constructor Summary
SSWSRepresentation(RDFDB_Model input_model)
           
 
Method Summary
 int clusterClassTables()
          Clusters upon request the table where class instances are stored.
 void createInitIndexes(java.sql.Statement stmt)
          Indexes are created on the core database tables and on the table where data resources are stored (i.e., Instances table).
protected  void deleteUpperMembership(IRDF_Resource rdf_resource, int id, java.lang.String clsuri)
          Deletes the instantiation links between the resource and the superclasses of the class with identifier
 boolean existMultipleLevelClassifiedResource()
          Checks if there are resources in the db that are stored both at schema and data level.
 java.sql.ResultSet getAllproperties_Domain_Range(java.lang.String schema, java.lang.String attr8)
           
static java.sql.ResultSet getClassForFetching(java.sql.Statement stmt, java.lang.String class_lname, int namespace_id)
           
static java.lang.String getClassInstanceForFetching(IRDFDB_Model model, java.lang.String uri, java.sql.Statement stmt)
           
static java.sql.ResultSet getPropertyDomainRangeForFetching(java.sql.Statement stmt, java.lang.String property_lname, int namespace_id)
          Prepei na epekta8ei to arxiko query gia na epistrefei kai ta ns uris tou domain kai range Added:domainm,rangem,domainn,rangen
 int getRepresentation()
          Is the method that returns the representation kind of the DB
 java.sql.ResultSet getSubPropertiesOf(int post, int index, boolean includeProperty, boolean isDAG, java.sql.Connection con)
          Returns an ResultSet containing the post numbers of the stored subproperties of the property with post number .
 java.sql.ResultSet getSuperClassesOf(int post, boolean includeClass, boolean isDAG, java.sql.Connection con)
          Returns a ResultSet containing the post numbers of the stored superclasses of the class with post number .
 java.sql.ResultSet getSuperPropertiesOf(int post, boolean includeProperty, boolean isDAG, java.sql.Connection con)
          Returns an ResultSet containing the post numbers of stored superproperties of the property with post number .
 void initPreparedStatements()
           
 boolean isInstanceOf(IRDF_Resource resource, IntervalLabel clslabel)
          Tests if the Resource(Individual,Class or Property) has been classified in the class with id the method parameter clsid.
 boolean isMetaClassNonTreeSubClass(int subpost, int suppost, int subindex, java.sql.Connection con)
           
 boolean isMetaClassSubClass(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
 boolean isStoredPair(IRDF_Property rdf_property, java.lang.String field1, java.lang.String field2, int ext, java.lang.String propertyTableName)
           
 boolean isSubClass(java.lang.String sub, java.lang.String sup, int level, boolean schemaValidation)
          Tests if the class with URI is subset of the class with URI .
 boolean resourceIsDirectInstanceOfClass(IRDF_Resource rdf_resource, int clsid)
          Tests if the Resource has been directly classified in the class with id the method parameter clsid.
 boolean resourceIsInstanceOfClass(IRDF_Resource rdf_resource, IntervalLabel clslabel)
          Tests if the Resource has been classified in the class with id the method parameter clsid.
 int store(IRDF_Class rdf_class)
          Stores an instantiation link between the RDF class and the class rdfs:Class and stores the rdfs:subClassOf links defined on the RDF class.
 int store(IRDF_Individual rdf_resource, java.lang.String graphspace_uri)
          Deletes the instantiation link between Resource and the class rdfs:Resource.
 int store(IRDF_MetaClass rdf_meta_class)
          Stores a MetaClass in the db.
 int store(IRDF_Property rdf_property)
          Stores an instantiation link between the RDF property and the class rdf:Property.
 int store(IRDF_PropertyInstance rdf_property_instance, java.lang.String graphspace_uri)
           
 int store(IRDF_Resource rdf_resource, java.lang.String uri)
           
 void storeClass(IRDF_Class rdf_class)
          Classify the current class under the metaclasses contained in its type list.
 void storeGraphspaceAsClassInstance(java.lang.String uri)
           
 void storeMetaClass(IRDF_MetaClass rdf_meta_class)
          Stores the RDF_MetaClass in the table MetaClass
 void storeNonLabelChildren(IRDF_Class rdf_class, boolean direct)
          Stores the classes that are descendants of the current class, through non-tree arcs
 void storeNonLabelChildren(IRDF_MetaClass rdf_meta_class, boolean direct)
          Stores the metaclasses that are descendants of the current metaclass, through non-tree arcs
 void storeNonLabelChildrenProperty(IRDF_Property rdf_property, boolean direct)
          Stores the properties that are descendants of the current property, through non-tree arcs
 void storePair(IRDF_Property rdf_property, IRDF_Resource fromRef, java.lang.Object to_obj, int[] dRType, java.lang.String propertyTableName, java.lang.String graphspace_uri)
           
 void storePrimitiveSchema()
          Stores primitive schema
 void storeProperty(IRDF_Property rdf_property)
          Stores an instantiation link between the RDF_Property object and the class rdf:Property.
 void storeSubClass(IRDF_Class rdf_class)
          Stores in the SubClass table the rdfs:subClassOf link that is defined on RDF_Class object and is an arc of the tree constructed during the labeling on the class hierarchy .
 void storeSubMetaClass(IRDF_MetaClass rdf_meta_class)
          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 .
 void storeSubProperty(IRDF_Property rdf_property, int property_id)
          Stores in the SubProperty table the rdfs:subPropertyOf link that is defined on RDF_Property object and is an arc of the tree constructed during the labeling on the properties hierarchy .
 
Methods inherited from class gr.forth.ics.rdfsuite.rssdb.repr.DBRepresentation
checkStoredSubClass, checkStoredSubMetaClass, checkStoredSubProperty, clusterGraphTable, clusterNamespaceTable, compareDomainRange, correlateTripleIdWithGraphspaceQuery, createPrimitiveTableIndexes, createPrimitiveTables, deleteRedundantSubClassOf, deleteRedundantSubMetaClassOf, deleteRedundantSubPropertyOf, getAllClassesAndSuperClasses, getAllMetaClassesAndSuperMetaClasses, getAllPropertiesWithDomainAndRange, getAllpropertiesWithDomainAndRangeQuery, getClassIndex, getClassURI, getDescendantsOf, getDescendantsOfClassQuery, getDescendantsOfMetaClassQuery, getDescendantsOfPropertyQuery, getLabelFromDB, getLabelsOfDirectTreeDescendants, getMetaClassAndSuperMetaClassForFetching, getMetaClassesClassBelongs, getMetaClassesPropertyBelongs, getMetaClassURI, getNamespaceID, getPropagatedLabelsOfClass, getPropagatedLabelsOfMetaClass, getPropagatedLabelsOfMetaProperty, getPropagatedLabelsOfProperty, getPropertyURI, getRepr, getStoredMetaClasses, getStoredMetaClassesQuery, insertXMLSchemaTypesQuery, isGraphspaceInDB, isMetaClass, isNonTreeSubClass, isNonTreeSubClassQuery, isNonTreeSubMetaClass, isNonTreeSubMetaClassQuery, isResourceStoredAsClassQuery, isResourceStoredAsMetaClassQuery, isSubClass, isSubClassOfRedundant, isSubMetaClass, isSubMetaClassOfRedundant, isSubPropertyOfRedundant, metaclassContainsResource, metaclassContainsResourceQuery, representation2Query, resourceIsStoredAsClass, resourceIsStoredAsMetaClass, storeClassDefaultProperties, storeClassInstanceDefaultProperties, storeGraphspaceDependency, storeNamespaceDependency, storePrimitiveFunctions, storePropertyDefaultProperties, subClassGraph
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

repr

public final int repr

class1

public java.lang.String class1

ttable1

public java.lang.String ttable1

index_class2

public java.lang.String index_class2

isMC

public static java.sql.PreparedStatement isMC
Constructor Detail

SSWSRepresentation

public SSWSRepresentation(RDFDB_Model input_model)
Method Detail

getPropertyDomainRangeForFetching

public static java.sql.ResultSet getPropertyDomainRangeForFetching(java.sql.Statement stmt,
                                                                   java.lang.String property_lname,
                                                                   int namespace_id)
                                                            throws java.sql.SQLException
Prepei na epekta8ei to arxiko query gia na epistrefei kai ta ns uris tou domain kai range Added:domainm,rangem,domainn,rangen

Throws:
java.sql.SQLException - In case a query aborts

getClassForFetching

public static java.sql.ResultSet getClassForFetching(java.sql.Statement stmt,
                                                     java.lang.String class_lname,
                                                     int namespace_id)
                                              throws java.sql.SQLException
Throws:
java.sql.SQLException - In case a query aborts

getRepresentation

public int getRepresentation()
Description copied from class: DBRepresentation
Is the method that returns the representation kind of the DB

Overrides:
getRepresentation in class DBRepresentation
Returns:
the int Representation of the representation in the DB (ISA=2, NOISA=3,Hybrid=4)

createInitIndexes

public 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 (i.e., Instances table).

Specified by:
createInitIndexes in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

storePrimitiveSchema

public void storePrimitiveSchema()
                          throws java.sql.SQLException
Stores primitive schema

Specified by:
storePrimitiveSchema in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

initPreparedStatements

public void initPreparedStatements()
                            throws java.sql.SQLException
Specified by:
initPreparedStatements in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

store

public int store(IRDF_Resource rdf_resource,
                 java.lang.String uri)
          throws java.sql.SQLException
Specified by:
store in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

store

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

Specified by:
store in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

storeMetaClass

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

Throws:
java.sql.SQLException - In case a query aborts

storeSubMetaClass

public void storeSubMetaClass(IRDF_MetaClass rdf_meta_class)
                       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.

Throws:
java.sql.SQLException - In case a query aborts

storeNonLabelChildren

public void storeNonLabelChildren(IRDF_MetaClass rdf_meta_class,
                                  boolean direct)
                           throws java.sql.SQLException
Stores the metaclasses that are descendants of the current metaclass, through non-tree arcs

Specified by:
storeNonLabelChildren in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

store

public int store(IRDF_Class rdf_class)
          throws java.sql.SQLException
Stores an instantiation link between the RDF class and the class rdfs:Class and stores the rdfs:subClassOf links defined on the RDF class.

Specified by:
store in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

storeClass

public void storeClass(IRDF_Class rdf_class)
                throws java.sql.SQLException
Classify the current class under the metaclasses contained in its type list. If no redundancies are permitted checks for any metaclass of the type list if it is a superclass of another metaclass in the type list. In that case doesn't classify the class under the metaclass.

Parameters:
dbv - The DBStorage object
Throws:
java.sql.SQLException - In case a query aborts

isSubClass

public boolean isSubClass(java.lang.String sub,
                          java.lang.String sup,
                          int level,
                          boolean schemaValidation)
                   throws java.sql.SQLException
Tests if the class with URI is subset of the class with URI .

Parameters:
schemaValidation - Indicates if the function is used for validating schema or data
Throws:
java.sql.SQLException - In case a query aborts

isMetaClassSubClass

public boolean isMetaClassSubClass(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.
Throws:
java.sql.SQLException - In case a query aborts

isMetaClassNonTreeSubClass

public boolean isMetaClassNonTreeSubClass(int subpost,
                                          int suppost,
                                          int subindex,
                                          java.sql.Connection con)
                                   throws java.sql.SQLException
Parameters:
subpost -
suppost -
subindex -
con -
Returns:
Throws:
java.sql.SQLException - In case a query aborts

storeSubClass

public void storeSubClass(IRDF_Class rdf_class)
                   throws java.sql.SQLException
Stores in the SubClass table the rdfs:subClassOf link that is defined on RDF_Class object and is an arc of the tree constructed during the labeling on the class hierarchy . Moreover stores the non tree arcs of the node in the Class_Anc table.

Throws:
java.sql.SQLException - In case a query aborts

storeNonLabelChildren

public void storeNonLabelChildren(IRDF_Class rdf_class,
                                  boolean direct)
                           throws java.sql.SQLException
Stores the classes that are descendants of the current class, through non-tree arcs

Specified by:
storeNonLabelChildren in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

store

public int store(IRDF_Property rdf_property)
          throws java.sql.SQLException
Stores an instantiation link between the RDF property and the class rdf:Property. It also stores the domain and the range and the rdfs:subPropertyOf links defined on the RDF property

Specified by:
store in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

storeProperty

public void storeProperty(IRDF_Property rdf_property)
                   throws java.sql.SQLException
Stores an instantiation link between the RDF_Property object and the class rdf:Property. It also stores the domain and range of the property.

Throws:
java.sql.SQLException - In case a query aborts

storeSubProperty

public void storeSubProperty(IRDF_Property rdf_property,
                             int property_id)
                      throws java.sql.SQLException
Stores in the SubProperty table the rdfs:subPropertyOf link that is defined on RDF_Property object and is an arc of the tree constructed during the labeling on the properties hierarchy . Moreover stores the non tree arcs of the node in the Property_Anc table.

Throws:
java.sql.SQLException - In case a query aborts

storeNonLabelChildrenProperty

public void storeNonLabelChildrenProperty(IRDF_Property rdf_property,
                                          boolean direct)
                                   throws java.sql.SQLException
Stores the properties that are descendants of the current property, through non-tree arcs

Specified by:
storeNonLabelChildrenProperty in class DBRepresentation
Throws:
java.sql.SQLException

store

public int store(IRDF_Individual rdf_resource,
                 java.lang.String graphspace_uri)
          throws java.sql.SQLException
Deletes the instantiation link between Resource and the class rdfs:Resource.

Specified by:
store in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

resourceIsDirectInstanceOfClass

public boolean resourceIsDirectInstanceOfClass(IRDF_Resource rdf_resource,
                                               int clsid)
                                        throws java.sql.SQLException
Tests if the Resource has been directly classified in the class with id the method parameter clsid.

Throws:
java.sql.SQLException - In case a query aborts

resourceIsInstanceOfClass

public boolean resourceIsInstanceOfClass(IRDF_Resource rdf_resource,
                                         IntervalLabel clslabel)
                                  throws java.sql.SQLException
Tests if the Resource has been classified in the class with id the method parameter clsid.

Throws:
java.sql.SQLException - In case a query aborts

deleteUpperMembership

protected void deleteUpperMembership(IRDF_Resource rdf_resource,
                                     int id,
                                     java.lang.String clsuri)
                              throws java.sql.SQLException
Deletes the instantiation links between the resource and the superclasses of the class with identifier

Throws:
java.sql.SQLException - In case a query aborts

getSuperClassesOf

public java.sql.ResultSet getSuperClassesOf(int post,
                                            boolean includeClass,
                                            boolean isDAG,
                                            java.sql.Connection con)
                                     throws java.sql.SQLException
Returns a ResultSet containing the post numbers of the stored superclasses of the class with post number .

Parameters:
includeClass - Indicates if the post number of the class will be included in the resultset.
Throws:
java.sql.SQLException - In case a query aborts

store

public int store(IRDF_PropertyInstance rdf_property_instance,
                 java.lang.String graphspace_uri)
          throws java.sql.SQLException
Specified by:
store in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

storePair

public void storePair(IRDF_Property rdf_property,
                      IRDF_Resource fromRef,
                      java.lang.Object to_obj,
                      int[] dRType,
                      java.lang.String propertyTableName,
                      java.lang.String graphspace_uri)
               throws java.sql.SQLException
Throws:
java.sql.SQLException - In case a query aborts

isStoredPair

public boolean isStoredPair(IRDF_Property rdf_property,
                            java.lang.String field1,
                            java.lang.String field2,
                            int ext,
                            java.lang.String propertyTableName)
                     throws java.sql.SQLException
Parameters:
rdf_property -
field1 -
field2 -
ext -
propertyTableName -
Returns:
Throws:
java.sql.SQLException - In case a query aborts

getSubPropertiesOf

public java.sql.ResultSet getSubPropertiesOf(int post,
                                             int index,
                                             boolean includeProperty,
                                             boolean isDAG,
                                             java.sql.Connection con)
                                      throws java.sql.SQLException
Returns an ResultSet containing the post numbers of the stored subproperties of the property with post number .

Parameters:
includeProperty - Indicates if the post number of the property will be included in the resultset.
Throws:
java.sql.SQLException - In case a query aborts

getSuperPropertiesOf

public java.sql.ResultSet getSuperPropertiesOf(int post,
                                               boolean includeProperty,
                                               boolean isDAG,
                                               java.sql.Connection con)
                                        throws java.sql.SQLException
Returns an ResultSet containing the post numbers of stored superproperties of the property with post number .

Parameters:
includeProperty - Indicates if the post number of the property will be included in the resultset.
Throws:
java.sql.SQLException - In case a query aborts

clusterClassTables

public int clusterClassTables()
                       throws java.sql.SQLException
Clusters upon request the table where class instances are stored.

Specified by:
clusterClassTables in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

existMultipleLevelClassifiedResource

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

Specified by:
existMultipleLevelClassifiedResource in class DBRepresentation
Returns:
Throws:
java.sql.SQLException - In case a query aborts

isInstanceOf

public boolean isInstanceOf(IRDF_Resource resource,
                            IntervalLabel clslabel)
                     throws java.sql.SQLException
Tests if the Resource(Individual,Class or Property) has been classified in the class with id the method parameter clsid.

Throws:
java.sql.SQLException - In case a query aborts

getAllproperties_Domain_Range

public java.sql.ResultSet getAllproperties_Domain_Range(java.lang.String schema,
                                                        java.lang.String attr8)
                                                 throws java.sql.SQLException
Throws:
java.sql.SQLException - In case a query aborts

storeGraphspaceAsClassInstance

public void storeGraphspaceAsClassInstance(java.lang.String uri)
                                    throws java.sql.SQLException
Specified by:
storeGraphspaceAsClassInstance in class DBRepresentation
Throws:
java.sql.SQLException - In case a query aborts

getClassInstanceForFetching

public static java.lang.String getClassInstanceForFetching(IRDFDB_Model model,
                                                           java.lang.String uri,
                                                           java.sql.Statement stmt)