org.dllearner.core
Class AbstractReasonerComponent

java.lang.Object
  extended by org.dllearner.core.AbstractComponent
      extended by org.dllearner.core.AbstractReasonerComponent
All Implemented Interfaces:
BaseReasoner, Component, FuzzyIndividualReasoner, IndividualReasoner, Reasoner, ReasonerComponent, SchemaReasoner
Direct Known Subclasses:
DIGReasoner, FastInstanceChecker, FastRetrievalReasoner, FuzzyOWLAPIReasoner, OWLAPIReasoner, PelletReasoner, ProtegeReasoner

public abstract class AbstractReasonerComponent
extends AbstractComponent
implements Reasoner, ReasonerComponent

Abstract component representing a reasoner. Only a few reasoning operations are guaranteed to be implemented by the underlying reasoner, while a ReasoningMethodUnsupportedException is thrown for all other methods. In addition to calling the actual implementations of reasoning operations, the class also collects statistical information, which can be queried. Guidelines for extending the class:

Note, that the method delegation is done to collect statistical information about reasoning performance, e.g. count how often certain methods were called and how long it took to execute them.

Author:
Jens Lehmann

Field Summary
static org.apache.log4j.Logger logger
           
 
Constructor Summary
AbstractReasonerComponent(Set<AbstractKnowledgeSource> sources)
          Constructs a new reasoner component.
 
Method Summary
 void changeSources(Set<AbstractKnowledgeSource> sources)
          Method to exchange the reasoner underlying the learning problem.
 SortedSetTuple<Individual> doubleRetrieval(Description concept)
          Performs a query for all instances of the given class description and its negation.
 Set<Description> getAssertedDefinitions(NamedClass namedClass)
          Returns all asserted owl:equivalence class axioms for the given class.
 List<NamedClass> getAtomicConceptsList()
           
 List<NamedClass> getAtomicConceptsList(boolean removeOWLThing)
           
 List<ObjectProperty> getAtomicRolesList()
           
 Map<Individual,SortedSet<Boolean>> getBooleanDatatypeMembers(DatatypeProperty datatypeProperty)
          Convenience method, which can be used if it is known that the property has values which can be parsed as boolean value.
 SortedSet<DatatypeProperty> getBooleanDatatypeProperties()
          Gets all data properties with range xsd:boolean.
 ClassHierarchy getClassHierarchy()
          Computes and returns the class hierarchy of the knowledge base.
 Map<Individual,SortedSet<Constant>> getDatatypeMembers(DatatypeProperty datatypeProperty)
          Computes and returns all connections between individuals and values through the specified property, e.g.
 SortedSet<DatatypeProperty> getDatatypeProperties()
          Gets all data properties in the knowledge base, e.g. hasIncome, height.
 DatatypePropertyHierarchy getDatatypePropertyHierarchy()
          Computes and returns the data property hierarchy of the knowledge base.
 Description getDomain(DatatypeProperty datatypeProperty)
          Returns the domain of this data property.
 Description getDomain(ObjectProperty objectProperty)
          Returns the domain of this object property.
 Map<Individual,SortedSet<Double>> getDoubleDatatypeMembers(DatatypeProperty datatypeProperty)
          Convenience method, which can be used if it is known that the property has values which can be parsed as double.
 SortedSet<DatatypeProperty> getDoubleDatatypeProperties()
          Gets all data properties with range xsd:double.
 SortedSet<Individual> getFalseDatatypeMembers(DatatypeProperty datatypeProperty)
          Convenience method, which can be used to get all individuals, which have value "false" for the given property.
 SortedSet<FuzzyIndividual> getFuzzyIndividuals(Description concept)
           
 Set<NamedClass> getInconsistentClasses()
          Returns all named classes, which are not satisfiable, i.e. cannot have instances.
 SortedSet<Individual> getIndividuals(Description concept)
          Gets all instances of a given class description in the knowledge base.
 long getInstanceCheckReasoningTimeNs()
           
 Map<Individual,SortedSet<Integer>> getIntDatatypeMembers(DatatypeProperty datatypeProperty)
          Convenience method, which can be used if it is known that the property has values which can be parsed as integer.
 SortedSet<DatatypeProperty> getIntDatatypeProperties()
          Gets all data properties with range xsd:int.
 Set<Constant> getLabel(Entity entity)
          Returns the RDFS labels of an entity.
 TreeSet<DatatypeProperty> getMostGeneralDatatypeProperties()
           
 TreeSet<ObjectProperty> getMostGeneralProperties()
          TODO Outdated in OWL 2, because the universal role is the most general.
 TreeSet<DatatypeProperty> getMostSpecialDatatypeProperties()
           
 TreeSet<ObjectProperty> getMostSpecialProperties()
          TODO Outdated in OWL, because the bottom role is the most specific.
 int getNrOfInstanceChecks()
           
 int getNrOfMultiInstanceChecks()
           
 int getNrOfMultiSubsumptionChecks()
           
 int getNrOfRetrievals()
           
 int getNrOfSubsumptionChecks()
           
 int getNrOfSubsumptionHierarchyQueries()
           
 ObjectPropertyHierarchy getObjectPropertyHierarchy()
          Computes and returns the object property hierarchy of the knowledge base.
 Map<ObjectProperty,Set<Individual>> getObjectPropertyRelationships(Individual individual)
          A map of properties related to an individual, e.g.
 long getOverallReasoningTimeNs()
           
 Map<Individual,SortedSet<Individual>> getPropertyMembers(ObjectProperty atomicRole)
          Computes and returns all connections between individuals through the specified property, e.g.
 DataRange getRange(DatatypeProperty datatypeProperty)
          Returns the range of this data property.
 Description getRange(ObjectProperty objectProperty)
          Returns the range of this object property.
abstract  ReasonerType getReasonerType()
          Gets the type of the underlying reasoner.
 Set<Individual> getRelatedIndividuals(Individual individual, ObjectProperty objectProperty)
          Returns the set of individuals, which are connect to the given individual with the specified object property.
 Set<Constant> getRelatedValues(Individual individual, DatatypeProperty datatypeProperty)
          Returns the set of individuals, which are connect to the given individual with the specified data property.
 long getRetrievalReasoningTimeNs()
           
 Set<AbstractKnowledgeSource> getSources()
          Gets the knowledge sources used by this reasoner.
 Map<Individual,SortedSet<String>> getStringDatatypeMembers(DatatypeProperty datatypeProperty)
          Convenience method, which can be used which returns the property values as strings (note that any literal can be represented as string, even numbers).
 SortedSet<DatatypeProperty> getStringDatatypeProperties()
          Gets all data properties with range xsd:string.
 SortedSet<Description> getSubClasses(Description concept)
          Returns direct sub classes in the class hierarchy.
 SortedSet<DatatypeProperty> getSubProperties(DatatypeProperty role)
          Returns more special concepts in the subsumption hierarchy.
 SortedSet<ObjectProperty> getSubProperties(ObjectProperty role)
          Returns more special concepts in the subsumption hierarchy.
 long getSubsumptionReasoningTimeNs()
           
 SortedSet<Description> getSuperClasses(Description concept)
          Returns direct super classes in the class hierarchy.
 SortedSet<DatatypeProperty> getSuperProperties(DatatypeProperty role)
          Returns more general concepts in the subsumption hierarchy.
 SortedSet<ObjectProperty> getSuperProperties(ObjectProperty role)
          Returns more general concepts in the subsumption hierarchy.
 long getTimePerInstanceCheckNs()
           
 long getTimePerRetrievalNs()
           
 long getTimePerSubsumptionCheckNs()
           
 SortedSet<Individual> getTrueDatatypeMembers(DatatypeProperty datatypeProperty)
          Convenience method, which can be used to get all individuals, which have value "true" for the given property.
 Set<NamedClass> getTypes(Individual individual)
          Returns types of an individual, i.e. those classes where the individual is instance of.
 boolean hasType(Description concept, Individual s)
          Checks whether individual is instance of description.
 SortedSet<Individual> hasType(Description concept, Set<Individual> s)
          Performs instance checks on a set of instances (reasoners might be more efficient than handling each check separately).
 double hasTypeFuzzyMembership(Description description, FuzzyIndividual individual)
          FUZZY EXTENSIONS
 boolean isEquivalentClass(Description class1, Description class2)
          Checks whether class1 is equivalent to class2.
 boolean isSatisfiable()
          Checks consistency of the knowledge.
 boolean isSuperClassOf(Description superClass, Description subClass)
          Checks whether superClass is a super class of subClass.
 Set<Description> isSuperClassOf(Set<Description> superConcepts, Description subConcept)
          Checks which of superClasses are super classes of subClass
 DatatypePropertyHierarchy prepareDatatypePropertyHierarchy()
          Creates the data property hierarchy.
 ObjectPropertyHierarchy prepareRoleHierarchy()
          Creates the object property hierarchy.
 ClassHierarchy prepareSubsumptionHierarchy()
          Creates the class hierarchy.
abstract  void releaseKB()
          Call this method to release the knowledge base.
 boolean remainsSatisfiable(Axiom axiom)
          Checks whether adding the specified axiom leads to an inconsistency.
 void resetStatistics()
          Reset all statistics.
 void setUpdated()
          Notify the reasoner component that the underlying knowledge base has changed and all caches (for named classes, subsumption hierarchies, etc.)
 String toString()
           
 
Methods inherited from class org.dllearner.core.AbstractComponent
createConfigOptions, getConfigurator, getName
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.dllearner.core.BaseReasoner
getBaseURI, getIndividuals, getNamedClasses, getObjectProperties, getPrefixes
 
Methods inherited from interface org.dllearner.core.Component
init
 

Field Detail

logger

public static org.apache.log4j.Logger logger
Constructor Detail

AbstractReasonerComponent

public AbstractReasonerComponent(Set<AbstractKnowledgeSource> sources)
Constructs a new reasoner component.

Parameters:
sources - The underlying knowledge sources.
Method Detail

getSources

public Set<AbstractKnowledgeSource> getSources()
Gets the knowledge sources used by this reasoner.

Returns:
The underlying knowledge sources.

changeSources

public void changeSources(Set<AbstractKnowledgeSource> sources)
Method to exchange the reasoner underlying the learning problem. Implementations, which do not only use the provided sources class variable, must make sure that a call to this method indeed changes them.

Parameters:
sources - The new knowledge sources.

getReasonerType

public abstract ReasonerType getReasonerType()
Gets the type of the underlying reasoner. Although rarely necessary, applications can use this to adapt their behaviour to the reasoner.

Returns:
The reasoner type.

resetStatistics

public void resetStatistics()
Reset all statistics. Usually, you do not need to call this. However, if you e.g. perform benchmarks of learning algorithms and performing reasoning operations, such as a consistency check, before starting the algorithm, you can use this method to reset all statistical values.


setUpdated

public void setUpdated()
Notify the reasoner component that the underlying knowledge base has changed and all caches (for named classes, subsumption hierarchies, etc.) should be invalidaded. TODO Currently, nothing is done to behave correctly after updates.


releaseKB

public abstract void releaseKB()
Call this method to release the knowledge base. Not calling the method may (depending on the underlying reasoner) result in resources for this knowledge base not being freed, which can cause memory leaks.


getTypes

public final Set<NamedClass> getTypes(Individual individual)
Description copied from interface: IndividualReasoner
Returns types of an individual, i.e. those classes where the individual is instance of. For instance, the individual eric could have type Person.

Specified by:
getTypes in interface IndividualReasoner
Parameters:
individual - An individual in the knowledge base.
Returns:
Types this individual is instance of.

isSuperClassOf

public final boolean isSuperClassOf(Description superClass,
                                    Description subClass)
Description copied from interface: SchemaReasoner
Checks whether superClass is a super class of subClass.

Specified by:
isSuperClassOf in interface SchemaReasoner
Parameters:
superClass - The (supposed) super class.
subClass - The (supposed) sub class.
Returns:
Whether superClass is a super class of subClass.

isEquivalentClass

public final boolean isEquivalentClass(Description class1,
                                       Description class2)
Description copied from interface: SchemaReasoner
Checks whether class1 is equivalent to class2.

Specified by:
isEquivalentClass in interface SchemaReasoner
Parameters:
class1 - The first class.
class2 - The second class2.
Returns:
Whether class1 is equivalent to class2.

getAssertedDefinitions

public Set<Description> getAssertedDefinitions(NamedClass namedClass)
Description copied from interface: SchemaReasoner
Returns all asserted owl:equivalence class axioms for the given class.

Specified by:
getAssertedDefinitions in interface SchemaReasoner
Parameters:
namedClass - A named class in the background knowledge.
Returns:
A set of descriptions asserted to be equal to the named class.

isSuperClassOf

public final Set<Description> isSuperClassOf(Set<Description> superConcepts,
                                             Description subConcept)
Description copied from interface: SchemaReasoner
Checks which of superClasses are super classes of subClass

Specified by:
isSuperClassOf in interface SchemaReasoner
Parameters:
superConcepts - A set of (supposed) super classes.
subConcept - The (supposed) sub class.
Returns:
The subset of superClasses, which satisfy the superclass-subclass relationship.

doubleRetrieval

public final SortedSetTuple<Individual> doubleRetrieval(Description concept)
Description copied from interface: IndividualReasoner
Performs a query for all instances of the given class description and its negation. (Note that in OWL it is possible that the reasoner can neither deduce that an individual is instance of a class nor its negation.) This method might be more efficient that performing a two retrievals.

Specified by:
doubleRetrieval in interface IndividualReasoner
Parameters:
concept - An OWL class description.
Returns:
All instances of the class description and its negation.

getIndividuals

public final SortedSet<Individual> getIndividuals(Description concept)
Description copied from interface: IndividualReasoner
Gets all instances of a given class description in the knowledge base.

Specified by:
getIndividuals in interface IndividualReasoner
Parameters:
concept - An OWL class description.
Returns:
All instances of the class description.

getFuzzyIndividuals

public final SortedSet<FuzzyIndividual> getFuzzyIndividuals(Description concept)
Specified by:
getFuzzyIndividuals in interface FuzzyIndividualReasoner

hasType

public final boolean hasType(Description concept,
                             Individual s)
Description copied from interface: IndividualReasoner
Checks whether individual is instance of description. For instance, "Leipzig" may be an instance of "City".

Specified by:
hasType in interface IndividualReasoner
Parameters:
concept - An OWL class description.
s - An individual.
Returns:
True if the instance has the description as type and false otherwise.

hasType

public final SortedSet<Individual> hasType(Description concept,
                                           Set<Individual> s)
Description copied from interface: IndividualReasoner
Performs instance checks on a set of instances (reasoners might be more efficient than handling each check separately).

Specified by:
hasType in interface IndividualReasoner
Parameters:
concept - An OWL class description.
s - An individual.
Returns:
The subset of those instances, which have the given type.

getInconsistentClasses

public final Set<NamedClass> getInconsistentClasses()
Description copied from interface: SchemaReasoner
Returns all named classes, which are not satisfiable, i.e. cannot have instances.

Specified by:
getInconsistentClasses in interface SchemaReasoner
Returns:
The set of inconsistent classes.

isSatisfiable

public final boolean isSatisfiable()
Description copied from interface: BaseReasoner
Checks consistency of the knowledge.

Specified by:
isSatisfiable in interface BaseReasoner
Returns:
True if the knowledge base is consistent and false otherwise.

remainsSatisfiable

public final boolean remainsSatisfiable(Axiom axiom)
Description copied from interface: BaseReasoner
Checks whether adding the specified axiom leads to an inconsistency.

Specified by:
remainsSatisfiable in interface BaseReasoner
Parameters:
axiom - The axiom to be added to the knowledge base.
Returns:
True of the knowledge base including the axiom is satisfiable. False otherwise.

getObjectPropertyRelationships

public final Map<ObjectProperty,Set<Individual>> getObjectPropertyRelationships(Individual individual)
Description copied from interface: IndividualReasoner
A map of properties related to an individual, e.g. {hasChild => {eric,anna}, hasSibling => {sebastian}}.

Specified by:
getObjectPropertyRelationships in interface IndividualReasoner
Parameters:
individual - An individual.
Returns:
A map of of properties connected to the individual as keys and the individuals they point to as values.

getRelatedIndividuals

public final Set<Individual> getRelatedIndividuals(Individual individual,
                                                   ObjectProperty objectProperty)
Description copied from interface: IndividualReasoner
Returns the set of individuals, which are connect to the given individual with the specified object property.

Specified by:
getRelatedIndividuals in interface IndividualReasoner
Parameters:
individual - An individual, e.g. eric.
objectProperty - An object property, e.g. hasChild.
Returns:
A set of individuals, e.g. {anna, maria}.

getRelatedValues

public final Set<Constant> getRelatedValues(Individual individual,
                                            DatatypeProperty datatypeProperty)
Description copied from interface: IndividualReasoner
Returns the set of individuals, which are connect to the given individual with the specified data property.

Specified by:
getRelatedValues in interface IndividualReasoner
Parameters:
individual - An individual, e.g. eric.
Returns:
A set of individuals, e.g. {48000^^xsd:int}.

getLabel

public final Set<Constant> getLabel(Entity entity)
Description copied from interface: BaseReasoner
Returns the RDFS labels of an entity.

Specified by:
getLabel in interface BaseReasoner
Parameters:
entity - An entity, e.g. Machine.
Returns:
All values of rdfs:label for the entity, e.g. {"Machine"@en, "Maschine"@de}.

getPropertyMembers

public final Map<Individual,SortedSet<Individual>> getPropertyMembers(ObjectProperty atomicRole)
Description copied from interface: IndividualReasoner
Computes and returns all connections between individuals through the specified property, e.g. {eric => {maria, anna}, anna => {eric}}.

Specified by:
getPropertyMembers in interface IndividualReasoner
Parameters:
atomicRole - An object property.
Returns:
The mapping of individuals to other individuals through this object property.

getDatatypeMembers

public final Map<Individual,SortedSet<Constant>> getDatatypeMembers(DatatypeProperty datatypeProperty)
Description copied from interface: IndividualReasoner
Computes and returns all connections between individuals and values through the specified property, e.g. {eric => {48000^^xsd:int}, sarah => {56000^^xsd:int}}.

Specified by:
getDatatypeMembers in interface IndividualReasoner
Parameters:
datatypeProperty - A data property.
Returns:
The mapping between individuals and values through the given property.

getDoubleDatatypeMembers

public final Map<Individual,SortedSet<Double>> getDoubleDatatypeMembers(DatatypeProperty datatypeProperty)
Description copied from interface: IndividualReasoner
Convenience method, which can be used if it is known that the property has values which can be parsed as double.

Specified by:
getDoubleDatatypeMembers in interface IndividualReasoner
Parameters:
datatypeProperty - A data property.
Returns:
The mapping between individuals and double values through the given property.
See Also:
IndividualReasoner.getDatatypeMembers(DatatypeProperty), Double.valueOf(String)

getIntDatatypeMembers

public final Map<Individual,SortedSet<Integer>> getIntDatatypeMembers(DatatypeProperty datatypeProperty)
Description copied from interface: IndividualReasoner
Convenience method, which can be used if it is known that the property has values which can be parsed as integer.

Specified by:
getIntDatatypeMembers in interface IndividualReasoner
Parameters:
datatypeProperty - A data property.
Returns:
The mapping between individuals and integer values through the given property.
See Also:
IndividualReasoner.getDatatypeMembers(DatatypeProperty), Integer.valueOf(String)

getBooleanDatatypeMembers

public final Map<Individual,SortedSet<Boolean>> getBooleanDatatypeMembers(DatatypeProperty datatypeProperty)
Description copied from interface: IndividualReasoner
Convenience method, which can be used if it is known that the property has values which can be parsed as boolean value. Only "true" or "false" are accepted. If other values occur, a warning will be issued.

Specified by:
getBooleanDatatypeMembers in interface IndividualReasoner
Parameters:
datatypeProperty - A data property.
Returns:
The mapping between individuals and boolean values through the given property.
See Also:
IndividualReasoner.getDatatypeMembers(DatatypeProperty)

getTrueDatatypeMembers

public final SortedSet<Individual> getTrueDatatypeMembers(DatatypeProperty datatypeProperty)
Description copied from interface: IndividualReasoner
Convenience method, which can be used to get all individuals, which have value "true" for the given property. Usually, data properties can have several values for a given individual, but this method will throw a runtime exception if this is the case (i.e. the set of values is {"true", "false"}).

Specified by:
getTrueDatatypeMembers in interface IndividualReasoner
Parameters:
datatypeProperty - A data property.
Returns:
The set of individuals for which the boolean property holds.
See Also:
IndividualReasoner.getDatatypeMembers(DatatypeProperty)

getFalseDatatypeMembers

public final SortedSet<Individual> getFalseDatatypeMembers(DatatypeProperty datatypeProperty)
Description copied from interface: IndividualReasoner
Convenience method, which can be used to get all individuals, which have value "false" for the given property. Usually, data properties can have several values for a given individual, but this method will throw a runtime exception if this is the case (i.e. the set of values is {"true", "false"}).

Specified by:
getFalseDatatypeMembers in interface IndividualReasoner
Parameters:
datatypeProperty - A data property.
Returns:
The set of individuals for which the boolean property does not hold.
See Also:
IndividualReasoner.getDatatypeMembers(DatatypeProperty)

getStringDatatypeMembers

public final Map<Individual,SortedSet<String>> getStringDatatypeMembers(DatatypeProperty datatypeProperty)
Description copied from interface: IndividualReasoner
Convenience method, which can be used which returns the property values as strings (note that any literal can be represented as string, even numbers).

Specified by:
getStringDatatypeMembers in interface IndividualReasoner
Parameters:
datatypeProperty - A data property.
Returns:
The mapping between individuals and string values through the given property.
See Also:
IndividualReasoner.getDatatypeMembers(DatatypeProperty)

getDatatypeProperties

public final SortedSet<DatatypeProperty> getDatatypeProperties()
Description copied from interface: BaseReasoner
Gets all data properties in the knowledge base, e.g. hasIncome, height.

Specified by:
getDatatypeProperties in interface BaseReasoner
Returns:
All data properties in KB.

getBooleanDatatypeProperties

public final SortedSet<DatatypeProperty> getBooleanDatatypeProperties()
Description copied from interface: BaseReasoner
Gets all data properties with range xsd:boolean.

Specified by:
getBooleanDatatypeProperties in interface BaseReasoner
Returns:
Boolean data properties in KB.
See Also:
org.dllearner.core.owl.Datatype#BOOLEAN

getIntDatatypeProperties

public final SortedSet<DatatypeProperty> getIntDatatypeProperties()
Description copied from interface: BaseReasoner
Gets all data properties with range xsd:int. TODO We could extend this to all types, which can be parsed into Integers, e.g. xsd:integer, xsd:negativeInteger, xsd:nonNegativeInteger etc.

Specified by:
getIntDatatypeProperties in interface BaseReasoner
Returns:
Integer data properties in KB.
See Also:
org.dllearner.core.owl.Datatype#INT

getDoubleDatatypeProperties

public final SortedSet<DatatypeProperty> getDoubleDatatypeProperties()
Description copied from interface: BaseReasoner
Gets all data properties with range xsd:double. TODO We could extend this to all types, which can be parsed into a double value, e.g. floats.

Specified by:
getDoubleDatatypeProperties in interface BaseReasoner
Returns:
Double data properties in KB.
See Also:
org.dllearner.core.owl.Datatype#DOUBLE

getStringDatatypeProperties

public final SortedSet<DatatypeProperty> getStringDatatypeProperties()
Description copied from interface: BaseReasoner
Gets all data properties with range xsd:string. TODO We could extend this to all types, which can be parsed into strings and even include the properties without any specified datatype.

Specified by:
getStringDatatypeProperties in interface BaseReasoner
Returns:
String data properties in KB.
See Also:
org.dllearner.core.owl.Datatype#String

getDomain

public final Description getDomain(ObjectProperty objectProperty)
Description copied from interface: SchemaReasoner
Returns the domain of this object property. (Theoretically, there could be more than one domain axiom. However, this can be considered a modelling error.)

Specified by:
getDomain in interface SchemaReasoner
Parameters:
objectProperty - An object property in the knowledge base.
Returns:
The rdfs:domain of objectProperty

getDomain

public final Description getDomain(DatatypeProperty datatypeProperty)
Description copied from interface: SchemaReasoner
Returns the domain of this data property.

Specified by:
getDomain in interface SchemaReasoner
Parameters:
datatypeProperty - An data property in the knowledge base.
Returns:
The rdfs:domain of datatypeProperty

getRange

public final Description getRange(ObjectProperty objectProperty)
Description copied from interface: SchemaReasoner
Returns the range of this object property.

Specified by:
getRange in interface SchemaReasoner
Parameters:
objectProperty - An object property in the knowledge base.
Returns:
The rdfs:range of objectProperty

getRange

public final DataRange getRange(DatatypeProperty datatypeProperty)
Description copied from interface: SchemaReasoner
Returns the range of this data property.

Specified by:
getRange in interface SchemaReasoner
Parameters:
datatypeProperty - An data property in the knowledge base.
Returns:
The rdfs:range of datatypeProperty

getSuperClasses

public final SortedSet<Description> getSuperClasses(Description concept)
Description copied from interface: SchemaReasoner
Returns direct super classes in the class hierarchy.

Specified by:
getSuperClasses in interface SchemaReasoner
Parameters:
concept - Atomic concept, top, or bottom.
Returns:
A set of more general concepts.

getSubClasses

public final SortedSet<Description> getSubClasses(Description concept)
Description copied from interface: SchemaReasoner
Returns direct sub classes in the class hierarchy.

Specified by:
getSubClasses in interface SchemaReasoner
Parameters:
concept - Atomic concept, top, or bottom.
Returns:
A set of more special concepts.

getSuperProperties

public final SortedSet<ObjectProperty> getSuperProperties(ObjectProperty role)
Description copied from interface: SchemaReasoner
Returns more general concepts in the subsumption hierarchy.

Specified by:
getSuperProperties in interface SchemaReasoner
Parameters:
role - Atomic concept, top, or bottom.
Returns:
A set of more general concepts.
See Also:
ObjectPropertyHierarchy.getMoreGeneralRoles(ObjectProperty)

getSubProperties

public final SortedSet<ObjectProperty> getSubProperties(ObjectProperty role)
Description copied from interface: SchemaReasoner
Returns more special concepts in the subsumption hierarchy.

Specified by:
getSubProperties in interface SchemaReasoner
Parameters:
role - Atomic concept, top, or bottom.
Returns:
A set of more special concepts.
See Also:
ObjectPropertyHierarchy.getMoreSpecialRoles(ObjectProperty)

getMostGeneralProperties

public final TreeSet<ObjectProperty> getMostGeneralProperties()
Description copied from interface: SchemaReasoner
TODO Outdated in OWL 2, because the universal role is the most general.

Specified by:
getMostGeneralProperties in interface SchemaReasoner
Returns:
The most general roles.
See Also:
ObjectPropertyHierarchy.getMostGeneralRoles()

getMostSpecialProperties

public final TreeSet<ObjectProperty> getMostSpecialProperties()
Description copied from interface: SchemaReasoner
TODO Outdated in OWL, because the bottom role is the most specific.

Specified by:
getMostSpecialProperties in interface SchemaReasoner
Returns:
The most special roles.
See Also:
ObjectPropertyHierarchy.getMostSpecialRoles()

getSuperProperties

public final SortedSet<DatatypeProperty> getSuperProperties(DatatypeProperty role)
Description copied from interface: SchemaReasoner
Returns more general concepts in the subsumption hierarchy.

Specified by:
getSuperProperties in interface SchemaReasoner
Parameters:
role - Atomic concept, top, or bottom.
Returns:
A set of more general concepts.
See Also:
ObjectPropertyHierarchy.getMoreGeneralRoles(ObjectProperty)

getSubProperties

public final SortedSet<DatatypeProperty> getSubProperties(DatatypeProperty role)
Description copied from interface: SchemaReasoner
Returns more special concepts in the subsumption hierarchy.

Specified by:
getSubProperties in interface SchemaReasoner
Parameters:
role - Atomic concept, top, or bottom.
Returns:
A set of more special concepts.
See Also:
ObjectPropertyHierarchy.getMoreSpecialRoles(ObjectProperty)

getMostGeneralDatatypeProperties

public final TreeSet<DatatypeProperty> getMostGeneralDatatypeProperties()
Specified by:
getMostGeneralDatatypeProperties in interface SchemaReasoner
Returns:
The most general roles.
See Also:
ObjectPropertyHierarchy.getMostGeneralRoles()

getMostSpecialDatatypeProperties

public final TreeSet<DatatypeProperty> getMostSpecialDatatypeProperties()
Specified by:
getMostSpecialDatatypeProperties in interface SchemaReasoner
Returns:
The most special roles.
See Also:
ObjectPropertyHierarchy.getMostSpecialRoles()

prepareSubsumptionHierarchy

public final ClassHierarchy prepareSubsumptionHierarchy()
                                                 throws ReasoningMethodUnsupportedException
Creates the class hierarchy. Invoking this method is optional (if not called explicitly, it is called the first time, it is needed).

Returns:
The class hierarchy.
Throws:
ReasoningMethodUnsupportedException - If any method needed to create the hierarchy is not supported by the underlying reasoner.

getClassHierarchy

public final ClassHierarchy getClassHierarchy()
Description copied from interface: SchemaReasoner
Computes and returns the class hierarchy of the knowledge base.

Specified by:
getClassHierarchy in interface SchemaReasoner
Returns:
The subsumption hierarchy of this knowledge base.

prepareRoleHierarchy

public ObjectPropertyHierarchy prepareRoleHierarchy()
                                             throws ReasoningMethodUnsupportedException
Creates the object property hierarchy. Invoking this method is optional (if not called explicitly, it is called the first time, it is needed).

Returns:
The object property hierarchy.
Throws:
ReasoningMethodUnsupportedException - Thrown if a reasoning method for object property hierarchy creation is not supported by the reasoner.

getObjectPropertyHierarchy

public final ObjectPropertyHierarchy getObjectPropertyHierarchy()
Description copied from interface: SchemaReasoner
Computes and returns the object property hierarchy of the knowledge base.

Specified by:
getObjectPropertyHierarchy in interface SchemaReasoner
Returns:
The object property hierarchy of the knowlege base.

prepareDatatypePropertyHierarchy

public DatatypePropertyHierarchy prepareDatatypePropertyHierarchy()
                                                           throws ReasoningMethodUnsupportedException
Creates the data property hierarchy. Invoking this method is optional (if not called explicitly, it is called the first time, it is needed).

Returns:
The data property hierarchy.
Throws:
ReasoningMethodUnsupportedException - Thrown if data property hierarchy creation is not supported by the reasoner.

getDatatypePropertyHierarchy

public final DatatypePropertyHierarchy getDatatypePropertyHierarchy()
Description copied from interface: SchemaReasoner
Computes and returns the data property hierarchy of the knowledge base.

Specified by:
getDatatypePropertyHierarchy in interface SchemaReasoner
Returns:
The data property hierarchy of the knowlege base.

getAtomicConceptsList

public List<NamedClass> getAtomicConceptsList()

getAtomicConceptsList

public List<NamedClass> getAtomicConceptsList(boolean removeOWLThing)

getAtomicRolesList

public List<ObjectProperty> getAtomicRolesList()

getInstanceCheckReasoningTimeNs

public long getInstanceCheckReasoningTimeNs()

getRetrievalReasoningTimeNs

public long getRetrievalReasoningTimeNs()

getNrOfInstanceChecks

public int getNrOfInstanceChecks()

getNrOfRetrievals

public int getNrOfRetrievals()

getNrOfSubsumptionChecks

public int getNrOfSubsumptionChecks()

getSubsumptionReasoningTimeNs

public long getSubsumptionReasoningTimeNs()

getNrOfSubsumptionHierarchyQueries

public int getNrOfSubsumptionHierarchyQueries()

getOverallReasoningTimeNs

public long getOverallReasoningTimeNs()

getTimePerRetrievalNs

public long getTimePerRetrievalNs()

getTimePerInstanceCheckNs

public long getTimePerInstanceCheckNs()

getTimePerSubsumptionCheckNs

public long getTimePerSubsumptionCheckNs()

getNrOfMultiSubsumptionChecks

public int getNrOfMultiSubsumptionChecks()

getNrOfMultiInstanceChecks

public int getNrOfMultiInstanceChecks()

toString

public String toString()
Overrides:
toString in class Object

hasTypeFuzzyMembership

public double hasTypeFuzzyMembership(Description description,
                                     FuzzyIndividual individual)
FUZZY EXTENSIONS

Specified by:
hasTypeFuzzyMembership in interface FuzzyIndividualReasoner
Parameters:
description - An OWL class description.
individual - An individual.
Returns:
fuzzy membership degree of individual satisfying description [0-1].


SourceForge.net Logo DL-Learner is licenced under the terms of the GNU General Public License.
Copyright © 2007-2011 Jens Lehmann