org.dllearner.reasoning
Class DIGReasoner

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

public class DIGReasoner
extends AbstractReasonerComponent

DIG 1.1 implementation of the reasoner interface.

Author:
Jens Lehmann

Field Summary
 
Fields inherited from class org.dllearner.core.AbstractReasonerComponent
logger
 
Constructor Summary
DIGReasoner(Set<AbstractKnowledgeSource> sources)
           
 
Method Summary
<T> void
applyConfigEntry(ConfigEntry<T> entry)
          Applies a configuration option to this component.
static Collection<ConfigOption<?>> createConfigOptions()
           
 String getBaseURI()
          Returns the base URI of the knowledge base.
 DIGReasonerConfigurator getConfigurator()
          For each component, a configurator class is generated in package org.dllearner.core.configurators using the script { org.dllearner.scripts.ConfigJavaGenerator}.
 String getIdentifier()
           
 SortedSet<Individual> getIndividuals()
          Gets all individuals in the knowledge base, e.g.
 SortedSet<Individual> getIndividualsImpl(Description concept)
           
static String getName()
           
 Set<NamedClass> getNamedClasses()
          Constructs a role hierarchy using DIG queries.
 Set<ObjectProperty> getObjectProperties()
          Gets all object properties in the knowledge base, e.g. hasChild, isCapitalOf, hasEngine.
 Map<String,String> getPrefixes()
          Returns the prefixes used in the knowledge base, e.g. foaf for foaf: .
 Map<Individual,SortedSet<Individual>> getPropertyMembersImpl(ObjectProperty atomicRole)
           
 ReasonerType getReasonerType()
          Gets the type of the underlying reasoner.
 URL getReasonerURL()
           
 Set<NamedClass> getTypesImpl(Individual individual)
           
 boolean hasTypeImpl(Description concept, Individual individual)
           
 SortedSet<Individual> hasTypeImpl(Description concept, Set<Individual> individuals)
           
 void init()
          Method to be called after the component has been configured.
 boolean isSatisfiableImpl()
           
 boolean isSuperClassOfImpl(Description superConcept, Description subConcept)
           
 Set<Description> isSuperClassOfImpl(Set<Description> superConcepts, Description subConcept)
           
 void releaseKB()
          Call this method to release the knowledge base.
 void saveOntology(File file, OntologyFormat format)
           
 
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

DIGReasoner

public DIGReasoner(Set<AbstractKnowledgeSource> sources)
Method Detail

getConfigurator

public DIGReasonerConfigurator 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.

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).

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()

getNamedClasses

public Set<NamedClass> getNamedClasses()
Constructs a role hierarchy using DIG queries. After calling this method, one can query parents or children of roles. TODO Does not yet take ignored roles into account.

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.

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)

isSuperClassOfImpl

public Set<Description> isSuperClassOfImpl(Set<Description> superConcepts,
                                           Description subConcept)

hasTypeImpl

public boolean hasTypeImpl(Description concept,
                           Individual individual)

hasTypeImpl

public SortedSet<Individual> hasTypeImpl(Description concept,
                                         Set<Individual> individuals)

getIndividualsImpl

public SortedSet<Individual> getIndividualsImpl(Description concept)

getTypesImpl

public Set<NamedClass> getTypesImpl(Individual individual)

getPropertyMembersImpl

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

isSatisfiableImpl

public boolean isSatisfiableImpl()

getIdentifier

public String getIdentifier()

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

saveOntology

public void saveOntology(File file,
                         OntologyFormat format)

getReasonerURL

public URL getReasonerURL()

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.


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