org.semanticweb.elk.reasoner.indexing.hierarchy
Class IndexedPropertyChain

java.lang.Object
  extended by org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedObject
      extended by org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedPropertyChain
All Implemented Interfaces:
Comparable<IndexedPropertyChain>
Direct Known Subclasses:
IndexedBinaryPropertyChain, IndexedObjectProperty

public abstract class IndexedPropertyChain
extends IndexedObject
implements Comparable<IndexedPropertyChain>

Represents all occurrences of an ElkSubObjectPropertyExpression in an ontology. To this end, objects of this class keeps a list of sub and super property expressions. The data structures are optimized for quickly retrieving the relevant relationships during inferencing. This class is mainly a data container that provides direct public access to its content. The task of updating index structures consistently in a global sense is left to callers.

Author:
Frantisek Simancik, Markus Kroetzsch, "Yevgeny Kazakov"

Field Summary
protected static org.apache.log4j.Logger LOGGER_
           
 
Constructor Summary
IndexedPropertyChain()
           
 
Method Summary
<O> O
accept(IndexedObjectVisitor<O> visitor)
           
abstract
<O> O
accept(IndexedPropertyChainVisitor<O> visitor)
           
abstract
<O,P> O
accept(IndexedPropertyChainVisitorEx<O,P> visitor, P parameter)
           
protected  void addRightChain(IndexedBinaryPropertyChain chain)
          Adds the given IndexedBinaryPropertyChain to the list of IndexedBinaryPropertyChain that contains this IndexedPropertyChain in the right-hand-side
 void checkOccurrenceNumbers()
          verifies that occurrence numbers are not negative
 int compareTo(IndexedPropertyChain o)
           
 Collection<IndexedBinaryPropertyChain> getRightChains()
           
 SaturatedPropertyChain getSaturated()
           
 List<IndexedObjectProperty> getToldSuperProperties()
           
 int hashCode()
          Get an integer hash code to be used for this object.
 boolean occurs()
           
 String printOccurrenceNumbers()
           
protected  boolean removeRightChain(IndexedBinaryPropertyChain chain)
          Adds the given IndexedBinaryPropertyChain from the list of IndexedBinaryPropertyChain that contain this IndexedPropertyChain in the right-hand-side
protected  boolean removeToldSuperObjectProperty(IndexedObjectProperty superObjectProperty)
          Removes the given IndexedObjectProperty ones from the list of super-roles of this IndexedPropertyChain
 void resetSaturated()
          Resets the corresponding SaturatedObjecProperty to null.
 SaturatedPropertyChain setSaturated(SaturatedPropertyChain saturatedObjectProperty)
          Sets the corresponding SaturatedObjecProperty of this IndexedPropertyChain if none was yet assigned.
 void updateAndCheckOccurrenceNumbers(int increment)
           
 
Methods inherited from class org.semanticweb.elk.reasoner.indexing.hierarchy.IndexedObject
toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

LOGGER_

protected static final org.apache.log4j.Logger LOGGER_
Constructor Detail

IndexedPropertyChain

public IndexedPropertyChain()
Method Detail

getToldSuperProperties

public List<IndexedObjectProperty> getToldSuperProperties()
Returns:
All told super object properties of this IndexedBinaryPropertyChain

getRightChains

public Collection<IndexedBinaryPropertyChain> getRightChains()
Returns:
All IndexedBinaryPropertyChains in which this IndexedPropertyChain occurs on right

removeToldSuperObjectProperty

protected boolean removeToldSuperObjectProperty(IndexedObjectProperty superObjectProperty)
Removes the given IndexedObjectProperty ones from the list of super-roles of this IndexedPropertyChain

Parameters:
superObjectProperty - the IndexedObjectProperty to be removed
Returns:
true if successfully removed

addRightChain

protected void addRightChain(IndexedBinaryPropertyChain chain)
Adds the given IndexedBinaryPropertyChain to the list of IndexedBinaryPropertyChain that contains this IndexedPropertyChain in the right-hand-side

Parameters:
chain - the IndexedBinaryPropertyChain to be added

removeRightChain

protected boolean removeRightChain(IndexedBinaryPropertyChain chain)
Adds the given IndexedBinaryPropertyChain from the list of IndexedBinaryPropertyChain that contain this IndexedPropertyChain in the right-hand-side

Parameters:
chain - the IndexedBinaryPropertyChain to be removed
Returns:
true if successfully removed

occurs

public boolean occurs()
Specified by:
occurs in class IndexedObject
Returns:
true if this IndexedObject occur in the ontology index

printOccurrenceNumbers

public String printOccurrenceNumbers()
Returns:
the string representation for the occurrence numbers of this IndexedClassExpression

checkOccurrenceNumbers

public void checkOccurrenceNumbers()
verifies that occurrence numbers are not negative


updateAndCheckOccurrenceNumbers

public void updateAndCheckOccurrenceNumbers(int increment)

getSaturated

public SaturatedPropertyChain getSaturated()
Returns:
The corresponding SaturatedObjecProperty assigned to this IndexedPropertyChain or null if none is assigned

setSaturated

public SaturatedPropertyChain setSaturated(SaturatedPropertyChain saturatedObjectProperty)
Sets the corresponding SaturatedObjecProperty of this IndexedPropertyChain if none was yet assigned.

Parameters:
saturatedObjectProperty - assign the given SaturatedPropertyChain to this IndexedPropertyChain
Returns:
the previous SaturatedPropertyChain assigned to this IndexedPropertyChain or null if none was assigned.

resetSaturated

public void resetSaturated()
Resets the corresponding SaturatedObjecProperty to null.


hashCode

public final int hashCode()
Get an integer hash code to be used for this object.

Overrides:
hashCode in class Object
Returns:
Hash code.

compareTo

public int compareTo(IndexedPropertyChain o)
Specified by:
compareTo in interface Comparable<IndexedPropertyChain>

accept

public abstract <O> O accept(IndexedPropertyChainVisitor<O> visitor)

accept

public <O> O accept(IndexedObjectVisitor<O> visitor)
Specified by:
accept in class IndexedObject

accept

public abstract <O,P> O accept(IndexedPropertyChainVisitorEx<O,P> visitor,
                               P parameter)


Copyright © 2011-2013 Department of Computer Science, University of Oxford. All Rights Reserved.