com.ontotext.gate.ontology
Class DAMLKnowledgeBaseImpl

java.lang.Object
  extended bygate.util.AbstractFeatureBearer
      extended bygate.creole.AbstractResource
          extended bygate.creole.AbstractLanguageResource
              extended bycom.ontotext.gate.ontology.TaxonomyImpl
                  extended bycom.ontotext.gate.ontology.OntologyImpl
                      extended bycom.ontotext.gate.ontology.DAMLKnowledgeBaseImpl
All Implemented Interfaces:
FeatureBearer, LanguageResource, NameBearer, Ontology, Resource, Serializable, Taxonomy

public class DAMLKnowledgeBaseImpl
extends OntologyImpl

See Also:
Serialized Form

Field Summary
private static boolean DEBUG
          DEBUG FLAG
private  com.hp.hpl.jena.daml.DAMLModel model
           
 
Fields inherited from class com.ontotext.gate.ontology.OntologyImpl
 
Fields inherited from class com.ontotext.gate.ontology.TaxonomyImpl
DIRECT_CLOSURE, lastGeneratedId, modified, nullBuffers, TRANSITIVE_CLOSURE
 
Fields inherited from class gate.creole.AbstractLanguageResource
dataStore, lrPersistentId
 
Fields inherited from class gate.creole.AbstractResource
 
Fields inherited from class gate.util.AbstractFeatureBearer
features
 
Constructor Summary
DAMLKnowledgeBaseImpl()
           
 
Method Summary
private  Property addPropertyDefinition(com.hp.hpl.jena.daml.DAMLProperty property, String propName, OClass kbClass, Map propertiesMap)
           
private  void addPropertyDefinitions(HashMap propertiesMap)
           
private  void addRemainingProperties(HashMap propertiesMap)
           
private  boolean isRelationDefinedOnSuperClass(OClass kbClass, String domainName)
           
 void load()
          Loads this ontology.
protected  com.hp.hpl.jena.daml.DAMLModel loadAndGetModel()
          Introduced a protected method that retuns the model, so it can be used in a subclass to get more data before discarding it
private  Property searchSuperClasses(String propName, com.hp.hpl.jena.daml.DAMLClass theClass, Map propertiesMap)
           
 void store()
          Stores this ontology.
protected  com.hp.hpl.jena.daml.DAMLModel storeAndGetModel()
           
protected  void writeModel(com.hp.hpl.jena.daml.DAMLModel model)
           
 
Methods inherited from class com.ontotext.gate.ontology.OntologyImpl
addDatatypeProperty, addDatatypeProperty, addFunctionalProperty, addInstance, addInstance, addObjectProperty, addPropertyDefinition, addSymmetricProperty, addTransitiveProperty, createClass, getDirectInstances, getInstanceByName, getInstances, getInstances, getPropertyDefinitionByName, getPropertyDefinitions, removeInstance
 
Methods inherited from class com.ontotext.gate.ontology.TaxonomyImpl
addClass, addObjectModificationListener, containsClassByName, equals, fireObjectModificationEvent, getClassByName, getClasses, getClasses, getComment, getId, getLabel, getOntology, getSourceURI, getTaxonomicDistance, getTopClasses, getURL, getVersion, init, isDirectSubClassOf, isModified, isSubClassOf, reinfer, removeClass, setComment, setId, setLabel, setModified, setSourceURI, setURL, setVersion, toString
 
Methods inherited from class gate.creole.AbstractLanguageResource
cleanup, getDataStore, getLRPersistenceId, getParent, setDataStore, setLRPersistenceId, setParent, sync
 
Methods inherited from class gate.creole.AbstractResource
checkParameterValues, getBeanInfo, getName, getParameterValue, getParameterValue, removeResourceListeners, setName, setParameterValue, setParameterValue, setParameterValues, setParameterValues, setResourceListeners
 
Methods inherited from class gate.util.AbstractFeatureBearer
getFeatures, setFeatures
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface gate.creole.ontology.Taxonomy
addClass, containsClassByName, equals, getClassByName, getClasses, getClasses, getComment, getId, getLabel, getOntology, getSourceURI, getTaxonomicDistance, getTopClasses, getURL, getVersion, isDirectSubClassOf, isModified, isSubClassOf, removeClass, setComment, setId, setLabel, setModified, setSourceURI, setURL, setVersion
 
Methods inherited from interface gate.LanguageResource
getDataStore, getLRPersistenceId, getParent, setDataStore, setLRPersistenceId, setParent, sync
 
Methods inherited from interface gate.Resource
cleanup, getParameterValue, init, setParameterValue, setParameterValues
 
Methods inherited from interface gate.util.FeatureBearer
getFeatures, setFeatures
 
Methods inherited from interface gate.util.NameBearer
getName, setName
 

Field Detail

DEBUG

private static final boolean DEBUG
DEBUG FLAG

See Also:
Constant Field Values

model

private com.hp.hpl.jena.daml.DAMLModel model
Constructor Detail

DAMLKnowledgeBaseImpl

public DAMLKnowledgeBaseImpl()
Method Detail

load

public void load()
          throws ResourceInstantiationException
Description copied from interface: Taxonomy
Loads this ontology. According to different storages - different implementations are expected. Should take care of the modifiedAfterLoading member

Specified by:
load in interface Taxonomy
Overrides:
load in class TaxonomyImpl
Throws:
ResourceInstantiationException

loadAndGetModel

protected com.hp.hpl.jena.daml.DAMLModel loadAndGetModel()
                                                  throws ResourceInstantiationException
Introduced a protected method that retuns the model, so it can be used in a subclass to get more data before discarding it

Throws:
ResourceInstantiationException

addPropertyDefinition

private Property addPropertyDefinition(com.hp.hpl.jena.daml.DAMLProperty property,
                                       String propName,
                                       OClass kbClass,
                                       Map propertiesMap)
                                throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Throws:
com.hp.hpl.mesa.rdf.jena.model.RDFException

searchSuperClasses

private Property searchSuperClasses(String propName,
                                    com.hp.hpl.jena.daml.DAMLClass theClass,
                                    Map propertiesMap)
                             throws com.hp.hpl.mesa.rdf.jena.model.RDFException
Throws:
com.hp.hpl.mesa.rdf.jena.model.RDFException

isRelationDefinedOnSuperClass

private boolean isRelationDefinedOnSuperClass(OClass kbClass,
                                              String domainName)

addPropertyDefinitions

private void addPropertyDefinitions(HashMap propertiesMap)

addRemainingProperties

private void addRemainingProperties(HashMap propertiesMap)

store

public void store()
           throws ResourceInstantiationException
Description copied from interface: Taxonomy
Stores this ontology. According to different storages - different implementations are expected. Should take care of the modifiedAfterLoading member

Specified by:
store in interface Taxonomy
Overrides:
store in class TaxonomyImpl
Throws:
ResourceInstantiationException

writeModel

protected void writeModel(com.hp.hpl.jena.daml.DAMLModel model)
                   throws ResourceInstantiationException
Throws:
ResourceInstantiationException

storeAndGetModel

protected com.hp.hpl.jena.daml.DAMLModel storeAndGetModel()
                                                   throws ResourceInstantiationException
Throws:
ResourceInstantiationException