|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.dllearner.core.AbstractComponent
org.dllearner.core.AbstractReasonerComponent
public abstract class AbstractReasonerComponent
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:
BaseReasoner, SchemaReasoner, IndividualReasoner
exist)ReasoningMethodUnsupportedException
| 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 |
|---|
public static org.apache.log4j.Logger logger
| Constructor Detail |
|---|
public AbstractReasonerComponent(Set<AbstractKnowledgeSource> sources)
sources - The underlying knowledge sources.| Method Detail |
|---|
public Set<AbstractKnowledgeSource> getSources()
public void changeSources(Set<AbstractKnowledgeSource> sources)
sources - The new knowledge sources.public abstract ReasonerType getReasonerType()
public void resetStatistics()
public void setUpdated()
public abstract void releaseKB()
public final Set<NamedClass> getTypes(Individual individual)
IndividualReasoner
getTypes in interface IndividualReasonerindividual - An individual in the knowledge base.
public final boolean isSuperClassOf(Description superClass,
Description subClass)
SchemaReasonersuperClass is a super class of subClass.
isSuperClassOf in interface SchemaReasonersuperClass - The (supposed) super class.subClass - The (supposed) sub class.
superClass is a super class of subClass.
public final boolean isEquivalentClass(Description class1,
Description class2)
SchemaReasonerclass1 is equivalent to class2.
isEquivalentClass in interface SchemaReasonerclass1 - The first class.class2 - The second class2.
class1 is equivalent to class2.public Set<Description> getAssertedDefinitions(NamedClass namedClass)
SchemaReasoner
getAssertedDefinitions in interface SchemaReasonernamedClass - A named class in the background knowledge.
public final Set<Description> isSuperClassOf(Set<Description> superConcepts,
Description subConcept)
SchemaReasonersuperClasses are super classes of subClass
isSuperClassOf in interface SchemaReasonersuperConcepts - A set of (supposed) super classes.subConcept - The (supposed) sub class.
superClasses, which satisfy the superclass-subclass relationship.public final SortedSetTuple<Individual> doubleRetrieval(Description concept)
IndividualReasoner
doubleRetrieval in interface IndividualReasonerconcept - An OWL class description.
public final SortedSet<Individual> getIndividuals(Description concept)
IndividualReasoner
getIndividuals in interface IndividualReasonerconcept - An OWL class description.
public final SortedSet<FuzzyIndividual> getFuzzyIndividuals(Description concept)
getFuzzyIndividuals in interface FuzzyIndividualReasoner
public final boolean hasType(Description concept,
Individual s)
IndividualReasonerindividual is instance of description.
For instance, "Leipzig" may be an instance of "City".
hasType in interface IndividualReasonerconcept - An OWL class description.s - An individual.
public final SortedSet<Individual> hasType(Description concept,
Set<Individual> s)
IndividualReasoner
hasType in interface IndividualReasonerconcept - An OWL class description.s - An individual.
public final Set<NamedClass> getInconsistentClasses()
SchemaReasoner
getInconsistentClasses in interface SchemaReasonerpublic final boolean isSatisfiable()
BaseReasoner
isSatisfiable in interface BaseReasonerpublic final boolean remainsSatisfiable(Axiom axiom)
BaseReasoner
remainsSatisfiable in interface BaseReasoneraxiom - The axiom to be added to the knowledge base.
public final Map<ObjectProperty,Set<Individual>> getObjectPropertyRelationships(Individual individual)
IndividualReasoner
getObjectPropertyRelationships in interface IndividualReasonerindividual - An individual.
public final Set<Individual> getRelatedIndividuals(Individual individual,
ObjectProperty objectProperty)
IndividualReasoner
getRelatedIndividuals in interface IndividualReasonerindividual - An individual, e.g. eric.objectProperty - An object property, e.g. hasChild.
public final Set<Constant> getRelatedValues(Individual individual,
DatatypeProperty datatypeProperty)
IndividualReasoner
getRelatedValues in interface IndividualReasonerindividual - An individual, e.g. eric.
public final Set<Constant> getLabel(Entity entity)
BaseReasoner
getLabel in interface BaseReasonerentity - An entity, e.g. Machine.
public final Map<Individual,SortedSet<Individual>> getPropertyMembers(ObjectProperty atomicRole)
IndividualReasoner
getPropertyMembers in interface IndividualReasoneratomicRole - An object property.
public final Map<Individual,SortedSet<Constant>> getDatatypeMembers(DatatypeProperty datatypeProperty)
IndividualReasoner
getDatatypeMembers in interface IndividualReasonerdatatypeProperty - A data property.
public final Map<Individual,SortedSet<Double>> getDoubleDatatypeMembers(DatatypeProperty datatypeProperty)
IndividualReasoner
getDoubleDatatypeMembers in interface IndividualReasonerdatatypeProperty - A data property.
IndividualReasoner.getDatatypeMembers(DatatypeProperty),
Double.valueOf(String)public final Map<Individual,SortedSet<Integer>> getIntDatatypeMembers(DatatypeProperty datatypeProperty)
IndividualReasoner
getIntDatatypeMembers in interface IndividualReasonerdatatypeProperty - A data property.
IndividualReasoner.getDatatypeMembers(DatatypeProperty),
Integer.valueOf(String)public final Map<Individual,SortedSet<Boolean>> getBooleanDatatypeMembers(DatatypeProperty datatypeProperty)
IndividualReasoner
getBooleanDatatypeMembers in interface IndividualReasonerdatatypeProperty - A data property.
IndividualReasoner.getDatatypeMembers(DatatypeProperty)public final SortedSet<Individual> getTrueDatatypeMembers(DatatypeProperty datatypeProperty)
IndividualReasoner
getTrueDatatypeMembers in interface IndividualReasonerdatatypeProperty - A data property.
IndividualReasoner.getDatatypeMembers(DatatypeProperty)public final SortedSet<Individual> getFalseDatatypeMembers(DatatypeProperty datatypeProperty)
IndividualReasoner
getFalseDatatypeMembers in interface IndividualReasonerdatatypeProperty - A data property.
IndividualReasoner.getDatatypeMembers(DatatypeProperty)public final Map<Individual,SortedSet<String>> getStringDatatypeMembers(DatatypeProperty datatypeProperty)
IndividualReasoner
getStringDatatypeMembers in interface IndividualReasonerdatatypeProperty - A data property.
IndividualReasoner.getDatatypeMembers(DatatypeProperty)public final SortedSet<DatatypeProperty> getDatatypeProperties()
BaseReasoner
getDatatypeProperties in interface BaseReasonerpublic final SortedSet<DatatypeProperty> getBooleanDatatypeProperties()
BaseReasoner
getBooleanDatatypeProperties in interface BaseReasonerorg.dllearner.core.owl.Datatype#BOOLEANpublic final SortedSet<DatatypeProperty> getIntDatatypeProperties()
BaseReasoner
getIntDatatypeProperties in interface BaseReasonerorg.dllearner.core.owl.Datatype#INTpublic final SortedSet<DatatypeProperty> getDoubleDatatypeProperties()
BaseReasoner
getDoubleDatatypeProperties in interface BaseReasonerorg.dllearner.core.owl.Datatype#DOUBLEpublic final SortedSet<DatatypeProperty> getStringDatatypeProperties()
BaseReasoner
getStringDatatypeProperties in interface BaseReasonerorg.dllearner.core.owl.Datatype#Stringpublic final Description getDomain(ObjectProperty objectProperty)
SchemaReasoner
getDomain in interface SchemaReasonerobjectProperty - An object property in the knowledge base.
objectPropertypublic final Description getDomain(DatatypeProperty datatypeProperty)
SchemaReasoner
getDomain in interface SchemaReasonerdatatypeProperty - An data property in the knowledge base.
datatypePropertypublic final Description getRange(ObjectProperty objectProperty)
SchemaReasoner
getRange in interface SchemaReasonerobjectProperty - An object property in the knowledge base.
objectPropertypublic final DataRange getRange(DatatypeProperty datatypeProperty)
SchemaReasoner
getRange in interface SchemaReasonerdatatypeProperty - An data property in the knowledge base.
datatypePropertypublic final SortedSet<Description> getSuperClasses(Description concept)
SchemaReasoner
getSuperClasses in interface SchemaReasonerconcept - Atomic concept, top, or bottom.
public final SortedSet<Description> getSubClasses(Description concept)
SchemaReasoner
getSubClasses in interface SchemaReasonerconcept - Atomic concept, top, or bottom.
public final SortedSet<ObjectProperty> getSuperProperties(ObjectProperty role)
SchemaReasoner
getSuperProperties in interface SchemaReasonerrole - Atomic concept, top, or bottom.
ObjectPropertyHierarchy.getMoreGeneralRoles(ObjectProperty)public final SortedSet<ObjectProperty> getSubProperties(ObjectProperty role)
SchemaReasoner
getSubProperties in interface SchemaReasonerrole - Atomic concept, top, or bottom.
ObjectPropertyHierarchy.getMoreSpecialRoles(ObjectProperty)public final TreeSet<ObjectProperty> getMostGeneralProperties()
SchemaReasoner
getMostGeneralProperties in interface SchemaReasonerObjectPropertyHierarchy.getMostGeneralRoles()public final TreeSet<ObjectProperty> getMostSpecialProperties()
SchemaReasoner
getMostSpecialProperties in interface SchemaReasonerObjectPropertyHierarchy.getMostSpecialRoles()public final SortedSet<DatatypeProperty> getSuperProperties(DatatypeProperty role)
SchemaReasoner
getSuperProperties in interface SchemaReasonerrole - Atomic concept, top, or bottom.
ObjectPropertyHierarchy.getMoreGeneralRoles(ObjectProperty)public final SortedSet<DatatypeProperty> getSubProperties(DatatypeProperty role)
SchemaReasoner
getSubProperties in interface SchemaReasonerrole - Atomic concept, top, or bottom.
ObjectPropertyHierarchy.getMoreSpecialRoles(ObjectProperty)public final TreeSet<DatatypeProperty> getMostGeneralDatatypeProperties()
getMostGeneralDatatypeProperties in interface SchemaReasonerObjectPropertyHierarchy.getMostGeneralRoles()public final TreeSet<DatatypeProperty> getMostSpecialDatatypeProperties()
getMostSpecialDatatypeProperties in interface SchemaReasonerObjectPropertyHierarchy.getMostSpecialRoles()
public final ClassHierarchy prepareSubsumptionHierarchy()
throws ReasoningMethodUnsupportedException
ReasoningMethodUnsupportedException - If any method needed to
create the hierarchy is not supported by the underlying reasoner.public final ClassHierarchy getClassHierarchy()
SchemaReasoner
getClassHierarchy in interface SchemaReasoner
public ObjectPropertyHierarchy prepareRoleHierarchy()
throws ReasoningMethodUnsupportedException
ReasoningMethodUnsupportedException - Thrown if a reasoning method for object property
hierarchy creation is not supported by the reasoner.public final ObjectPropertyHierarchy getObjectPropertyHierarchy()
SchemaReasoner
getObjectPropertyHierarchy in interface SchemaReasoner
public DatatypePropertyHierarchy prepareDatatypePropertyHierarchy()
throws ReasoningMethodUnsupportedException
ReasoningMethodUnsupportedException - Thrown if data property hierarchy creation is not supported
by the reasoner.public final DatatypePropertyHierarchy getDatatypePropertyHierarchy()
SchemaReasoner
getDatatypePropertyHierarchy in interface SchemaReasonerpublic List<NamedClass> getAtomicConceptsList()
public List<NamedClass> getAtomicConceptsList(boolean removeOWLThing)
public List<ObjectProperty> getAtomicRolesList()
public long getInstanceCheckReasoningTimeNs()
public long getRetrievalReasoningTimeNs()
public int getNrOfInstanceChecks()
public int getNrOfRetrievals()
public int getNrOfSubsumptionChecks()
public long getSubsumptionReasoningTimeNs()
public int getNrOfSubsumptionHierarchyQueries()
public long getOverallReasoningTimeNs()
public long getTimePerRetrievalNs()
public long getTimePerInstanceCheckNs()
public long getTimePerSubsumptionCheckNs()
public int getNrOfMultiSubsumptionChecks()
public int getNrOfMultiInstanceChecks()
public String toString()
toString in class Object
public double hasTypeFuzzyMembership(Description description,
FuzzyIndividual individual)
hasTypeFuzzyMembership in interface FuzzyIndividualReasonerdescription - An OWL class description.individual - An individual.
individual satisfying description [0-1].
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||