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

java.lang.Object
  |
  +--gr.forth.ics.rssdb.storage.DBRDFProperty
        |
        +--gr.forth.ics.rssdb.storage.specrepr.SpecReprRDFProperty
All Implemented Interfaces:
PersistentRDFProperty
Direct Known Subclasses:
SpecReprVar1RDFProperty

public class SpecReprRDFProperty
extends DBRDFProperty
implements PersistentRDFProperty

Stores an RDF property

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

Field Summary
protected static java.sql.PreparedStatement addDataProperty
           
protected static java.sql.PreparedStatement addProperty
           
protected static java.sql.PreparedStatement addPropertyChild
           
protected static java.sql.PreparedStatement addSubProperty
           
 
Constructor Summary
SpecReprRDFProperty(gr.forth.ics.vrp.corevrp.model.RDF_Property rdf_property, DBStorage storage)
           
 
Method Summary
 boolean checkStoredSubProperty()
          Tests if the superproperties of the RDF property are identical to those stored in DBMS for this RDF property.
 boolean compareDomainRange(int domainID, int rangeID, int rng_kind)
          Check if the domain and range of the property declared in the RDF file is identical to the respective of the property that is stored in the db.
 java.util.ArrayList getDomainRange()
          Returns the URIs of the domain & the range classes of the stored RDF property and sets their ids in the hashmap.
 java.util.ArrayList getMetaClassesbelongs()
          Returns the identifiers of the metaclasses under which the property has been classified
static 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 .
static 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 .
static java.lang.String getURI(java.sql.Connection con, int id)
           
static void initPreparedStatements(java.sql.Connection con, DBStorage storage)
          Initializes prepared statements required for storing an RDF Property in the database
 boolean isStoredLink(java.lang.String field1, java.lang.String field2, int ext, java.lang.String propertyTableName)
          Tests if the property link has been stored in the DB.
 int store(DBValidator dbv)
          Stores an instantiation link between the RDF property and the class rdf:Property.
 void storeLink(gr.forth.ics.vrp.corevrp.model.Resource fromRef, java.lang.Object to_obj, int[] dRType, java.lang.String propertyTableName)
          Stores a property link.
protected  void storeNonLabelChildren(boolean direct)
          Stores the properties that are descendants of the current property, through non-tree arcs
 void storeProperty(DBValidator dbv)
          Stores an instantiation link between the RDF_Property object and the class rdf:Property.
 void storePropertyLinks()
          Stores all property's links.
 void storeSubProperty(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.rssdb.storage.DBRDFProperty
getRDFProperty, getStorage, setRDFProperty, setStorage
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

addProperty

protected static java.sql.PreparedStatement addProperty

addDataProperty

protected static java.sql.PreparedStatement addDataProperty

addSubProperty

protected static java.sql.PreparedStatement addSubProperty

addPropertyChild

protected static java.sql.PreparedStatement addPropertyChild
Constructor Detail

SpecReprRDFProperty

public SpecReprRDFProperty(gr.forth.ics.vrp.corevrp.model.RDF_Property rdf_property,
                           DBStorage storage)
Method Detail

initPreparedStatements

public static void initPreparedStatements(java.sql.Connection con,
                                          DBStorage storage)
                                   throws java.sql.SQLException
Initializes prepared statements required for storing an RDF Property in the database

store

public int store(DBValidator dbv)
          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 interface PersistentRDFProperty
Overrides:
store in class DBRDFProperty

compareDomainRange

public boolean compareDomainRange(int domainID,
                                  int rangeID,
                                  int rng_kind)
                           throws java.sql.SQLException
Check if the domain and range of the property declared in the RDF file is identical to the respective of the property that is stored in the db.
Parameters:
domainID - The id of domain class of the stored property
rangeID - The id of range class of the stored property
Returns:
true if the domain and range of the property declared in the RDF file is identical to the respective of the property that is stored in the db, false otherwise

getURI

public static java.lang.String getURI(java.sql.Connection con,
                                      int id)
                               throws java.sql.SQLException

getDomainRange

public java.util.ArrayList getDomainRange()
                                   throws java.sql.SQLException
Returns the URIs of the domain & the range classes of the stored RDF property and sets their ids in the hashmap.
Specified by:
getDomainRange in interface PersistentRDFProperty
Overrides:
getDomainRange in class DBRDFProperty

storeProperty

public void storeProperty(DBValidator dbv)
                   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.
Specified by:
storeProperty in interface PersistentRDFProperty
Overrides:
storeProperty in class DBRDFProperty

storeSubProperty

public void storeSubProperty(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.
Specified by:
storeSubProperty in interface PersistentRDFProperty
Overrides:
storeSubProperty in class DBRDFProperty

checkStoredSubProperty

public boolean checkStoredSubProperty()
                               throws java.sql.SQLException
Tests if the superproperties of the RDF property are identical to those stored in DBMS for this RDF property.
Specified by:
checkStoredSubProperty in interface PersistentRDFProperty
Overrides:
checkStoredSubProperty in class DBRDFProperty

isStoredLink

public boolean isStoredLink(java.lang.String field1,
                            java.lang.String field2,
                            int ext,
                            java.lang.String propertyTableName)
                     throws java.sql.SQLException
Tests if the property link has been stored in the DB.

getSuperPropertiesOf

public static 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.

storeLink

public void storeLink(gr.forth.ics.vrp.corevrp.model.Resource fromRef,
                      java.lang.Object to_obj,
                      int[] dRType,
                      java.lang.String propertyTableName)
               throws java.sql.SQLException
Stores a property link.
Specified by:
storeLink in interface PersistentRDFProperty
Overrides:
storeLink in class DBRDFProperty

storePropertyLinks

public void storePropertyLinks()
                        throws java.sql.SQLException
Description copied from interface: PersistentRDFProperty
Stores all property's links.
Specified by:
storePropertyLinks in interface PersistentRDFProperty
Overrides:
storePropertyLinks in class DBRDFProperty

getMetaClassesbelongs

public java.util.ArrayList getMetaClassesbelongs()
                                          throws java.sql.SQLException
Returns the identifiers of the metaclasses under which the property has been classified

storeNonLabelChildren

protected void storeNonLabelChildren(boolean direct)
                              throws java.sql.SQLException
Stores the properties that are descendants of the current property, through non-tree arcs
Throws:
java.sql.SQLException -  

getSubPropertiesOf

public static 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.