org.semanticweb.HermiT
Class Reasoner
java.lang.Object
org.semanticweb.HermiT.Reasoner
- All Implemented Interfaces:
- java.io.Serializable
public class Reasoner
- extends java.lang.Object
- implements java.io.Serializable
Answers queries about the logical implications of a particular knowledge base.
A Reasoner is associated with a single knowledge base, which is "loaded" when
the reasoner is constructed. By default a full classification of all atomic
terms in the knowledge base is also performed at this time (which can take
quite a while for large or complex ontologies), but this behavior can be
disabled as a part of the Reasoner configuration.
Internal details of the loading and reasoning algorithms can be configured
in the Reasoner constructor and do not change over the lifetime of the
Reasoner object---internal data structures and caches are optimized for a
particular configuration. By default, HermiT will use the set of options
which provide optimal performance.
- See Also:
- Serialized Form
|
Method Summary |
void |
cacheRealization()
|
private AtomicConcept |
define(org.semanticweb.owl.model.OWLDescription desc)
|
protected java.util.Map<AtomicConcept,HierarchyPosition<AtomicConcept>> |
getAtomicConceptHierarchy()
|
protected java.util.Map<AtomicRole,HierarchyPosition<AtomicRole>> |
getAtomicRoleHierarchy()
|
java.util.Map<java.lang.String,HierarchyPosition<java.lang.String>> |
getClassTaxonomy()
|
HierarchyPosition<java.lang.String> |
getClassTaxonomyPosition(java.lang.String className)
|
java.util.Set<org.semanticweb.owl.model.OWLIndividual> |
getDirectMembers(org.semanticweb.owl.model.OWLDescription description)
|
java.util.Set<java.lang.String> |
getDirectMembers(java.lang.String className)
|
DLOntology |
getDLOntology()
|
java.util.Set<org.semanticweb.owl.model.OWLIndividual> |
getMembers(org.semanticweb.owl.model.OWLDescription description)
|
java.util.Set<java.lang.String> |
getMembers(java.lang.String className)
|
protected HierarchyPosition<AtomicConcept> |
getMemberships(Individual individual)
|
HierarchyPosition<org.semanticweb.owl.model.OWLClass> |
getMemberships(org.semanticweb.owl.model.OWLIndividual i)
|
HierarchyPosition<java.lang.String> |
getMemberships(java.lang.String individual)
|
Namespaces |
getNamespaces()
|
protected HierarchyPosition<AtomicConcept> |
getPosition(AtomicConcept c)
|
protected HierarchyPosition<AtomicRole> |
getPosition(AtomicRole r)
|
HierarchyPosition<org.semanticweb.owl.model.OWLDataProperty> |
getPosition(org.semanticweb.owl.model.OWLDataProperty p)
|
HierarchyPosition<org.semanticweb.owl.model.OWLClass> |
getPosition(org.semanticweb.owl.model.OWLDescription description)
|
HierarchyPosition<org.semanticweb.owl.model.OWLObjectProperty> |
getPosition(org.semanticweb.owl.model.OWLObjectProperty p)
|
HierarchyPosition<java.lang.String> |
getPropertyHierarchyPosition(java.lang.String propertyName)
|
private java.util.Map<AtomicConcept,java.util.Set<Individual>> |
getRealization()
|
SubsumptionHierarchy |
getSubsumptionHierarchy()
|
protected boolean |
isAsymmetric(org.semanticweb.owl.model.OWLObjectProperty p)
|
boolean |
isClassNameDefined(java.lang.String classUri)
Return `true` iff `classUri` occured in the loaded knowledge base. |
boolean |
isClassSatisfiable(org.semanticweb.owl.model.OWLDescription desc)
|
boolean |
isClassSatisfiable(java.lang.String classUri)
Check whether `classUri` is satisfiable. |
boolean |
isClassSubsumedBy(java.lang.String childName,
java.lang.String parentName)
|
boolean |
isConsistent()
|
boolean |
isRealizationCached()
|
protected boolean |
isSubsumedBy(AtomicConcept child,
AtomicConcept parent)
|
boolean |
isSubsumedBy(org.semanticweb.owl.model.OWLDescription child,
org.semanticweb.owl.model.OWLDescription parent)
|
boolean |
isSubsumptionCacheSeeded()
|
static Reasoner |
load(java.io.File file)
|
static Reasoner |
load(java.io.InputStream inputStream)
|
protected void |
loadDLOntology(DLOntology dlOntology)
|
protected void |
loadDLOntology(java.io.File file)
|
protected void |
loadOntology(java.net.URI physicalURI)
|
protected void |
loadOntology(java.net.URI physicalURI,
java.util.Set<DescriptionGraph> descriptionGraphs)
|
protected void |
loadOwlOntology(org.semanticweb.owl.model.OWLOntology ontology,
org.semanticweb.owl.model.OWLDataFactory factory,
java.util.Set<DescriptionGraph> descriptionGraphs)
|
int |
numConceptNames()
|
void |
outputClauses(java.io.PrintWriter output,
Namespaces namespaces)
|
void |
printSortedAncestorLists(java.io.PrintWriter output)
|
static void |
printSortedAncestorLists(java.io.PrintWriter output,
java.util.Map<java.lang.String,HierarchyPosition<java.lang.String>> taxonomy)
|
void |
save(java.io.File file)
|
void |
save(java.io.OutputStream outputStream)
|
void |
seedSubsumptionCache()
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
m_config
private final Reasoner.Configuration m_config
m_dlOntology
private DLOntology m_dlOntology
namespaces
private Namespaces namespaces
m_tableau
private Tableau m_tableau
m_subsumptionChecker
private TableauSubsumptionChecker m_subsumptionChecker
atomicConceptHierarchy
private java.util.Map<AtomicConcept,HierarchyPosition<AtomicConcept>> atomicConceptHierarchy
realization
private java.util.Map<AtomicConcept,java.util.Set<Individual>> realization
oldHierarchy
private SubsumptionHierarchy oldHierarchy
clausifier
private OwlClausification clausifier
Reasoner
public Reasoner(java.lang.String ontologyURI)
throws Clausifier.LoadingException,
org.semanticweb.owl.model.OWLException
- Throws:
Clausifier.LoadingException
org.semanticweb.owl.model.OWLException
Reasoner
public Reasoner(java.net.URI ontologyURI)
throws Clausifier.LoadingException,
org.semanticweb.owl.model.OWLException
- Throws:
Clausifier.LoadingException
org.semanticweb.owl.model.OWLException
Reasoner
public Reasoner(java.net.URI ontologyURI,
Reasoner.Configuration config)
throws Clausifier.LoadingException,
org.semanticweb.owl.model.OWLException
- Throws:
Clausifier.LoadingException
org.semanticweb.owl.model.OWLException
Reasoner
public Reasoner(org.semanticweb.owl.model.OWLOntology ontology,
Reasoner.Configuration config)
throws org.semanticweb.owl.model.OWLException
- Throws:
org.semanticweb.owl.model.OWLException
Reasoner
public Reasoner(org.semanticweb.owl.model.OWLOntology ontology,
Reasoner.Configuration config,
java.util.Set<DescriptionGraph> graphs)
throws org.semanticweb.owl.model.OWLException
- Throws:
org.semanticweb.owl.model.OWLException
getDLOntology
public DLOntology getDLOntology()
isConsistent
public boolean isConsistent()
isClassNameDefined
public boolean isClassNameDefined(java.lang.String classUri)
- Return `true` iff `classUri` occured in the loaded knowledge base.
isClassSatisfiable
public boolean isClassSatisfiable(java.lang.String classUri)
- Check whether `classUri` is satisfiable.
Note that classes which were not defined in the input ontology
are satisfiable if and only if the ontology as a whole is
consistent.
isClassSatisfiable
public boolean isClassSatisfiable(org.semanticweb.owl.model.OWLDescription desc)
isAsymmetric
protected boolean isAsymmetric(org.semanticweb.owl.model.OWLObjectProperty p)
seedSubsumptionCache
public void seedSubsumptionCache()
isSubsumptionCacheSeeded
public boolean isSubsumptionCacheSeeded()
cacheRealization
public void cacheRealization()
isRealizationCached
public boolean isRealizationCached()
isSubsumedBy
protected boolean isSubsumedBy(AtomicConcept child,
AtomicConcept parent)
isClassSubsumedBy
public boolean isClassSubsumedBy(java.lang.String childName,
java.lang.String parentName)
isSubsumedBy
public boolean isSubsumedBy(org.semanticweb.owl.model.OWLDescription child,
org.semanticweb.owl.model.OWLDescription parent)
getSubsumptionHierarchy
public SubsumptionHierarchy getSubsumptionHierarchy()
getAtomicRoleHierarchy
protected java.util.Map<AtomicRole,HierarchyPosition<AtomicRole>> getAtomicRoleHierarchy()
getPosition
protected HierarchyPosition<AtomicRole> getPosition(AtomicRole r)
getPropertyHierarchyPosition
public HierarchyPosition<java.lang.String> getPropertyHierarchyPosition(java.lang.String propertyName)
getPosition
public HierarchyPosition<org.semanticweb.owl.model.OWLObjectProperty> getPosition(org.semanticweb.owl.model.OWLObjectProperty p)
getPosition
public HierarchyPosition<org.semanticweb.owl.model.OWLDataProperty> getPosition(org.semanticweb.owl.model.OWLDataProperty p)
numConceptNames
public int numConceptNames()
getAtomicConceptHierarchy
protected java.util.Map<AtomicConcept,HierarchyPosition<AtomicConcept>> getAtomicConceptHierarchy()
getPosition
protected HierarchyPosition<AtomicConcept> getPosition(AtomicConcept c)
define
private AtomicConcept define(org.semanticweb.owl.model.OWLDescription desc)
getClassTaxonomy
public java.util.Map<java.lang.String,HierarchyPosition<java.lang.String>> getClassTaxonomy()
getClassTaxonomyPosition
public HierarchyPosition<java.lang.String> getClassTaxonomyPosition(java.lang.String className)
getPosition
public HierarchyPosition<org.semanticweb.owl.model.OWLClass> getPosition(org.semanticweb.owl.model.OWLDescription description)
getMemberships
protected HierarchyPosition<AtomicConcept> getMemberships(Individual individual)
getMemberships
public HierarchyPosition<java.lang.String> getMemberships(java.lang.String individual)
getMemberships
public HierarchyPosition<org.semanticweb.owl.model.OWLClass> getMemberships(org.semanticweb.owl.model.OWLIndividual i)
getRealization
private java.util.Map<AtomicConcept,java.util.Set<Individual>> getRealization()
getDirectMembers
public java.util.Set<java.lang.String> getDirectMembers(java.lang.String className)
getMembers
public java.util.Set<java.lang.String> getMembers(java.lang.String className)
getMembers
public java.util.Set<org.semanticweb.owl.model.OWLIndividual> getMembers(org.semanticweb.owl.model.OWLDescription description)
getDirectMembers
public java.util.Set<org.semanticweb.owl.model.OWLIndividual> getDirectMembers(org.semanticweb.owl.model.OWLDescription description)
printSortedAncestorLists
public void printSortedAncestorLists(java.io.PrintWriter output)
printSortedAncestorLists
public static void printSortedAncestorLists(java.io.PrintWriter output,
java.util.Map<java.lang.String,HierarchyPosition<java.lang.String>> taxonomy)
loadOntology
protected void loadOntology(java.net.URI physicalURI)
throws Clausifier.LoadingException,
org.semanticweb.owl.model.OWLException
- Throws:
Clausifier.LoadingException
org.semanticweb.owl.model.OWLException
loadOntology
protected void loadOntology(java.net.URI physicalURI,
java.util.Set<DescriptionGraph> descriptionGraphs)
throws Clausifier.LoadingException,
org.semanticweb.owl.model.OWLException
- Throws:
Clausifier.LoadingException
org.semanticweb.owl.model.OWLException
loadOwlOntology
protected void loadOwlOntology(org.semanticweb.owl.model.OWLOntology ontology,
org.semanticweb.owl.model.OWLDataFactory factory,
java.util.Set<DescriptionGraph> descriptionGraphs)
throws org.semanticweb.owl.model.OWLException
- Throws:
org.semanticweb.owl.model.OWLException
loadDLOntology
protected void loadDLOntology(java.io.File file)
throws java.lang.Exception
- Throws:
java.lang.Exception
loadDLOntology
protected void loadDLOntology(DLOntology dlOntology)
throws java.lang.IllegalArgumentException
- Throws:
java.lang.IllegalArgumentException
outputClauses
public void outputClauses(java.io.PrintWriter output,
Namespaces namespaces)
getNamespaces
public Namespaces getNamespaces()
save
public void save(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException
save
public void save(java.io.OutputStream outputStream)
throws java.io.IOException
- Throws:
java.io.IOException
load
public static Reasoner load(java.io.InputStream inputStream)
throws java.io.IOException
- Throws:
java.io.IOException
load
public static Reasoner load(java.io.File file)
throws java.io.IOException
- Throws:
java.io.IOException