gr.forth.ics.rdfsuite.swkm.model.db.impl
Class RDFDB_Namespace

java.lang.Object
  extended by gr.forth.ics.rdfsuite.swkm.model.impl.RDF_Namespace
      extended by gr.forth.ics.rdfsuite.swkm.model.db.impl.RDFDB_Namespace
All Implemented Interfaces:
IRDFDB_Namespace, Identifiable, IRDF_Namespace

public class RDFDB_Namespace
extends RDF_Namespace
implements IRDFDB_Namespace


Field Summary
 
Fields inherited from class gr.forth.ics.rdfsuite.swkm.model.impl.RDF_Namespace
comments, domains, isdefinedbys, labels, log, members, objects, predicates, ranges, seealsos, subclasses, subjects, subproperties, types
 
Constructor Summary
RDFDB_Namespace(IRDF_Model model)
           
RDFDB_Namespace(java.lang.String namespace_uri, IRDF_Model model)
           
 
Method Summary
protected  IRDF_MetaClass castClassToMetaClass(IRDF_Model model, IRDF_Class rdf_class, int kind)
          Casting a Class into MetaClass.
protected  IRDF_Class createClass(IRDF_Model model, java.lang.String class_uri, Position pos)
          Creates an IRDF_Class and adds it to this namespace,as well as performing all other initializations.
protected  IRDF_MetaClass createMetaClassOfClasses(IRDF_Model model, java.lang.String meta_class_uri, Position pos)
          Creates an rdf metaclass but without creating the subclass triple to the rdf schema class which is the actual requirement for a class to be a metaclass
protected  IRDF_MetaClass createMetaClassOfProperties(IRDF_Model model, java.lang.String meta_class_uri, Position pos)
          Creates an rdf metaclass but without creating the subclass triple to the rdf schema class which is the actual requirement for a class to be a metaclass
protected  IRDF_Property createProperty(IRDF_Model model, java.lang.String property_uri, Position pos)
          Creates an IRDF_Property and adds it to this namespace,as well as performing all other initializations.
protected  int enter_domain(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, RDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  int enter_range(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, RDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  int enter_subClassOf(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, IRDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  int enter_subPropertyOf(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, RDF_Model model, java.lang.String graphspace_uri, boolean strict)
           
protected  void enter_type_case_object_metaclass(java.lang.String subject, IRDF_MetaClass object_metaclass, Position pos, java.lang.String graphspace_uri, RDF_Model model, IRDF_Namespace triple_namespace, boolean inferred)
          Creates the type triple in case the object is a user defined metaclass
protected  void enter_type_case_object_metaproperty(java.lang.String subject, IRDF_MetaClass object_metaproperty, Position pos, java.lang.String graphspace_uri, RDF_Model model, IRDF_Namespace triple_namespace, boolean inferred)
          Note that this namespace is not necessarily the same with subject's namespace
protected  void enter_type_case_object_rdfschema_class(java.lang.String subject, Position pos, java.lang.String graphspace_uri, IRDF_Model model, IRDF_Namespace triple_namespace, boolean inferred)
          Note that this namespace is not necessarily the same with subject's namespace If class is not found in main memory, db is searched
protected  void enter_type_case_object_resource(java.lang.String subject, IRDF_Resource object_resource, Position pos, java.lang.String graphspace_uri, RDF_Model model, IRDF_Namespace triple_namespace, boolean inferred)
          Creates the type triple in case the object is a user defined metaclass
protected  void enter_type_case_rdf_property(java.lang.String subject, Position pos, java.lang.String graphspace_uri, RDF_Model model, IRDF_Namespace triple_namespace, boolean inferred)
          Note that this namespace is not necessarily the same with subject's namespace
protected  int enter_type(java.lang.String subject, java.lang.String predicate, java.lang.String object, Position pos, java.lang.String graphspace_uri, boolean strict, RDF_Model model)
           
 IRDF_Class getClassFromDB(IRDFDB_Model model, java.lang.String class_uri)
           
 IRDF_MetaClass getMetaClassFromDB(IRDFDB_Model model, java.lang.String meta_class_uri)
          Fetches from DB metaclass with uri meta_class_uri
protected  IRDF_Domain getOrCreateDomainTriple(IRDF_Model model, IRDF_Property subject_property, IRDF_Class object_class, IRDF_Namespace subject_namespace, boolean inferred)
          If a domain triple for subject property and object_class already exists it retrieves it or else it creates a new one The triple is not added in any namespace or in the model in this method
protected  IRDF_Range getOrCreateRangeTriple(IRDF_Model model, IRDF_Property subject_property, IRDF_Class object_class, IRDF_Namespace subject_namespace, boolean inferred)
          If a range triple for subject property and object_class already exists it retrieves it or else it creates a new one
protected  IRDF_SubClass getOrCreateSubClassTriple(IRDF_Model model, IRDF_Class subject_class, IRDF_Class object_class, IRDF_Namespace subject_namespace, boolean inferred)
          If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one
protected  IRDF_Type getOrCreateTypeTriple(IRDF_Model model, IRDF_Resource subject_resource, IRDF_Resource object_resource, IRDF_Namespace namespace, boolean inferred)
          If a type triple for subject resource with type the object_resource already exists it retrieves it or else if object_resource is null checks for a type triple with any object or else creates a new one
 IRDF_Property getPropertyFromDB(IRDFDB_Model model, java.lang.String property_uri)
           
 
Methods inherited from class gr.forth.ics.rdfsuite.swkm.model.impl.RDF_Namespace
addClass, addNamespaceDependency, addProperty, addStatement, castClassToPropertyAndUpdateReferences, createStatement, enter_comment, enter_isDefinedBy, enter_label, enter_property, enter_s_p_o, enter_seeAlso, enter_type_case_statement, getClass, getClasses, getComment, getComments, getDomain, getDomains, getIsDefinedBy, getIsDefinedBys, getLabel, getLabels, getMember, getMembers, getModel, getNamespaceDependencies, getObject, getObjects, getOrCreateCommentTriple, getOrCreateIsDefinedByTriple, getOrCreateLabelTriple, getOrCreateSeeAlsoTriple, getOrCreateStatementObjectTriple, getOrCreateStatementPredicateTriple, getOrCreateStatementSubjectTriple, getOrCreateSubPropertyTriple, getPredicate, getPredicates, getProperties, getProperty, getRange, getRanges, getSeeAlso, getSeeAlsos, getStatement, getStatements, getSubClass, getSubClasses, getSubject, getSubjects, getSubProperties, getSubProperty, getTriples, getType, getTypes, getURI, read_triple, removeSubClassTriplesOf, setClasses, setNamespaceDependencies, setProperties, setStatements, setSubjects, setTypes, setURI, toString, toTriples
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gr.forth.ics.rdfsuite.swkm.model.IRDF_Namespace
addClass, addNamespaceDependency, addProperty, addStatement, getClass, getClasses, getComment, getComments, getDomain, getDomains, getIsDefinedBy, getIsDefinedBys, getLabel, getLabels, getMember, getMembers, getModel, getNamespaceDependencies, getObject, getObjects, getPredicate, getPredicates, getProperties, getProperty, getRange, getRanges, getSeeAlso, getSeeAlsos, getStatement, getStatements, getSubClass, getSubClasses, getSubject, getSubjects, getSubProperties, getSubProperty, getTriples, getType, getTypes, getURI, setClasses, setNamespaceDependencies, setProperties, setStatements, setURI, toString, toTriples
 

Constructor Detail

RDFDB_Namespace

public RDFDB_Namespace(IRDF_Model model)

RDFDB_Namespace

public RDFDB_Namespace(java.lang.String namespace_uri,
                       IRDF_Model model)
Parameters:
namespace_uri -
Method Detail

enter_type_case_object_rdfschema_class

protected void enter_type_case_object_rdfschema_class(java.lang.String subject,
                                                      Position pos,
                                                      java.lang.String graphspace_uri,
                                                      IRDF_Model model,
                                                      IRDF_Namespace triple_namespace,
                                                      boolean inferred)
                                               throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
Note that this namespace is not necessarily the same with subject's namespace If class is not found in main memory, db is searched

Overrides:
enter_type_case_object_rdfschema_class in class RDF_Namespace
Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - Essentially is some SQLException occurs during the fetching of resources from db

enter_type_case_object_metaclass

protected void enter_type_case_object_metaclass(java.lang.String subject,
                                                IRDF_MetaClass object_metaclass,
                                                Position pos,
                                                java.lang.String graphspace_uri,
                                                RDF_Model model,
                                                IRDF_Namespace triple_namespace,
                                                boolean inferred)
                                         throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
Creates the type triple in case the object is a user defined metaclass

Overrides:
enter_type_case_object_metaclass in class RDF_Namespace
Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - Essentially is some SQLException occurs during the fetching of resources from db

enter_type_case_object_resource

protected void enter_type_case_object_resource(java.lang.String subject,
                                               IRDF_Resource object_resource,
                                               Position pos,
                                               java.lang.String graphspace_uri,
                                               RDF_Model model,
                                               IRDF_Namespace triple_namespace,
                                               boolean inferred)
                                        throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
Creates the type triple in case the object is a user defined metaclass

Overrides:
enter_type_case_object_resource in class RDF_Namespace
Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - Essentially is some SQLException occurs during the fetching of resources from db

enter_type_case_object_metaproperty

protected void enter_type_case_object_metaproperty(java.lang.String subject,
                                                   IRDF_MetaClass object_metaproperty,
                                                   Position pos,
                                                   java.lang.String graphspace_uri,
                                                   RDF_Model model,
                                                   IRDF_Namespace triple_namespace,
                                                   boolean inferred)
                                            throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
Note that this namespace is not necessarily the same with subject's namespace

Overrides:
enter_type_case_object_metaproperty in class RDF_Namespace
Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - Essentially is some SQLException occurs during the fetching of resources from db

enter_type_case_rdf_property

protected void enter_type_case_rdf_property(java.lang.String subject,
                                            Position pos,
                                            java.lang.String graphspace_uri,
                                            RDF_Model model,
                                            IRDF_Namespace triple_namespace,
                                            boolean inferred)
                                     throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
Note that this namespace is not necessarily the same with subject's namespace

Overrides:
enter_type_case_rdf_property in class RDF_Namespace
Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - Essentially is some SQLException occurs during the fetching of resources from db

getPropertyFromDB

public IRDF_Property getPropertyFromDB(IRDFDB_Model model,
                                       java.lang.String property_uri)
                                throws java.sql.SQLException
Parameters:
model -
property_uri -
Returns:
Throws:
java.sql.SQLException - if some sql query aborts

getClassFromDB

public IRDF_Class getClassFromDB(IRDFDB_Model model,
                                 java.lang.String class_uri)
                          throws java.sql.SQLException
Throws:
java.sql.SQLException - if some sql query aborts

getMetaClassFromDB

public IRDF_MetaClass getMetaClassFromDB(IRDFDB_Model model,
                                         java.lang.String meta_class_uri)
                                  throws java.sql.SQLException
Fetches from DB metaclass with uri meta_class_uri

Parameters:
model -
meta_class_uri - The metaclass_uri we want to fetch
Returns:
The IRDF_Metaclass
Throws:
java.sql.SQLException - if some sql query aborts

enter_subClassOf

protected int enter_subClassOf(java.lang.String subject,
                               java.lang.String predicate,
                               java.lang.String object,
                               Position pos,
                               IRDF_Model model,
                               java.lang.String graphspace_uri,
                               boolean strict)
                        throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
Overrides:
enter_subClassOf in class RDF_Namespace
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - Essentially is some SQLException occurs during the fetching of resources from db

enter_subPropertyOf

protected int enter_subPropertyOf(java.lang.String subject,
                                  java.lang.String predicate,
                                  java.lang.String object,
                                  Position pos,
                                  RDF_Model model,
                                  java.lang.String graphspace_uri,
                                  boolean strict)
                           throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
Overrides:
enter_subPropertyOf in class RDF_Namespace
strict - return 0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - Essentially is some SQLException occurs during the fetching of resources from db

enter_domain

protected int enter_domain(java.lang.String subject,
                           java.lang.String predicate,
                           java.lang.String object,
                           Position pos,
                           RDF_Model model,
                           java.lang.String graphspace_uri,
                           boolean strict)
                    throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
Overrides:
enter_domain in class RDF_Namespace
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - Essentially is some SQLException occurs during the fetching of resources from db

enter_range

protected int enter_range(java.lang.String subject,
                          java.lang.String predicate,
                          java.lang.String object,
                          Position pos,
                          RDF_Model model,
                          java.lang.String graphspace_uri,
                          boolean strict)
                   throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
Overrides:
enter_range in class RDF_Namespace
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - Essentially is some SQLException occurs during the fetching of resources from db

enter_type

protected int enter_type(java.lang.String subject,
                         java.lang.String predicate,
                         java.lang.String object,
                         Position pos,
                         java.lang.String graphspace_uri,
                         boolean strict,
                         RDF_Model model)
                  throws gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException
Overrides:
enter_type in class RDF_Namespace
Parameters:
subject -
predicate -
object -
pos -
graphspace_uri -
strict - If true all the necessary checks will be performed while if it is false we will perform a good will building
Returns:
0 for false,needs to be fed to model, 1 for true, 2 for false and should not be fed to model(error)
Throws:
gr.forth.ics.rdfsuite.services.exceptions.TripleCreationException - Essentially is some SQLException occurs during the fetching of resources from db

castClassToMetaClass

protected IRDF_MetaClass castClassToMetaClass(IRDF_Model model,
                                              IRDF_Class rdf_class,
                                              int kind)
Casting a Class into MetaClass. Essentially a Class is copied into a MetaClass and then is deleted

Overrides:
castClassToMetaClass in class RDF_Namespace
Parameters:
rdf_class -
kind -
Returns:

createClass

protected IRDF_Class createClass(IRDF_Model model,
                                 java.lang.String class_uri,
                                 Position pos)
Creates an IRDF_Class and adds it to this namespace,as well as performing all other initializations. This method supposes that a check on whether a class with this namespace already exists have already been performed Recall than now more RDF_Resources are not related to graphspaces and any form of relations are retained in the form of RDF_Triple objects The IRDF_Class object returned is already added to the namespace hashmap with classes

Overrides:
createClass in class RDF_Namespace
Parameters:
model -
subject -
pos -
Returns:

createMetaClassOfClasses

protected IRDF_MetaClass createMetaClassOfClasses(IRDF_Model model,
                                                  java.lang.String meta_class_uri,
                                                  Position pos)
Creates an rdf metaclass but without creating the subclass triple to the rdf schema class which is the actual requirement for a class to be a metaclass

Overrides:
createMetaClassOfClasses in class RDF_Namespace
Parameters:
model -
meta_class_uri -
pos -
Returns:

createMetaClassOfProperties

protected IRDF_MetaClass createMetaClassOfProperties(IRDF_Model model,
                                                     java.lang.String meta_class_uri,
                                                     Position pos)
Creates an rdf metaclass but without creating the subclass triple to the rdf schema class which is the actual requirement for a class to be a metaclass

Overrides:
createMetaClassOfProperties in class RDF_Namespace
Parameters:
model -
meta_class_uri -
pos -
Returns:

createProperty

protected IRDF_Property createProperty(IRDF_Model model,
                                       java.lang.String property_uri,
                                       Position pos)
Creates an IRDF_Property and adds it to this namespace,as well as performing all other initializations. This method supposes that a check on whether a property with this namespace already exists have already been performed Recall than now more RDF_Resources are not related to graphspaces and any form of relations are retained in the form of RDF_Triple objects

Overrides:
createProperty in class RDF_Namespace
Parameters:
model -
property_uri -
pos -
Returns:

getOrCreateTypeTriple

protected IRDF_Type getOrCreateTypeTriple(IRDF_Model model,
                                          IRDF_Resource subject_resource,
                                          IRDF_Resource object_resource,
                                          IRDF_Namespace namespace,
                                          boolean inferred)
If a type triple for subject resource with type the object_resource already exists it retrieves it or else if object_resource is null checks for a type triple with any object or else creates a new one

Overrides:
getOrCreateTypeTriple in class RDF_Namespace

getOrCreateSubClassTriple

protected IRDF_SubClass getOrCreateSubClassTriple(IRDF_Model model,
                                                  IRDF_Class subject_class,
                                                  IRDF_Class object_class,
                                                  IRDF_Namespace subject_namespace,
                                                  boolean inferred)
If a subclass triple for subject class and object_class already exists it retrieves it ore else it creates a new one

Overrides:
getOrCreateSubClassTriple in class RDF_Namespace

getOrCreateDomainTriple

protected IRDF_Domain getOrCreateDomainTriple(IRDF_Model model,
                                              IRDF_Property subject_property,
                                              IRDF_Class object_class,
                                              IRDF_Namespace subject_namespace,
                                              boolean inferred)
If a domain triple for subject property and object_class already exists it retrieves it or else it creates a new one The triple is not added in any namespace or in the model in this method

Overrides:
getOrCreateDomainTriple in class RDF_Namespace

getOrCreateRangeTriple

protected IRDF_Range getOrCreateRangeTriple(IRDF_Model model,
                                            IRDF_Property subject_property,
                                            IRDF_Class object_class,
                                            IRDF_Namespace subject_namespace,
                                            boolean inferred)
If a range triple for subject property and object_class already exists it retrieves it or else it creates a new one

Overrides:
getOrCreateRangeTriple in class RDF_Namespace