org.mindswap.pellet
Class KnowledgeBase

java.lang.Object
  extended by org.mindswap.pellet.KnowledgeBase
Direct Known Subclasses:
EconnectedKB

public class KnowledgeBase
extends java.lang.Object

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

Field Summary
 java.util.HashMap constructedOWL
           
static boolean DEBUG
          Deprecated. Edit log4j.properties to turn on debugging
 boolean flagOWLT
           
 Timers timers
          Timers used in various different parts fo KB.
 IntMap ts
           
 java.util.HashMap ts2onto
           
 
Constructor Summary
KnowledgeBase()
           
KnowledgeBase(KnowledgeBase kb)
          Create a KB based on an existing one.
 
Method Summary
 void addAnnotationProperty(aterm.ATermAppl p)
           
 void addClass(aterm.ATermAppl c)
           
 void addComplementClass(aterm.ATerm c1, aterm.ATerm c2)
           
 void addDataPropertyValue(aterm.ATermAppl p, aterm.ATermAppl s, aterm.ATermAppl o)
          Deprecated. Use addPropertyValue instead
 void addDataRange(java.lang.String datatypeURI, aterm.ATermList values)
           
 void addDatatype(aterm.ATerm p)
           
 boolean addDatatypeProperty(aterm.ATerm p)
          Add a new object property.
 void addDifferent(aterm.ATermAppl i1, aterm.ATermAppl i2)
           
 void addDisjointClass(aterm.ATerm c1, aterm.ATerm c2)
           
 void addDomain(aterm.ATerm p, aterm.ATermAppl c)
           
 void addEquivalentClass(aterm.ATermAppl c1, aterm.ATermAppl c2)
           
 void addEquivalentProperty(aterm.ATermAppl p1, aterm.ATermAppl p2)
           
 void addFunctionalProperty(aterm.ATermAppl p)
           
 Individual addIndividual(aterm.ATermAppl i)
           
 void addInverseFunctionalProperty(aterm.ATerm p)
           
 void addInverseProperty(aterm.ATermAppl p1, aterm.ATermAppl p2)
           
 boolean addObjectProperty(aterm.ATerm p)
          Add a new object property.
 void addObjectPropertyValue(aterm.ATermAppl p, aterm.ATermAppl s, aterm.ATermAppl o)
          Deprecated. Use addPropertyValue instead
 void addOntologyProperty(aterm.ATermAppl p)
           
 void addProperty(aterm.ATermAppl p)
           
 boolean addPropertyValue(aterm.ATermAppl p, aterm.ATermAppl s, aterm.ATermAppl o)
           
 void addRange(aterm.ATerm p, aterm.ATermAppl c)
           
 void addSame(aterm.ATermAppl i1, aterm.ATermAppl i2)
           
 void addSameClass(aterm.ATermAppl c1, aterm.ATermAppl c2)
          Deprecated. Use addEquivalentClass(ATermAppl, ATermAppl) instead
 void addSameProperty(aterm.ATermAppl p1, aterm.ATermAppl p2)
          Deprecated. Use addEquivalentClass(ATermAppl, ATermAppl) instead
 void addSubClass(aterm.ATermAppl c1, aterm.ATermAppl c2)
           
 void addSubProperty(aterm.ATermAppl p1, aterm.ATermAppl p2)
           
 void addSymmetricProperty(aterm.ATermAppl p)
           
 void addTransitiveProperty(aterm.ATermAppl p)
           
 void addType(aterm.ATermAppl i, aterm.ATermAppl c)
           
 void binaryInstanceRetrieval(aterm.ATermAppl c, java.util.List candidates, java.util.Collection results)
           
 void classify()
           
 void clear()
           
 KnowledgeBase copy()
           
 boolean doExplanation()
           
 void ensureConsistency()
           
 ABox getABox()
           
 java.util.Set getAllClasses()
          Return the set of all named classes including TOP and BOTTOM.
 java.util.Set getAllEquivalentClasses(aterm.ATermAppl c)
          Returns all the classes that are equivalent to class c, including c itself.
 java.util.Set getAllEquivalentProperties(aterm.ATermAppl prop)
           
 java.util.Set getAllSames(aterm.ATermAppl name)
          Return all the indviduals asserted to be equal to the given individual inluding the individual itself.
 java.util.Set getClasses()
          Return the set of all named classes.
 java.util.Set getComplements(aterm.ATermAppl c)
           
 java.util.Set getDataProperties()
          Return the set of all object properties.
 java.util.List getDataPropertyValues(aterm.ATermAppl r, aterm.ATermAppl x)
          Return all literal values for a given dataproperty and subject value.
 java.util.List getDataPropertyValues(aterm.ATermAppl r, aterm.ATermAppl x, Datatype datatype)
          Return all literal values for a given dataproperty that belongs to the specified datatype.
 java.util.List getDataPropertyValues(aterm.ATermAppl r, aterm.ATermAppl x, java.lang.String lang)
          Return all literal values for a given dataproperty that has the specified language identifier.
 DatatypeReasoner getDatatypeReasoner()
           
 java.util.Set getDisjoints(aterm.ATermAppl c)
           
 boolean getDoDependencyAxioms()
           
 java.util.Set getDomains(aterm.ATermAppl name)
          Return the (explicit or implicit) domain restrictions on the property.
 java.util.Set getEquivalentClasses(aterm.ATermAppl c)
          Returns all the classes that are equivalent to class c, excluding c itself.
 java.util.Set getEquivalentProperties(aterm.ATermAppl prop)
          Return all the properties that are equivalent to p.
 java.lang.String getExplanation()
           
 java.util.Set getExplanationSet()
           
 Expressivity getExpressivity()
           
 boolean getFlagOWLT()
           
 java.util.Set getFunctionalProperties()
           
 java.util.Set getIndividuals()
          Return the set of all individuals.
 java.util.List getIndividualsWithDataProperty(aterm.ATermAppl r, aterm.ATermAppl litValue)
          List all subjects with the given literal value for the specified data property.
 java.util.List getIndividualsWithObjectProperty(aterm.ATermAppl r, aterm.ATermAppl o)
          List all subjects with the given value for the specified object property.
 java.util.List getIndividualsWithProperty(aterm.ATermAppl r, aterm.ATermAppl x)
          List all subjects with a given property and property value.
 java.lang.String getInfo()
           
 java.util.Set getInstances(aterm.ATermAppl c)
          Returns all the instances of concept c.
 java.util.Set getInstances(aterm.ATermAppl c, boolean direct)
          Returns the instances of class c.
 java.util.Set getInverseFunctionalProperties()
           
 java.util.Set getInverses(aterm.ATerm name)
          Return the inverse property and all its equivalent properties.
 java.util.Set getObjectProperties()
          Return the set of all object properties.
 java.util.List getObjectPropertyValues(aterm.ATermAppl r, aterm.ATermAppl x)
          Return all property values for a given object property and subject value.
 java.lang.String getOntology()
          Returns the URI of the ontology this KB belongs to.
 java.util.Set getPossibleProperties(aterm.ATermAppl x)
           
 java.util.Set getProperties()
          Return the set of all properties.
 java.util.List getProperties(aterm.ATermAppl s, aterm.ATermAppl o)
          List all properties asserted between a subject and object.
 Role getProperty(aterm.ATerm r)
           
 int getPropertyType(aterm.ATerm r)
           
 java.util.Map getPropertyValues(aterm.ATermAppl pred)
           
 java.util.List getPropertyValues(aterm.ATermAppl r, aterm.ATermAppl x)
          Return all property values for a given property and subject value.
 java.util.Set getRanges(aterm.ATerm name)
          Return the (explicit or implicit) range restrictions on the property.
 RBox getRBox()
           
 Taxonomy getRoleTaxonomy()
           
 java.util.Set getRules()
           
 java.util.Set getSames(aterm.ATermAppl name)
          Return all the indviduals asserted to be equal to the given individual but not the the individual itself.
 SizeEstimate getSizeEstimate()
           
 java.util.Set getSubClasses(aterm.ATermAppl c)
          Returns all the (named) subclasses of class c.
 java.util.Set getSubClasses(aterm.ATermAppl c, boolean direct)
          Returns the (named) subclasses of class c.
 java.util.Set getSubProperties(aterm.ATermAppl prop)
          Return all the sub properties of p.
 java.util.Set getSubProperties(aterm.ATermAppl prop, boolean direct)
          Return the sub properties of p.
 java.util.Set getSuperClasses(aterm.ATermAppl c)
          Returns all the superclasses (implicitly or explicitly defined) of class c.
 java.util.Set getSuperClasses(aterm.ATermAppl c, boolean direct)
          Returns the (named) superclasses of class c.
 java.util.Set getSuperProperties(aterm.ATermAppl prop)
          Return all the super properties of p.
 java.util.Set getSuperProperties(aterm.ATermAppl prop, boolean direct)
          Return the super properties of p.
 java.util.Set getSymmetricProperties()
           
 Taxonomy getTaxonomy()
          Get the classification results.
 TaxonomyBuilder getTaxonomyBuilder()
           
 TBox getTBox()
           
 java.util.Set getTransitiveProperties()
           
 IntMap getTS()
           
 java.util.Map getTS2Onto()
           
 aterm.ATermAppl getType(aterm.ATermAppl ind)
           
 aterm.ATermAppl getType(aterm.ATermAppl ind, boolean direct)
           
 java.util.Set getTypes(aterm.ATermAppl ind)
          Get all the (named) classes individual belongs to.
 java.util.Set getTypes(aterm.ATermAppl ind, boolean direct)
          Returns the (named) classes individual belongs to.
 boolean hasDomain(aterm.ATermAppl p, aterm.ATermAppl c)
           
 boolean hasInstance(aterm.ATerm d)
          Returns true if there is at leaat one individual that belongs to the given class
 Bool hasKnownPropertyValue(aterm.ATermAppl s, aterm.ATermAppl p, aterm.ATermAppl o)
          Answers the hasPropertyValue question without doing any satisfiability check.
 boolean hasPropertyValue(aterm.ATermAppl s, aterm.ATermAppl p, aterm.ATermAppl o)
           
 boolean hasRange(aterm.ATermAppl p, aterm.ATermAppl c)
           
 boolean isABoxChanged()
           
 boolean isABoxProperty(aterm.ATerm p)
           
 boolean isAnnotationProperty(aterm.ATerm p)
           
 boolean isChanged()
           
 boolean isClass(aterm.ATerm c)
           
 boolean isClassified()
          Returns true if the classification check has been done and nothing in th KB has changed after that.
 boolean isComplement(aterm.ATermAppl c1, aterm.ATermAppl c2)
           
 boolean isConsistencyDone()
          Returns true if the consistency check has been done and nothing in th KB has changed after that.
 boolean isConsistent()
           
 boolean isDatatype(aterm.ATerm p)
           
 boolean isDatatype(aterm.ATermAppl c)
           
 boolean isDatatypeProperty(aterm.ATerm p)
           
 boolean isDifferentFrom(aterm.ATermAppl t1, aterm.ATermAppl t2)
           
 boolean isDisjoint(aterm.ATermAppl c1, aterm.ATermAppl c2)
           
 boolean isEquivalentClass(aterm.ATermAppl c1, aterm.ATermAppl c2)
          Check if class c1 is equivalent to class c2.
 boolean isEquivalentProperty(aterm.ATermAppl p1, aterm.ATermAppl p2)
           
 boolean isFunctionalProperty(aterm.ATermAppl p)
           
 boolean isIndividual(aterm.ATerm ind)
           
 boolean isInverse(aterm.ATermAppl r1, aterm.ATermAppl r2)
           
 boolean isInverseFunctionalProperty(aterm.ATermAppl p)
           
 Bool isKnownType(aterm.ATermAppl x, aterm.ATermAppl c)
          Answers the isType question without doing any satisfiability check.
 boolean isObjectProperty(aterm.ATerm p)
           
 boolean isOntologyProperty(aterm.ATerm p)
           
 boolean isProperty(aterm.ATerm p)
           
 boolean isRBoxChanged()
           
 boolean isRealized()
           
 boolean isSameAs(aterm.ATermAppl t1, aterm.ATermAppl t2)
           
 boolean isSatisfiable(aterm.ATermAppl c)
           
 boolean isSubclassOf(aterm.ATermAppl c1, aterm.ATermAppl c2)
          Deprecated. As of Pellet 1.1.1, replaced by isSubClassOf(ATermAppl,ATermAppl)
 boolean isSubClassOf(aterm.ATermAppl c1, aterm.ATermAppl c2)
          Check if class c1 is subclass of class c2.
 boolean isSubPropertyOf(aterm.ATermAppl sub, aterm.ATermAppl sup)
           
 boolean isSubTypeOf(aterm.ATermAppl d1, aterm.ATermAppl d2)
           
 boolean isSymmetricProperty(aterm.ATermAppl p)
           
 boolean isTBoxChanged()
           
 boolean isTransitiveProperty(aterm.ATermAppl r)
           
 boolean isType(aterm.ATermAppl x, aterm.ATermAppl c)
           
 void loadDatatype(aterm.ATerm p)
           
 void loadKRSS(java.io.Reader reader)
           
 void prepare()
           
 void printClassTree()
          Print the class hierarchy on the standard output.
 void printClassTree(OutputFormatter out)
           
 void realize()
           
 boolean removeObjectPropertyValue(aterm.ATermAppl p, aterm.ATermAppl i1, aterm.ATermAppl i2)
           
 void removeType(aterm.ATermAppl ind, aterm.ATermAppl c)
           
 java.util.List retrieve(aterm.ATermAppl d, java.util.Collection individuals)
          Return all the indiviuals that belong to the given class which is not necessarily a named class.
 java.util.List retrieveIndividualsWithProperty(aterm.ATermAppl r)
           
 QueryResults runQuery(java.lang.String queryStr)
          Deprecated. Use QueryEngine.exec methods instead
 void setDoDependencyAxioms(boolean doDepAxioms)
           
 void setDoExplanation(boolean doExplanation)
           
 void setOntology(java.lang.String ontology)
          Set the URI of the ontology this Kb belongs to.
 void setRBox(RBox rbox)
           
 void setRules(java.util.Set rules)
           
 void setTBox(TBox tbox)
           
 void setTimeout(long timeout)
          Set a timeout for the main timer.
 void setTS(IntMap ts)
           
 void setTS2Onto(java.util.HashMap ts2onto)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

public static boolean DEBUG
Deprecated. Edit log4j.properties to turn on debugging

flagOWLT

public boolean flagOWLT

timers

public Timers timers
Timers used in various different parts fo KB. There may be many different timers created here depending on the level of debugging or application requirements. However, there are three major timers that are guaranteed to exist.


ts

public IntMap ts

ts2onto

public java.util.HashMap ts2onto

constructedOWL

public java.util.HashMap constructedOWL
Constructor Detail

KnowledgeBase

public KnowledgeBase()

KnowledgeBase

public KnowledgeBase(KnowledgeBase kb)
Create a KB based on an existing one. New KB has a copy of the ABox but TBox and RBox is shared between two.

Parameters:
kb -
Method Detail

getExpressivity

public Expressivity getExpressivity()

clear

public void clear()

copy

public KnowledgeBase copy()

loadKRSS

public void loadKRSS(java.io.Reader reader)
              throws java.io.IOException
Throws:
java.io.IOException

addClass

public void addClass(aterm.ATermAppl c)

addSubClass

public void addSubClass(aterm.ATermAppl c1,
                        aterm.ATermAppl c2)

addSameClass

public void addSameClass(aterm.ATermAppl c1,
                         aterm.ATermAppl c2)
Deprecated. Use addEquivalentClass(ATermAppl, ATermAppl) instead


addEquivalentClass

public void addEquivalentClass(aterm.ATermAppl c1,
                               aterm.ATermAppl c2)

addDisjointClass

public void addDisjointClass(aterm.ATerm c1,
                             aterm.ATerm c2)

addComplementClass

public void addComplementClass(aterm.ATerm c1,
                               aterm.ATerm c2)

addDataPropertyValue

public void addDataPropertyValue(aterm.ATermAppl p,
                                 aterm.ATermAppl s,
                                 aterm.ATermAppl o)
Deprecated. Use addPropertyValue instead

Add the value of a DatatypeProperty.

Parameters:
p - Datatype Property
ind - Individual value being added to
literalValue - A literal ATerm which should be constructed with one of ATermUtils.makeXXXLiteral functions

addIndividual

public Individual addIndividual(aterm.ATermAppl i)

addType

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

addSame

public void addSame(aterm.ATermAppl i1,
                    aterm.ATermAppl i2)

addDifferent

public void addDifferent(aterm.ATermAppl i1,
                         aterm.ATermAppl i2)

addObjectPropertyValue

public void addObjectPropertyValue(aterm.ATermAppl p,
                                   aterm.ATermAppl s,
                                   aterm.ATermAppl o)
Deprecated. Use addPropertyValue instead


addPropertyValue

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

addProperty

public void addProperty(aterm.ATermAppl p)

addObjectProperty

public boolean addObjectProperty(aterm.ATerm p)
Add a new object property. If property was earlier defined to be a datatype property then this function will simply return without changing the KB.

Parameters:
p - Name of the property
Returns:
True if property is added, false if not

addDatatypeProperty

public boolean addDatatypeProperty(aterm.ATerm p)
Add a new object property. If property was earlier defined to be a datatype property then this function will simply return without changing the KB.

Parameters:
p -
Returns:
True if property is added, false if not

addOntologyProperty

public void addOntologyProperty(aterm.ATermAppl p)

addAnnotationProperty

public void addAnnotationProperty(aterm.ATermAppl p)

addSubProperty

public void addSubProperty(aterm.ATermAppl p1,
                           aterm.ATermAppl p2)

addSameProperty

public void addSameProperty(aterm.ATermAppl p1,
                            aterm.ATermAppl p2)
Deprecated. Use addEquivalentClass(ATermAppl, ATermAppl) instead


addEquivalentProperty

public void addEquivalentProperty(aterm.ATermAppl p1,
                                  aterm.ATermAppl p2)

addInverseProperty

public void addInverseProperty(aterm.ATermAppl p1,
                               aterm.ATermAppl p2)

addTransitiveProperty

public void addTransitiveProperty(aterm.ATermAppl p)

addSymmetricProperty

public void addSymmetricProperty(aterm.ATermAppl p)

addFunctionalProperty

public void addFunctionalProperty(aterm.ATermAppl p)

addInverseFunctionalProperty

public void addInverseFunctionalProperty(aterm.ATerm p)

addDomain

public void addDomain(aterm.ATerm p,
                      aterm.ATermAppl c)

addRange

public void addRange(aterm.ATerm p,
                     aterm.ATermAppl c)

setTS

public void setTS(IntMap ts)

setTS2Onto

public void setTS2Onto(java.util.HashMap ts2onto)

getTS

public IntMap getTS()

getTS2Onto

public java.util.Map getTS2Onto()

getFlagOWLT

public boolean getFlagOWLT()

isDatatype

public boolean isDatatype(aterm.ATerm p)

addDatatype

public void addDatatype(aterm.ATerm p)

loadDatatype

public void loadDatatype(aterm.ATerm p)

addDataRange

public void addDataRange(java.lang.String datatypeURI,
                         aterm.ATermList values)

removeObjectPropertyValue

public boolean removeObjectPropertyValue(aterm.ATermAppl p,
                                         aterm.ATermAppl i1,
                                         aterm.ATermAppl i2)

removeType

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

prepare

public void prepare()

getInfo

public java.lang.String getInfo()

isConsistencyDone

public boolean isConsistencyDone()
Returns true if the consistency check has been done and nothing in th KB has changed after that.


isClassified

public boolean isClassified()
Returns true if the classification check has been done and nothing in th KB has changed after that.


isRealized

public boolean isRealized()

isChanged

public boolean isChanged()

isTBoxChanged

public boolean isTBoxChanged()

isRBoxChanged

public boolean isRBoxChanged()

isABoxChanged

public boolean isABoxChanged()

isConsistent

public boolean isConsistent()

ensureConsistency

public void ensureConsistency()

classify

public void classify()

realize

public void realize()

getClasses

public java.util.Set getClasses()
Return the set of all named classes. Returned set is unmodifiable!

Returns:

getAllClasses

public java.util.Set getAllClasses()
Return the set of all named classes including TOP and BOTTOM. Returned set is modifiable.

Returns:

getProperties

public java.util.Set getProperties()
Return the set of all properties.

Returns:

getObjectProperties

public java.util.Set getObjectProperties()
Return the set of all object properties.

Returns:

getTransitiveProperties

public java.util.Set getTransitiveProperties()

getSymmetricProperties

public java.util.Set getSymmetricProperties()

getFunctionalProperties

public java.util.Set getFunctionalProperties()

getInverseFunctionalProperties

public java.util.Set getInverseFunctionalProperties()

getDataProperties

public java.util.Set getDataProperties()
Return the set of all object properties.

Returns:

getIndividuals

public java.util.Set getIndividuals()
Return the set of all individuals. Returned set is unmodifiable!

Returns:

getProperty

public Role getProperty(aterm.ATerm r)

getPropertyType

public int getPropertyType(aterm.ATerm r)

isClass

public boolean isClass(aterm.ATerm c)

isProperty

public boolean isProperty(aterm.ATerm p)

isDatatypeProperty

public boolean isDatatypeProperty(aterm.ATerm p)

isObjectProperty

public boolean isObjectProperty(aterm.ATerm p)

isABoxProperty

public boolean isABoxProperty(aterm.ATerm p)

isAnnotationProperty

public boolean isAnnotationProperty(aterm.ATerm p)

isOntologyProperty

public boolean isOntologyProperty(aterm.ATerm p)

isIndividual

public boolean isIndividual(aterm.ATerm ind)

isTransitiveProperty

public boolean isTransitiveProperty(aterm.ATermAppl r)

isSymmetricProperty

public boolean isSymmetricProperty(aterm.ATermAppl p)

isFunctionalProperty

public boolean isFunctionalProperty(aterm.ATermAppl p)

isInverseFunctionalProperty

public boolean isInverseFunctionalProperty(aterm.ATermAppl p)

isSubPropertyOf

public boolean isSubPropertyOf(aterm.ATermAppl sub,
                               aterm.ATermAppl sup)

isEquivalentProperty

public boolean isEquivalentProperty(aterm.ATermAppl p1,
                                    aterm.ATermAppl p2)

isInverse

public boolean isInverse(aterm.ATermAppl r1,
                         aterm.ATermAppl r2)

hasDomain

public boolean hasDomain(aterm.ATermAppl p,
                         aterm.ATermAppl c)

hasRange

public boolean hasRange(aterm.ATermAppl p,
                        aterm.ATermAppl c)

isDatatype

public boolean isDatatype(aterm.ATermAppl c)

isSatisfiable

public boolean isSatisfiable(aterm.ATermAppl c)

hasInstance

public boolean hasInstance(aterm.ATerm d)
Returns true if there is at leaat one individual that belongs to the given class

Parameters:
c -
Returns:

isSubTypeOf

public boolean isSubTypeOf(aterm.ATermAppl d1,
                           aterm.ATermAppl d2)

isSubClassOf

public boolean isSubClassOf(aterm.ATermAppl c1,
                            aterm.ATermAppl c2)
Check if class c1 is subclass of class c2.

Parameters:
c1 -
c2 -
Returns:

isSubclassOf

public boolean isSubclassOf(aterm.ATermAppl c1,
                            aterm.ATermAppl c2)
Deprecated. As of Pellet 1.1.1, replaced by isSubClassOf(ATermAppl,ATermAppl)


isEquivalentClass

public boolean isEquivalentClass(aterm.ATermAppl c1,
                                 aterm.ATermAppl c2)
Check if class c1 is equivalent to class c2.

Parameters:
c1 -
c2 -
Returns:

isDisjoint

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

isComplement

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

isKnownType

public Bool isKnownType(aterm.ATermAppl x,
                        aterm.ATermAppl c)
Answers the isType question without doing any satisfiability check. It might return Bool.TRUE, Bool.FALSE, or Bool.UNKNOWN. If Bool.UNKNOWN is returned isType function needs to be called to get the answer.

Parameters:
x -
c -
Returns:

isType

public boolean isType(aterm.ATermAppl x,
                      aterm.ATermAppl c)

isSameAs

public boolean isSameAs(aterm.ATermAppl t1,
                        aterm.ATermAppl t2)

isDifferentFrom

public boolean isDifferentFrom(aterm.ATermAppl t1,
                               aterm.ATermAppl t2)

hasPropertyValue

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

hasKnownPropertyValue

public Bool hasKnownPropertyValue(aterm.ATermAppl s,
                                  aterm.ATermAppl p,
                                  aterm.ATermAppl o)
Answers the hasPropertyValue question without doing any satisfiability check. It might return Boolean.TRUE, Boolean.FALSE, or null (unknown). If the null value is returned hasPropertyValue function needs to be called to get the answer.

Parameters:
s - Subject
p - Predicate
o - Object (null can be used as wildcard)
Returns:

getABox

public ABox getABox()
Returns:
Returns the abox.

getRBox

public RBox getRBox()
Returns:
Returns the rbox.

getTBox

public TBox getTBox()
Returns:
Returns the tbox.

getDatatypeReasoner

public DatatypeReasoner getDatatypeReasoner()
Returns:
Returns the DatatypeReasoner

getSuperClasses

public java.util.Set getSuperClasses(aterm.ATermAppl c,
                                     boolean direct)
Returns the (named) superclasses of class c. Depending onthe second parameter the resulting list will include etiher all or only the direct superclasses. A class d is a direct superclass of c iff
  1. d is superclass of c
  2. there is no other class x such that x is superclass of c and d is superclass of x
The class c itself is not included in the list but all the other classes that are sameAs c are put into the list. Also note that the returned list will always have at least one element. The list will either include one other concept from the hierachy or the TOP concept if no other class subsumes c. By definition TOP concept is superclass of every concept.

*** This function will first classify the whole ontology ***

Parameters:
c - class whose superclasses are returned
Returns:
A set of sets, where each set in the collection represents an equivalence class. The elements of the inner class are ATermAppl objects.

getSubClasses

public java.util.Set getSubClasses(aterm.ATermAppl c)
Returns all the (named) subclasses of class c. The class c itself is not included in the list but all the other classes that are equivalent to c are put into the list. Also note that the returned list will always have at least one element, that is the BOTTOM concept. By definition BOTTOM concept is subclass of every concept. This function is equivalent to calling getSubClasses(c, true).

*** This function will first classify the whole ontology ***

Parameters:
c - class whose subclasses are returned
Returns:
A set of sets, where each set in the collection represents an equivalence class. The elements of the inner class are ATermAppl objects.

getDisjoints

public java.util.Set getDisjoints(aterm.ATermAppl c)

getComplements

public java.util.Set getComplements(aterm.ATermAppl c)

getTypes

public java.util.Set getTypes(aterm.ATermAppl ind,
                              boolean direct)
Returns the (named) classes individual belongs to. Depending on the second parameter the result will include either all types or only the direct types.

Parameters:
ind - An individual name
direct - If true return only the direct types, otherwise return all types
Returns:
A set of sets, where each set in the collection represents an equivalence class. The elements of the inner class are ATermAppl objects.

getTypes

public java.util.Set getTypes(aterm.ATermAppl ind)
Get all the (named) classes individual belongs to.

*** This function will first realize the whole ontology ***

Parameters:
ind - An individual name
Returns:
A set of sets, where each set in the collection represents an equivalence class. The elements of the inner class are ATermAppl objects.

getType

public aterm.ATermAppl getType(aterm.ATermAppl ind)

getType

public aterm.ATermAppl getType(aterm.ATermAppl ind,
                               boolean direct)

getInstances

public java.util.Set getInstances(aterm.ATermAppl c)
Returns all the instances of concept c. If TOP concept is used every individual in the knowledge base will be returned

Parameters:
c - class whose instanceses are returned
Returns:
A set of ATerm objects

getInstances

public java.util.Set getInstances(aterm.ATermAppl c,
                                  boolean direct)
Returns the instances of class c. Depending on the second parameter the resulting list will include all or only the direct instances. An individual x is a direct instance of c iff x is of type c and there is no subclass d of c such that x is of type d.

*** This function will first realize the whole ontology ***

Parameters:
c - class whose instances are returned
direct - if true return only the direct instances, otherwise return all the instances
Returns:
A set of ATerm objects

getEquivalentClasses

public java.util.Set getEquivalentClasses(aterm.ATermAppl c)
Returns all the classes that are equivalent to class c, excluding c itself.

*** This function will first classify the whole ontology ***

Parameters:
c - class whose equivalent classes are found
Returns:
A set of ATerm objects

getAllEquivalentClasses

public java.util.Set getAllEquivalentClasses(aterm.ATermAppl c)
Returns all the classes that are equivalent to class c, including c itself.

*** This function will first classify the whole ontology ***

Parameters:
c - class whose equivalent classes are found
Returns:
A set of ATerm objects

getSuperClasses

public java.util.Set getSuperClasses(aterm.ATermAppl c)
Returns all the superclasses (implicitly or explicitly defined) of class c. The class c itself is not included in the list. but all the other classes that are sameAs c are put into the list. Also note that the returned list will always have at least one element, that is TOP concept. By definition TOP concept is superclass of every concept. This function is equivalent to calling getSuperClasses(c, true).

*** This function will first classify the whole ontology ***

Parameters:
c - class whose superclasses are returned
Returns:
A set of sets, where each set in the collection represents an equivalence class. The elements of the inner class are ATermAppl objects.

getSubClasses

public java.util.Set getSubClasses(aterm.ATermAppl c,
                                   boolean direct)
Returns the (named) subclasses of class c. Depending onthe second parameter the result will include either all subclasses or only the direct subclasses. A class d is a direct subclass of c iff
  1. d is subclass of c
  2. there is no other class x different from c and d such that x is subclass of c and d is subclass of x
The class c itself is not included in the list but all the other classes that are sameAs c are put into the list. Also note that the returned list will always have at least one element. The list will either include one other concept from the hierachy or the BOTTOM concept if no other class is subsumed by c. By definition BOTTOM concept is subclass of every concept.

*** This function will first classify the whole ontology ***

Parameters:
c - class whose subclasses are returned
direct - If true return only the direct subclasses, otherwise return all the subclasses
Returns:
A set of sets, where each set in the collection represents an equivalence class. The elements of the inner class are ATermAppl objects.

getSuperProperties

public java.util.Set getSuperProperties(aterm.ATermAppl prop)
Return all the super properties of p.

Parameters:
prop -
Returns:
A set of sets, where each set in the collection represents a set of equivalent properties. The elements of the inner class are Role objects.

getSuperProperties

public java.util.Set getSuperProperties(aterm.ATermAppl prop,
                                        boolean direct)
Return the super properties of p. Depending on the second parameter the result will include either all super properties or only the direct super properties.

Parameters:
prop -
direct - If true return only the direct super properties, otherwise return all the super properties
Returns:
A set of sets, where each set in the collection represents a set of equivalent properties. The elements of the inner class are Role objects.

getSubProperties

public java.util.Set getSubProperties(aterm.ATermAppl prop)
Return all the sub properties of p.

Parameters:
prop -
Returns:
A set of sets, where each set in the collection represents a set of equivalent properties. The elements of the inner class are ATermAppl objects.

getSubProperties

public java.util.Set getSubProperties(aterm.ATermAppl prop,
                                      boolean direct)
Return the sub properties of p. Depending on the second parameter the result will include either all subproperties or only the direct subproperties.

Parameters:
prop -
direct - If true return only the direct subproperties, otherwise return all the subproperties
Returns:
A set of sets, where each set in the collection represents a set of equivalent properties. The elements of the inner class are ATermAppl objects.

getEquivalentProperties

public java.util.Set getEquivalentProperties(aterm.ATermAppl prop)
Return all the properties that are equivalent to p.

Parameters:
prop -
Returns:
A set of ATermAppl objects.

getAllEquivalentProperties

public java.util.Set getAllEquivalentProperties(aterm.ATermAppl prop)

getInverses

public java.util.Set getInverses(aterm.ATerm name)
Return the inverse property and all its equivalent properties.

Parameters:
prop -
Returns:

getDomains

public java.util.Set getDomains(aterm.ATermAppl name)
Return the (explicit or implicit) domain restrictions on the property. Unlike other functions the result may contain unnamed classes (represented as ATerm objects). If the domain is an intersection then all the elements of the intersection will be included in the resulting set.

Parameters:
prop -
Returns:

getRanges

public java.util.Set getRanges(aterm.ATerm name)
Return the (explicit or implicit) range restrictions on the property. Unlike other functions the result may contain unnamed classes (represented as ATerm objects). If the range is an intersection then all the elements of the intersection will be included in the resulting set.

Parameters:
prop -
Returns:

getAllSames

public java.util.Set getAllSames(aterm.ATermAppl name)
Return all the indviduals asserted to be equal to the given individual inluding the individual itself.

Parameters:
name -
Returns:

getSames

public java.util.Set getSames(aterm.ATermAppl name)
Return all the indviduals asserted to be equal to the given individual but not the the individual itself.

Parameters:
name -
Returns:

runQuery

public QueryResults runQuery(java.lang.String queryStr)
Deprecated. Use QueryEngine.exec methods instead

Run the given RDQL query.

Parameters:
query -
Returns:

getDataPropertyValues

public java.util.List getDataPropertyValues(aterm.ATermAppl r,
                                            aterm.ATermAppl x,
                                            Datatype datatype)
Return all literal values for a given dataproperty that belongs to the specified datatype.

Parameters:
r -
x -
lang -
Returns:
List of ATermAppl objects representing literals. These objects are in the form literal(value, lang, datatypeURI).

getPossibleProperties

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

getDataPropertyValues

public java.util.List getDataPropertyValues(aterm.ATermAppl r,
                                            aterm.ATermAppl x,
                                            java.lang.String lang)
Return all literal values for a given dataproperty that has the specified language identifier.

Parameters:
r -
x -
lang -
Returns:
List of ATermAppl objects.

getDataPropertyValues

public java.util.List getDataPropertyValues(aterm.ATermAppl r,
                                            aterm.ATermAppl x)
Return all literal values for a given dataproperty and subject value.

Parameters:
r -
x -
Returns:
List of ATermAppl objects.

getObjectPropertyValues

public java.util.List getObjectPropertyValues(aterm.ATermAppl r,
                                              aterm.ATermAppl x)
Return all property values for a given object property and subject value.

Parameters:
r -
x -
Returns:
A list of ATermAppl objects

getPropertyValues

public java.util.List getPropertyValues(aterm.ATermAppl r,
                                        aterm.ATermAppl x)
Return all property values for a given property and subject value.

Parameters:
r -
x -
Returns:
List of ATermAppl objects.

getIndividualsWithProperty

public java.util.List getIndividualsWithProperty(aterm.ATermAppl r,
                                                 aterm.ATermAppl x)
List all subjects with a given property and property value.

Parameters:
r -
x - If property is an object property an ATermAppl object that is the URI of the individual, if the property is a data property an ATerm object that contains the literal value (See {#link #getIndividualsWithDataProperty(ATermAppl, ATermAppl)} for details)
Returns:
List of ATermAppl objects.

getIndividualsWithDataProperty

public java.util.List getIndividualsWithDataProperty(aterm.ATermAppl r,
                                                     aterm.ATermAppl litValue)
List all subjects with the given literal value for the specified data property.

Parameters:
r - An ATerm object that contains the literal value in the form literal(lexicalValue, langIdentifier, datatypeURI). Should be created with ATermUtils.makeXXXLiteral() functions.
x -
Returns:
List of ATermAppl objects.

getIndividualsWithObjectProperty

public java.util.List getIndividualsWithObjectProperty(aterm.ATermAppl r,
                                                       aterm.ATermAppl o)
List all subjects with the given value for the specified object property.

Parameters:
r -
o - An ATerm object that is the URI of an individual
Returns:
List of ATermAppl objects.

getProperties

public java.util.List getProperties(aterm.ATermAppl s,
                                    aterm.ATermAppl o)
List all properties asserted between a subject and object.


getPropertyValues

public java.util.Map getPropertyValues(aterm.ATermAppl pred)

retrieve

public java.util.List retrieve(aterm.ATermAppl d,
                               java.util.Collection individuals)
Return all the indiviuals that belong to the given class which is not necessarily a named class.

Parameters:
d -
Returns:

retrieveIndividualsWithProperty

public java.util.List retrieveIndividualsWithProperty(aterm.ATermAppl r)

binaryInstanceRetrieval

public void binaryInstanceRetrieval(aterm.ATermAppl c,
                                    java.util.List candidates,
                                    java.util.Collection results)

printClassTree

public void printClassTree()
Print the class hierarchy on the standard output.


printClassTree

public void printClassTree(OutputFormatter out)

doExplanation

public boolean doExplanation()

setDoExplanation

public void setDoExplanation(boolean doExplanation)
Parameters:
doExplanation - The doExplanation to set.

getExplanation

public java.lang.String getExplanation()

setDoDependencyAxioms

public void setDoDependencyAxioms(boolean doDepAxioms)

getDoDependencyAxioms

public boolean getDoDependencyAxioms()

getExplanationSet

public java.util.Set getExplanationSet()

setRBox

public void setRBox(RBox rbox)
Parameters:
rbox - The rbox to set.

setTBox

public void setTBox(TBox tbox)
Parameters:
tbox - The tbox to set.

getOntology

public java.lang.String getOntology()
Returns the URI of the ontology this KB belongs to. A KB is not always guaranteed to have this value because 1) Parser does not always know the URI of the onotlogy (i.e. Jena models) 2) Multiple ontologies may be loaded to the same KB (in this case this value may return one of the ontologies arbitrarily) This value has no siginificance in reasoning except for EconnectedKB's.

Returns:

setOntology

public void setOntology(java.lang.String ontology)
Set the URI of the ontology this Kb belongs to.

Parameters:
ontology -

setTimeout

public void setTimeout(long timeout)
Set a timeout for the main timer. Used to stop an automated test after a reasonable amount of time has passed.

Parameters:
timeout -

getTaxonomy

public Taxonomy getTaxonomy()
Get the classification results.


getTaxonomyBuilder

public TaxonomyBuilder getTaxonomyBuilder()

getRoleTaxonomy

public Taxonomy getRoleTaxonomy()

getSizeEstimate

public SizeEstimate getSizeEstimate()

setRules

public void setRules(java.util.Set rules)

getRules

public java.util.Set getRules()


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