org.mindswap.pellet
Class ABox

java.lang.Object
  extended by org.mindswap.pellet.ABox

public class ABox
extends java.lang.Object

Author:
initial version for OWL - Evren Sirin, updates made for OWLMeT - NataKeberle

Field Summary
 long consistencyCount
          Total number of ABox consistency checks (for statistical purposes)
static boolean DEBUG
           
 boolean ranRete
           
 boolean rulesNotApplied
           
 long satisfiabilityCount
          Total number of satisfiability tests performed (for statistical purposes)
 int treeDepth
          size of the completion tree for statistical purposes
 
Constructor Summary
ABox()
           
ABox(ABox abox)
           
ABox(ABox abox, aterm.ATermAppl extraIndividual, boolean copyIndividuals)
           
ABox(KnowledgeBase kb)
           
 
Method Summary
 void addDifferent(aterm.ATermAppl x, aterm.ATermAppl y)
           
 Individual addIndividual(aterm.ATermAppl x)
           
 Literal addLiteral()
          Add a new literal to the ABox.
 Literal addLiteral(aterm.ATermAppl dataValue)
          Add a new literal to the ABox.
 void addSame(aterm.ATermAppl x, aterm.ATermAppl y)
           
 void addType(aterm.ATermAppl x, aterm.ATermAppl c)
           
 void clearCaches(boolean clearSatCache)
          Clear the psuedo model created for the ABox and concept satisfiability.
 ABox copy()
          Create a copy of this ABox with all the nodes and edges.
 ABox copy(aterm.ATermAppl extraIndividual, boolean copyIndividuals)
          Create a copy of this ABox with one more additional individual.
 void copyOnWrite()
           
 boolean doExplanation()
          Checks if the explanatino is turned on.
 java.util.List getBranches()
          Returns the branches.
 Clash getClash()
           
 DatatypeReasoner getDatatypeReasoner()
           
 java.lang.String getExplanation()
           
 org.mindswap.pellet.IndividualIterator getIndIterator()
           
 Individual getIndividual(aterm.ATerm x)
           
 EdgeList getInEdges(aterm.ATerm x)
           
 KnowledgeBase getKB()
           
 Clash getLastClash()
           
 ABox getLastCompletion()
           
 Literal getLiteral(aterm.ATerm x)
           
 Node getNode(aterm.ATerm x)
           
 java.util.List getNodeNames()
           
 java.util.Collection getNodes()
           
 void getObjectPropertyValues(aterm.ATermAppl s, Role role, java.util.Set knowns, java.util.Set unknowns)
           
 java.util.List getObviousDataPropertyValues(aterm.ATermAppl s, Role prop, Datatype datatype)
           
 CandidateSet getObviousInstances(aterm.ATermAppl c)
           
 void getObviousInstances(aterm.ATermAppl c, CandidateSet candidates)
           
 void getObviousObjects(aterm.ATermAppl p, CandidateSet candidates)
           
 CandidateSet getObviousSubjects(aterm.ATermAppl p, aterm.ATermAppl o)
           
 void getObviousSubjects(aterm.ATermAppl p, aterm.ATermAppl o, CandidateSet candidates)
           
 void getObviousTypes(aterm.ATermAppl x, java.util.List types, java.util.List nonTypes)
           
 EdgeList getOutEdges(aterm.ATerm x)
           
 java.util.Set getPossibleProperties(aterm.ATermAppl s)
           
 ABox getPseudoModel()
           
 RBox getRBox()
          Return the RBox
 Role getRole(aterm.ATerm r)
          Convenience function to get the named role.
 void getSames(Individual ind, java.util.Set knowns, java.util.Set unknowns)
           
 org.mindswap.pellet.IndividualIterator getSingletonIterator(Individual x)
           
 void getSubjects(aterm.ATermAppl p, aterm.ATermAppl o, CandidateSet candidates)
           
 TBox getTBox()
          Return the TBox
 Bool hasObviousDataPropertyValue(aterm.ATermAppl s, aterm.ATermAppl p, java.lang.Object value)
           
 Bool hasObviousObjectProperty(aterm.ATermAppl s, aterm.ATermAppl p)
           
 Bool hasObviousObjectPropertyValue(aterm.ATermAppl s, aterm.ATermAppl p, aterm.ATermAppl o)
           
 Bool hasObviousPropertyValue(aterm.ATermAppl s, aterm.ATermAppl p, aterm.ATermAppl o)
           
 boolean hasProperty(aterm.ATermAppl s, aterm.ATermAppl p)
           
 boolean hasPropertyValue(aterm.ATermAppl s, aterm.ATermAppl p, aterm.ATermAppl o)
           
 boolean isClosed()
          Returns true if Abox has a clash.
 boolean isComplete()
           
 boolean isConsistent()
          Return true if this ABox is consistent.
 boolean isEmpty()
          Returns true if there are no individuals in the ABox.
 boolean isInitialized()
          Check if the ABox is ready to be completed.
 boolean isKeepLastCompletion()
           
 Bool isKnownType(aterm.ATermAppl x, aterm.ATermAppl c)
           
 Bool isKnownType(aterm.ATermAppl x, aterm.ATermAppl c, java.util.Collection subs)
           
 Bool isKnownType(Individual pNode, aterm.ATermAppl concept, java.util.Collection subs)
           
 boolean isNode(aterm.ATerm x)
           
 boolean isSameAs(aterm.ATermAppl ind1, aterm.ATermAppl ind2)
           
 boolean isSatisfiable(aterm.ATermAppl c)
           
 boolean isSubClassOf(aterm.ATermAppl c1, aterm.ATermAppl c2)
           
 boolean isType(aterm.ATermAppl x, aterm.ATermAppl c)
          Returns true if individual x belongs to type c.
 boolean isType(java.util.List inds, aterm.ATermAppl c)
          Returns true if any of the individuals in the given list belongs to type c.
 void printTree()
          Print the ABox as a completion tree (child nodes are indented).
 void removeType(aterm.ATermAppl x, aterm.ATermAppl c)
           
 void setClash(Clash clash)
           
 void setDoExplanation(boolean doExplanation)
          Enable/disable explanation generation
 void setInitialized(boolean initialized)
           
 void setKeepLastCompletion(boolean keepLastCompletion)
           
 int size()
          Return the number of nodes in the ABox.
 java.lang.String toString()
           
 void validate()
          Validate all the edges in the ABox nodes.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG

satisfiabilityCount

public long satisfiabilityCount
Total number of satisfiability tests performed (for statistical purposes)


consistencyCount

public long consistencyCount
Total number of ABox consistency checks (for statistical purposes)


treeDepth

public int treeDepth
size of the completion tree for statistical purposes


rulesNotApplied

public boolean rulesNotApplied

ranRete

public boolean ranRete
Constructor Detail

ABox

public ABox()

ABox

public ABox(KnowledgeBase kb)

ABox

public ABox(ABox abox)

ABox

public ABox(ABox abox,
            aterm.ATermAppl extraIndividual,
            boolean copyIndividuals)
Method Detail

copy

public ABox copy()
Create a copy of this ABox with all the nodes and edges.

Returns:

copy

public ABox copy(aterm.ATermAppl extraIndividual,
                 boolean copyIndividuals)
Create a copy of this ABox with one more additional individual. This is NOT equivalent to create a copy and then add the individual. The order of individuals in the ABox is important to figure out which individuals exist in the original ontology and which ones are created by the tableau algorithm. This function creates a new ABox such that the individual is supposed to exist in the original ontology. This is very important when satisfiability of a concept starts with a pesudo model rather than the initial ABox.

Parameters:
extraIndividual - Extra individual to be added to the copy ABox
Returns:

copyOnWrite

public void copyOnWrite()

clearCaches

public void clearCaches(boolean clearSatCache)
Clear the psuedo model created for the ABox and concept satisfiability.

Parameters:
clearSatCache - If true clear concept satisfiability cache, if false only clear pseudo model.

isSubClassOf

public boolean isSubClassOf(aterm.ATermAppl c1,
                            aterm.ATermAppl c2)

isSatisfiable

public boolean isSatisfiable(aterm.ATermAppl c)

getObviousInstances

public CandidateSet getObviousInstances(aterm.ATermAppl c)

getObviousInstances

public void getObviousInstances(aterm.ATermAppl c,
                                CandidateSet candidates)

getObviousTypes

public void getObviousTypes(aterm.ATermAppl x,
                            java.util.List types,
                            java.util.List nonTypes)

getObviousSubjects

public CandidateSet getObviousSubjects(aterm.ATermAppl p,
                                       aterm.ATermAppl o)

getSubjects

public void getSubjects(aterm.ATermAppl p,
                        aterm.ATermAppl o,
                        CandidateSet candidates)

getObviousSubjects

public void getObviousSubjects(aterm.ATermAppl p,
                               aterm.ATermAppl o,
                               CandidateSet candidates)

getObviousObjects

public void getObviousObjects(aterm.ATermAppl p,
                              CandidateSet candidates)

isKnownType

public Bool isKnownType(aterm.ATermAppl x,
                        aterm.ATermAppl c)

isKnownType

public Bool isKnownType(aterm.ATermAppl x,
                        aterm.ATermAppl c,
                        java.util.Collection subs)

isKnownType

public Bool isKnownType(Individual pNode,
                        aterm.ATermAppl concept,
                        java.util.Collection subs)

isSameAs

public boolean isSameAs(aterm.ATermAppl ind1,
                        aterm.ATermAppl ind2)

isType

public boolean isType(aterm.ATermAppl x,
                      aterm.ATermAppl c)
Returns true if individual x belongs to type c. This is a logical consequence of the KB if in all possible models x belongs to C. This is checked by trying to construct a model where x belongs to not(c).

Parameters:
x -
c -
Returns:

isType

public boolean isType(java.util.List inds,
                      aterm.ATermAppl c)
Returns true if any of the individuals in the given list belongs to type c.

Parameters:
c -
inds -
Returns:

hasObviousPropertyValue

public Bool hasObviousPropertyValue(aterm.ATermAppl s,
                                    aterm.ATermAppl p,
                                    aterm.ATermAppl o)

hasObviousDataPropertyValue

public Bool hasObviousDataPropertyValue(aterm.ATermAppl s,
                                        aterm.ATermAppl p,
                                        java.lang.Object value)

hasObviousObjectPropertyValue

public Bool hasObviousObjectPropertyValue(aterm.ATermAppl s,
                                          aterm.ATermAppl p,
                                          aterm.ATermAppl o)

hasObviousObjectProperty

public Bool hasObviousObjectProperty(aterm.ATermAppl s,
                                     aterm.ATermAppl p)

hasProperty

public boolean hasProperty(aterm.ATermAppl s,
                           aterm.ATermAppl p)

hasPropertyValue

public boolean hasPropertyValue(aterm.ATermAppl s,
                                aterm.ATermAppl p,
                                aterm.ATermAppl o)

getPossibleProperties

public java.util.Set getPossibleProperties(aterm.ATermAppl s)

getObviousDataPropertyValues

public java.util.List getObviousDataPropertyValues(aterm.ATermAppl s,
                                                   Role prop,
                                                   Datatype datatype)

getObjectPropertyValues

public void getObjectPropertyValues(aterm.ATermAppl s,
                                    Role role,
                                    java.util.Set knowns,
                                    java.util.Set unknowns)

getSames

public void getSames(Individual ind,
                     java.util.Set knowns,
                     java.util.Set unknowns)

isConsistent

public boolean isConsistent()
Return true if this ABox is consistent. Consistent ABox means after applying all the tableau completion rules at least one branch with no clashes was found

Returns:

getInEdges

public EdgeList getInEdges(aterm.ATerm x)

getOutEdges

public EdgeList getOutEdges(aterm.ATerm x)

getIndividual

public Individual getIndividual(aterm.ATerm x)

getLiteral

public Literal getLiteral(aterm.ATerm x)

getNode

public Node getNode(aterm.ATerm x)

addType

public void addType(aterm.ATermAppl x,
                    aterm.ATermAppl c)

removeType

public void removeType(aterm.ATermAppl x,
                       aterm.ATermAppl c)

addLiteral

public Literal addLiteral()
Add a new literal to the ABox. This function is used only when the literal value does not have a known value, e.g. applyMinRule would create such a literal.

Returns:

addLiteral

public Literal addLiteral(aterm.ATermAppl dataValue)
Add a new literal to the ABox. Literal will be assigned a fresh unique name.

Parameters:
dataValue - A literal ATerm which should be constructed with one of ATermUtils.makeXXXLiteral functions
Returns:
Literal object that has been created

addIndividual

public Individual addIndividual(aterm.ATermAppl x)

addSame

public void addSame(aterm.ATermAppl x,
                    aterm.ATermAppl y)

addDifferent

public void addDifferent(aterm.ATermAppl x,
                         aterm.ATermAppl y)

isNode

public boolean isNode(aterm.ATerm x)

getNodes

public final java.util.Collection getNodes()

getNodeNames

public final java.util.List getNodeNames()

getIndIterator

public final org.mindswap.pellet.IndividualIterator getIndIterator()

getSingletonIterator

public final org.mindswap.pellet.IndividualIterator getSingletonIterator(Individual x)

toString

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

getDatatypeReasoner

public DatatypeReasoner getDatatypeReasoner()
Returns:
Returns the datatype reasoner.

isComplete

public boolean isComplete()
Returns:
Returns the isComplete.

isClosed

public boolean isClosed()
Returns true if Abox has a clash.

Returns:

getClash

public Clash getClash()

setClash

public void setClash(Clash clash)

getKB

public KnowledgeBase getKB()
Returns:
Returns the kb.

getRole

public Role getRole(aterm.ATerm r)
Convenience function to get the named role.


getRBox

public RBox getRBox()
Return the RBox


getTBox

public TBox getTBox()
Return the TBox


isInitialized

public boolean isInitialized()
Check if the ABox is ready to be completed.

Returns:
Returns the initialized.

setInitialized

public void setInitialized(boolean initialized)

doExplanation

public final boolean doExplanation()
Checks if the explanatino is turned on.

Returns:
Returns the doExplanation.

setDoExplanation

public void setDoExplanation(boolean doExplanation)
Enable/disable explanation generation

Parameters:
doExplanation - The doExplanation to set.

getExplanation

public java.lang.String getExplanation()

getBranches

public java.util.List getBranches()
Returns the branches.


validate

public void validate()
Validate all the edges in the ABox nodes. Used to find bugs in the copy and detach/attach functions.


printTree

public void printTree()
Print the ABox as a completion tree (child nodes are indented).


getLastClash

public Clash getLastClash()

getLastCompletion

public ABox getLastCompletion()

isKeepLastCompletion

public boolean isKeepLastCompletion()

setKeepLastCompletion

public void setKeepLastCompletion(boolean keepLastCompletion)

getPseudoModel

public ABox getPseudoModel()

size

public int size()
Return the number of nodes in the ABox. This number includes both the individuals and the literals.

Returns:

isEmpty

public boolean isEmpty()
Returns true if there are no individuals in the ABox.

Returns:


Copyright © 2007-2009 Natalya Keberle. All Rights Reserved.