org.mindswap.pellet.tbox.impl
Class TBoxExpImpl

java.lang.Object
  extended by org.mindswap.pellet.tbox.impl.TBoxExpImpl
All Implemented Interfaces:
TBox

public class TBoxExpImpl
extends java.lang.Object
implements TBox

Title: Implementation of TBox interface to generate explanations efficiently and correctly.

Description:

Copyright: Copyright (c) 2007

Company: Clark & Parsia, LLC.

Author:
Evren Sirin

Field Summary
static java.util.logging.Logger log
           
 TgBox Tg
           
 TuBox Tu
           
 
Constructor Summary
TBoxExpImpl(KnowledgeBase kb)
           
 
Method Summary
 void absorb()
           
 boolean addAxiom(aterm.ATermAppl axiom)
          Add a TBox axiom.
 boolean addClass(aterm.ATermAppl term)
          Add a named class declaration
 boolean containsAxiom(aterm.ATermAppl axiom)
           
 java.util.Collection<aterm.ATermAppl> getAbsorbedAxioms()
           
 java.util.Set<aterm.ATermAppl> getAllClasses()
          Return all the named classes plus TOP and BOTTOM
 java.util.Collection<aterm.ATermAppl> getAssertedAxioms()
          Return all the asserted axioms in this TBox
 java.util.Set<aterm.ATermAppl> getAxiomExplanation(aterm.ATermAppl axiom)
          Return a single explanation for the given TBox axiom.
 java.util.Set<java.util.Set<aterm.ATermAppl>> getAxiomExplanations(aterm.ATermAppl axiom)
          Return multiple explanations for the given TBox axiom.
 java.util.Collection<aterm.ATermAppl> getAxioms()
          Return all the axioms defined in this TBox (may include new axioms introduced during absorption)
 java.util.Collection<aterm.ATermAppl> getAxioms(aterm.ATermAppl term)
          Return all the sub and equivalent class axioms that have the given concept on the left hand side
 java.util.Set<aterm.ATermAppl> getClasses()
          Return all the named classes
 KnowledgeBase getKB()
           
 boolean isPrimitive(aterm.ATermAppl c)
          Returns if a concept has only primitive definitions in this TBox.
 void prepare()
          Make any preparation necessary before reasoning.
 void print()
           
 void print(java.lang.Appendable str)
           
 boolean removeAxiom(aterm.ATermAppl axiom)
          Remove axiom from TBox and all other axioms that depend on it.
 boolean removeAxiom(aterm.ATermAppl dependantAxiom, aterm.ATermAppl explanationAxiom)
          Remove all explanations for dependantAxiom that contain explanationAxiom.
 java.lang.String toString()
           
 java.util.Iterator<Unfolding> unfold(aterm.ATermAppl c)
          Lazy unfold the given concept
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

public static java.util.logging.Logger log

Tu

public TuBox Tu

Tg

public TgBox Tg
Constructor Detail

TBoxExpImpl

public TBoxExpImpl(KnowledgeBase kb)
Method Detail

getKB

public KnowledgeBase getKB()

getAllClasses

public java.util.Set<aterm.ATermAppl> getAllClasses()
Description copied from interface: TBox
Return all the named classes plus TOP and BOTTOM

Specified by:
getAllClasses in interface TBox

getAxiomExplanations

public java.util.Set<java.util.Set<aterm.ATermAppl>> getAxiomExplanations(aterm.ATermAppl axiom)
Description copied from interface: TBox
Return multiple explanations for the given TBox axiom.

Specified by:
getAxiomExplanations in interface TBox
Returns:

getAxiomExplanation

public java.util.Set<aterm.ATermAppl> getAxiomExplanation(aterm.ATermAppl axiom)
Description copied from interface: TBox
Return a single explanation for the given TBox axiom.

Specified by:
getAxiomExplanation in interface TBox
Returns:

addAxiom

public boolean addAxiom(aterm.ATermAppl axiom)
Description copied from interface: TBox
Add a TBox axiom.

Specified by:
addAxiom in interface TBox
Returns:

removeAxiom

public boolean removeAxiom(aterm.ATermAppl axiom)
Description copied from interface: TBox
Remove axiom from TBox and all other axioms that depend on it. An axiom depends on another axiom if it is a syntactic transformation (as in disjoint axiom is transformed into subclass) or it is obtained via absorption (as equivalent class axioms are absorbed into subclass axioms). This method is syntactic sugar for TBox.removeAxiom(ATermAppl, ATermAppl) where both parameters are axiom.

Specified by:
removeAxiom in interface TBox
Returns:

removeAxiom

public boolean removeAxiom(aterm.ATermAppl dependantAxiom,
                           aterm.ATermAppl explanationAxiom)
Description copied from interface: TBox
Remove all explanations for dependantAxiom that contain explanationAxiom. If no explanations remain, dependantAxiom is removed and all axioms which depend on it are updated (and will be removed if they have no additional explanations).

Specified by:
removeAxiom in interface TBox
Returns:

getAxioms

public java.util.Collection<aterm.ATermAppl> getAxioms()
Description copied from interface: TBox
Return all the axioms defined in this TBox (may include new axioms introduced during absorption)

Specified by:
getAxioms in interface TBox

getAssertedAxioms

public java.util.Collection<aterm.ATermAppl> getAssertedAxioms()
Description copied from interface: TBox
Return all the asserted axioms in this TBox

Specified by:
getAssertedAxioms in interface TBox

getAbsorbedAxioms

public java.util.Collection<aterm.ATermAppl> getAbsorbedAxioms()

containsAxiom

public boolean containsAxiom(aterm.ATermAppl axiom)

absorb

public void absorb()

print

public void print()

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

print

public void print(java.lang.Appendable str)

addClass

public boolean addClass(aterm.ATermAppl term)
Description copied from interface: TBox
Add a named class declaration

Specified by:
addClass in interface TBox
Returns:
true if TBox changed as a result of this call

getClasses

public java.util.Set<aterm.ATermAppl> getClasses()
Description copied from interface: TBox
Return all the named classes

Specified by:
getClasses in interface TBox

getAxioms

public java.util.Collection<aterm.ATermAppl> getAxioms(aterm.ATermAppl term)
Description copied from interface: TBox
Return all the sub and equivalent class axioms that have the given concept on the left hand side

Specified by:
getAxioms in interface TBox

prepare

public void prepare()
Description copied from interface: TBox
Make any preparation necessary before reasoning.

Specified by:
prepare in interface TBox

unfold

public java.util.Iterator<Unfolding> unfold(aterm.ATermAppl c)
Description copied from interface: TBox
Lazy unfold the given concept

Specified by:
unfold in interface TBox
Returns:

isPrimitive

public boolean isPrimitive(aterm.ATermAppl c)
Description copied from interface: TBox
Returns if a concept has only primitive definitions in this TBox. Only primitive definitions mean the concept did not have any equivalents defined or all equivalence axioms has been absorbed into primitive definitions. This function returns false for complex class expressions.

Specified by:
isPrimitive in interface TBox
Parameters:
c - a concept (named concept or a concept expression)
Returns:
true if the concept is not complex and has only primitive definitions


Copyright © 2004 Evren Sirin. All Rights Reserved.