org.dllearner.reasoning
Class OWLAPIReasoner

java.lang.Object
  extended by org.dllearner.core.AbstractComponent
      extended by org.dllearner.core.AbstractReasonerComponent
          extended by org.dllearner.reasoning.OWLAPIReasoner
All Implemented Interfaces:
BaseReasoner, Component, FuzzyIndividualReasoner, IndividualReasoner, Reasoner, ReasonerComponent, SchemaReasoner

public class OWLAPIReasoner
extends AbstractReasonerComponent

Mapping to OWL API reasoner interface. The OWL API currently supports three reasoners: FaCT++, HermiT and Pellet. FaCT++ is connected using JNI and native libraries, while HermiT and Pellet are pure Java libraries.

Author:
Jens Lehmann

Field Summary
 
Fields inherited from class org.dllearner.core.AbstractReasonerComponent
logger
 
Constructor Summary
OWLAPIReasoner(Set<AbstractKnowledgeSource> sources)
           
 
Method Summary
<T> void
applyConfigEntry(ConfigEntry<T> entry)
          Applies a configuration option to this component.
static Collection<ConfigOption<?>> createConfigOptions()
           
static void exportKBToOWL(File owlOutputFile, KB kb, org.semanticweb.owlapi.model.IRI ontologyIRI)
           
 String getBaseURI()
          Returns the base URI of the knowledge base.
 SortedSet<DatatypeProperty> getBooleanDatatypePropertiesImpl()
           
 OWLAPIReasonerConfigurator getConfigurator()
          For each component, a configurator class is generated in package org.dllearner.core.configurators using the script { org.dllearner.scripts.ConfigJavaGenerator}.
 Map<Individual,SortedSet<Constant>> getDatatypeMembersImpl(DatatypeProperty datatypeProperty)
           
 SortedSet<DatatypeProperty> getDatatypePropertiesImpl()
           
 Description getDomainImpl(DatatypeProperty datatypeProperty)
           
 Description getDomainImpl(ObjectProperty objectProperty)
           
 SortedSet<DatatypeProperty> getDoubleDatatypePropertiesImpl()
           
 Map<Individual,SortedSet<Double>> getDoubleValues(DatatypeProperty datatypeProperty)
           
 Set<NamedClass> getInconsistentClassesImpl()
           
 Set<org.semanticweb.owlapi.model.OWLClass> getInconsistentOWLClasses()
           
 SortedSet<Individual> getIndividuals()
          Gets all individuals in the knowledge base, e.g.
 SortedSet<Individual> getIndividualsImpl(Description concept)
           
 SortedSet<DatatypeProperty> getIntDatatypePropertiesImpl()
           
 Set<Constant> getLabelImpl(Entity entity)
           
 org.semanticweb.owlapi.model.OWLOntologyManager getManager()
          Gets the OWL API ontology manager.
static String getName()
           
 Set<NamedClass> getNamedClasses()
          Gets all named classes in the knowledge base, e.g.
 Set<ObjectProperty> getObjectProperties()
          Gets all object properties in the knowledge base, e.g. hasChild, isCapitalOf, hasEngine.
 org.semanticweb.owlapi.model.OWLOntology getOntology()
          Gets the internal OWL API ontology.
 List<org.semanticweb.owlapi.model.OWLOntology> getOWLAPIOntologies()
           
 Map<String,String> getPrefixes()
          Returns the prefixes used in the knowledge base, e.g. foaf for foaf: .
 Map<Individual,SortedSet<Individual>> getPropertyMembersImpl(ObjectProperty atomicRole)
           
 Description getRangeImpl(ObjectProperty objectProperty)
           
 org.semanticweb.owlapi.reasoner.OWLReasoner getReasoner()
          Gets the internal OWL API reasoner.
 ReasonerType getReasonerType()
          Gets the type of the underlying reasoner.
 Set<Individual> getRelatedIndividualsImpl(Individual individual, ObjectProperty objectProperty)
           
 Set<Constant> getRelatedValuesImpl(Individual individual, DatatypeProperty datatypeProperty)
           
 SortedSet<DatatypeProperty> getStringDatatypePropertiesImpl()
           
 Set<NamedClass> getTypesImpl(Individual individual)
           
 boolean hasTypeImpl(Description concept, Individual individual)
           
 void init()
          Method to be called after the component has been configured.
 boolean isSatisfiableImpl()
           
 boolean isSuperClassOfImpl(Description superConcept, Description subConcept)
           
static void main(String[] args)
          Test
 void releaseKB()
          Call this method to release the knowledge base.
 boolean remainsSatisfiableImpl(Axiom axiom)
           
 
Methods inherited from class org.dllearner.core.AbstractReasonerComponent
changeSources, doubleRetrieval, getAssertedDefinitions, getAtomicConceptsList, getAtomicConceptsList, getAtomicRolesList, getBooleanDatatypeMembers, getBooleanDatatypeProperties, getClassHierarchy, getDatatypeMembers, getDatatypeProperties, getDatatypePropertyHierarchy, getDomain, getDomain, getDoubleDatatypeMembers, getDoubleDatatypeProperties, getFalseDatatypeMembers, getFuzzyIndividuals, getInconsistentClasses, getIndividuals, getInstanceCheckReasoningTimeNs, getIntDatatypeMembers, getIntDatatypeProperties, getLabel, getMostGeneralDatatypeProperties, getMostGeneralProperties, getMostSpecialDatatypeProperties, getMostSpecialProperties, getNrOfInstanceChecks, getNrOfMultiInstanceChecks, getNrOfMultiSubsumptionChecks, getNrOfRetrievals, getNrOfSubsumptionChecks, getNrOfSubsumptionHierarchyQueries, getObjectPropertyHierarchy, getObjectPropertyRelationships, getOverallReasoningTimeNs, getPropertyMembers, getRange, getRange, getRelatedIndividuals, getRelatedValues, getRetrievalReasoningTimeNs, getSources, getStringDatatypeMembers, getStringDatatypeProperties, getSubClasses, getSubProperties, getSubProperties, getSubsumptionReasoningTimeNs, getSuperClasses, getSuperProperties, getSuperProperties, getTimePerInstanceCheckNs, getTimePerRetrievalNs, getTimePerSubsumptionCheckNs, getTrueDatatypeMembers, getTypes, hasType, hasType, hasTypeFuzzyMembership, isEquivalentClass, isSatisfiable, isSuperClassOf, isSuperClassOf, prepareDatatypePropertyHierarchy, prepareRoleHierarchy, prepareSubsumptionHierarchy, remainsSatisfiable, resetStatistics, setUpdated, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OWLAPIReasoner

public OWLAPIReasoner(Set<AbstractKnowledgeSource> sources)
Method Detail

getConfigurator

public OWLAPIReasonerConfigurator getConfigurator()
Description copied from class: AbstractComponent
For each component, a configurator class is generated in package org.dllearner.core.configurators using the script { org.dllearner.scripts.ConfigJavaGenerator}. The configurator provides set and get methods for the configuration options of a component.

Specified by:
getConfigurator in class AbstractComponent
Returns:
An object allowing to configure this component.

getName

public static String getName()

createConfigOptions

public static Collection<ConfigOption<?>> createConfigOptions()

applyConfigEntry

public <T> void applyConfigEntry(ConfigEntry<T> entry)
                      throws InvalidConfigOptionValueException
Description copied from class: AbstractComponent
Applies a configuration option to this component. Implementations of components should use option and value of the config entry to perform an action (usually setting an internal variable to an appropriate value). Since the availability of configurators, it is optional for components to implement this method. Instead of using this method to take an action based on a configuration value, components can also use the getters defined in the components configurator. Important note: Never call this method directly. All calls are done via the ComponentManager.

Type Parameters:
T - Type of the config entry (Integer, String etc.).
Parameters:
entry - A configuration entry.
Throws:
InvalidConfigOptionValueException - This exception is thrown if the value of the config entry is not valid. For instance, a config option may only accept values, which are within intervals 0.1 to 0.3 or 0.5 to 0.8. If the value is outside of those intervals, an exception is thrown. Note that many of the common cases are already caught in the constructor of ConfigEntry (for instance for a DoubleConfigOption you can specify an interval for the value). This means that, as a component developer, you often do not need to implement further validity checks.
See Also:
AbstractComponent.getConfigurator()

init

public void init()
          throws ComponentInitException
Description copied from interface: Component
Method to be called after the component has been configured. Implementation of components can overwrite this method to perform setup and initialisation tasks for this component.

Throws:
ComponentInitException - This exception is thrown if any exceptions occur within the initialisation process of this component. As component developer, you are encouraged to rethrow occuring exception as ComponentInitException and giving an error message as well as the actualy exception by using the constructor ComponentInitException.ComponentInitException(String, Throwable).

getNamedClasses

public Set<NamedClass> getNamedClasses()
Description copied from interface: BaseReasoner
Gets all named classes in the knowledge base, e.g. Person, City, Car.

Returns:
All named classes in KB.

getObjectProperties

public Set<ObjectProperty> getObjectProperties()
Description copied from interface: BaseReasoner
Gets all object properties in the knowledge base, e.g. hasChild, isCapitalOf, hasEngine.

Returns:
All object properties in KB.

getDatatypePropertiesImpl

public SortedSet<DatatypeProperty> getDatatypePropertiesImpl()

getIndividuals

public SortedSet<Individual> getIndividuals()
Description copied from interface: BaseReasoner
Gets all individuals in the knowledge base, e.g. Eric, London, Car829.

Returns:
All individuals in KB.

getReasonerType

public ReasonerType getReasonerType()
Description copied from class: AbstractReasonerComponent
Gets the type of the underlying reasoner. Although rarely necessary, applications can use this to adapt their behaviour to the reasoner.

Specified by:
getReasonerType in class AbstractReasonerComponent
Returns:
The reasoner type.

isSuperClassOfImpl

public boolean isSuperClassOfImpl(Description superConcept,
                                  Description subConcept)

hasTypeImpl

public boolean hasTypeImpl(Description concept,
                           Individual individual)

getIndividualsImpl

public SortedSet<Individual> getIndividualsImpl(Description concept)

getTypesImpl

public Set<NamedClass> getTypesImpl(Individual individual)

isSatisfiableImpl

public boolean isSatisfiableImpl()

getDomainImpl

public Description getDomainImpl(ObjectProperty objectProperty)

getDomainImpl

public Description getDomainImpl(DatatypeProperty datatypeProperty)

getRangeImpl

public Description getRangeImpl(ObjectProperty objectProperty)

getPropertyMembersImpl

public Map<Individual,SortedSet<Individual>> getPropertyMembersImpl(ObjectProperty atomicRole)

getRelatedIndividualsImpl

public Set<Individual> getRelatedIndividualsImpl(Individual individual,
                                                 ObjectProperty objectProperty)

getRelatedValuesImpl

public Set<Constant> getRelatedValuesImpl(Individual individual,
                                          DatatypeProperty datatypeProperty)

getDoubleValues

public Map<Individual,SortedSet<Double>> getDoubleValues(DatatypeProperty datatypeProperty)

getDatatypeMembersImpl

public Map<Individual,SortedSet<Constant>> getDatatypeMembersImpl(DatatypeProperty datatypeProperty)

exportKBToOWL

public static void exportKBToOWL(File owlOutputFile,
                                 KB kb,
                                 org.semanticweb.owlapi.model.IRI ontologyIRI)

main

public static void main(String[] args)
Test

Parameters:
args -

getBooleanDatatypePropertiesImpl

public SortedSet<DatatypeProperty> getBooleanDatatypePropertiesImpl()
Returns:
the booleanDatatypeProperties

getDoubleDatatypePropertiesImpl

public SortedSet<DatatypeProperty> getDoubleDatatypePropertiesImpl()
Returns:
the doubleDatatypeProperties

getIntDatatypePropertiesImpl

public SortedSet<DatatypeProperty> getIntDatatypePropertiesImpl()
Returns:
the intDatatypeProperties

getStringDatatypePropertiesImpl

public SortedSet<DatatypeProperty> getStringDatatypePropertiesImpl()
Returns:
the intDatatypeProperties

getBaseURI

public String getBaseURI()
Description copied from interface: BaseReasoner
Returns the base URI of the knowledge base. If several knowledge sources are used, we only pick one of their base URIs.

Returns:
The base URI, e.g. http://dbpedia.org/resource/.

getPrefixes

public Map<String,String> getPrefixes()
Description copied from interface: BaseReasoner
Returns the prefixes used in the knowledge base, e.g. foaf for foaf: . If several knowledge sources are used, their prefixes are merged. (In case a prefix is defined twice with different values, we pick one of those.)

Returns:
The prefix mapping.

releaseKB

public void releaseKB()
Description copied from class: AbstractReasonerComponent
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.

Specified by:
releaseKB in class AbstractReasonerComponent

getOWLAPIOntologies

public List<org.semanticweb.owlapi.model.OWLOntology> getOWLAPIOntologies()

getInconsistentClassesImpl

public Set<NamedClass> getInconsistentClassesImpl()

getInconsistentOWLClasses

public Set<org.semanticweb.owlapi.model.OWLClass> getInconsistentOWLClasses()

getLabelImpl

public Set<Constant> getLabelImpl(Entity entity)

remainsSatisfiableImpl

public boolean remainsSatisfiableImpl(Axiom axiom)

getManager

public org.semanticweb.owlapi.model.OWLOntologyManager getManager()
Gets the OWL API ontology manager. Use with great caution.

Returns:
The OWL API ontology manager.

getOntology

public org.semanticweb.owlapi.model.OWLOntology getOntology()
Gets the internal OWL API ontology. Use with great caution.

Returns:
The internal OWL API ontology.

getReasoner

public org.semanticweb.owlapi.reasoner.OWLReasoner getReasoner()
Gets the internal OWL API reasoner. Use with great caution.

Returns:
The internal OWL API reasoner.


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