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

java.lang.Object
  extended by org.semanticweb.elk.reasoner.indexing.hierarchy.DirectIndex
All Implemented Interfaces:
ModifiableOntologyIndex, OntologyIndex
Direct Known Subclasses:
DifferentialIndex

public class DirectIndex
extends Object
implements ModifiableOntologyIndex


Nested Class Summary
static class DirectIndex.ContextRootInitializationRule
          Adds root to the context
 
Field Summary
protected static org.apache.log4j.Logger LOGGER_
           
 
Constructor Summary
DirectIndex()
           
DirectIndex(IndexedObjectCache objectCache)
           
 
Method Summary
 void add(IndexedClassExpression target, ChainableRule<Context> rule)
          Adds a new context rule for the given IndexedClassExpression
 void add(IndexedObject newObject)
          Adds the given IndexedObject to this OntologyIndex
 void addClass(ElkClass newClass)
          Add the given ElkClass to the signature of this OntologyIndex
 void addContextInitRule(ChainableRule<Context> newRule)
          Adds a new context initialization for this OntologyIndex.
 void addNamedIndividual(ElkNamedIndividual newIndividual)
          Add the given ElkNamedIndividual to the signature of this OntologyIndex
 void addReflexiveProperty(IndexedObjectProperty property)
          Assert reflexivity of the given IndexedObjectProperty
 Chain<ChainableRule<Context>> getContextInitRuleChain()
           
 LinkRule<Context> getContextInitRuleHead()
           
 Collection<IndexedClass> getIndexedClasses()
           
 Collection<IndexedClassExpression> getIndexedClassExpressions()
           
 Collection<IndexedIndividual> getIndexedIndividuals()
           
 IndexedObjectCache getIndexedObjectCache()
           
 Collection<IndexedObjectProperty> getIndexedObjectProperties()
           
 IndexedClass getIndexedOwlNothing()
          Return the indexed representation of owl:Nothing
 IndexedClass getIndexedOwlThing()
          Return the indexed representation of owl:Thing
 Collection<IndexedPropertyChain> getIndexedPropertyChains()
           
 Collection<IndexedObjectProperty> getReflexiveObjectProperties()
           
 void remove(IndexedClassExpression target, ChainableRule<Context> rule)
          Removes an existing context rule for the given IndexedClassExpression
 void remove(IndexedObject oldObject)
          Removes the given IndexedObject from this OntologyIndex
 void removeClass(ElkClass oldClass)
          Removes the given ElkClass from the signature of this OntologyIndex
 void removeContextInitRule(ChainableRule<Context> oldRule)
          Removes an existing context initialization for this OntologyIndex
 void removeNamedIndividual(ElkNamedIndividual oldIndividual)
          Removes the given ElkNamedIndividual from the signature of this OntologyIndex
 void removeReflexiveProperty(IndexedObjectProperty property)
          Retracts reflexivity of the given IndexedObjectProperty
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER_

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

DirectIndex

public DirectIndex(IndexedObjectCache objectCache)

DirectIndex

public DirectIndex()
Method Detail

getContextInitRuleHead

public LinkRule<Context> getContextInitRuleHead()
Specified by:
getContextInitRuleHead in interface OntologyIndex
Returns:
the first context initialization rule assigned to this OntologyIndex, or null if there no such rules; all other rules can be obtained by traversing over Link.next()

getIndexedClassExpressions

public Collection<IndexedClassExpression> getIndexedClassExpressions()
Specified by:
getIndexedClassExpressions in interface OntologyIndex
Returns:
the IndexedClassExpressions for all ElkClassExpressions occurring in the ontology (including owl:Thing and owl:Nothing) or added/removed from the ontology since the last commit of the differential index

getIndexedClasses

public Collection<IndexedClass> getIndexedClasses()
Specified by:
getIndexedClasses in interface OntologyIndex
Returns:
the IndexedClasses for all ElkClasses occurring in the ontology (including owl:Thing and owl:Nothing)

getIndexedIndividuals

public Collection<IndexedIndividual> getIndexedIndividuals()
Specified by:
getIndexedIndividuals in interface OntologyIndex
Returns:
the IndexedIndividuals for all ElkIndividuals occurring in the ontology.

getIndexedPropertyChains

public Collection<IndexedPropertyChain> getIndexedPropertyChains()
Specified by:
getIndexedPropertyChains in interface OntologyIndex
Returns:
the IndexedPropertyChains for all ElkSubObjectPropertyExpressions occurring in the ontology.

getIndexedObjectProperties

public Collection<IndexedObjectProperty> getIndexedObjectProperties()
Specified by:
getIndexedObjectProperties in interface OntologyIndex
Returns:
the IndexedObjectPropertys for all ElkObjectPropertys occurring in the ontology.

getReflexiveObjectProperties

public Collection<IndexedObjectProperty> getReflexiveObjectProperties()
Specified by:
getReflexiveObjectProperties in interface OntologyIndex
Returns:
the IndexedObjectPropertys for all ElkObjectPropertys occurring in the reflexivity axioms of the ontology.

getIndexedOwlThing

public IndexedClass getIndexedOwlThing()
Description copied from interface: OntologyIndex
Return the indexed representation of owl:Thing

Specified by:
getIndexedOwlThing in interface OntologyIndex
Returns:
the IndexedClass corresponding to owl:Thing. It is assumed that owl:Thing occurs (i.e., is declared) in every ontology.

getIndexedOwlNothing

public IndexedClass getIndexedOwlNothing()
Description copied from interface: OntologyIndex
Return the indexed representation of owl:Nothing

Specified by:
getIndexedOwlNothing in interface OntologyIndex
Returns:
the IndexedClass corresponding to owl:Nothing. It is assumed that owl:Nothing contains (i.e., is declared) in every ontology.

getIndexedObjectCache

public IndexedObjectCache getIndexedObjectCache()
Specified by:
getIndexedObjectCache in interface ModifiableOntologyIndex
Returns:
the IndexedObjectCache associated with this index; this is where all IndexedObjects of this OntologyIndex are stored

addClass

public void addClass(ElkClass newClass)
Description copied from interface: ModifiableOntologyIndex
Add the given ElkClass to the signature of this OntologyIndex

Specified by:
addClass in interface ModifiableOntologyIndex
Parameters:
newClass - the ElkClass to be added

removeClass

public void removeClass(ElkClass oldClass)
Description copied from interface: ModifiableOntologyIndex
Removes the given ElkClass from the signature of this OntologyIndex

Specified by:
removeClass in interface ModifiableOntologyIndex
Parameters:
oldClass - the ElkClass to be removed

addNamedIndividual

public void addNamedIndividual(ElkNamedIndividual newIndividual)
Description copied from interface: ModifiableOntologyIndex
Add the given ElkNamedIndividual to the signature of this OntologyIndex

Specified by:
addNamedIndividual in interface ModifiableOntologyIndex
Parameters:
newIndividual - the ElkNamedIndividual to be added

removeNamedIndividual

public void removeNamedIndividual(ElkNamedIndividual oldIndividual)
Description copied from interface: ModifiableOntologyIndex
Removes the given ElkNamedIndividual from the signature of this OntologyIndex

Specified by:
removeNamedIndividual in interface ModifiableOntologyIndex
Parameters:
oldIndividual - the ElkNamedIndividual to be removed

addContextInitRule

public void addContextInitRule(ChainableRule<Context> newRule)
Description copied from interface: ModifiableOntologyIndex
Adds a new context initialization for this OntologyIndex.

Specified by:
addContextInitRule in interface ModifiableOntologyIndex
Parameters:
newRule - the context initialization rule to be added
See Also:
OntologyIndex.getContextInitRuleHead()

removeContextInitRule

public void removeContextInitRule(ChainableRule<Context> oldRule)
Description copied from interface: ModifiableOntologyIndex
Removes an existing context initialization for this OntologyIndex

Specified by:
removeContextInitRule in interface ModifiableOntologyIndex
Parameters:
oldRule - the context initialization rule to be removed
See Also:
OntologyIndex.getContextInitRuleHead()

add

public void add(IndexedClassExpression target,
                ChainableRule<Context> rule)
Description copied from interface: ModifiableOntologyIndex
Adds a new context rule for the given IndexedClassExpression

Specified by:
add in interface ModifiableOntologyIndex
Parameters:
target - the IndexedClassExpression for which to add the rule
rule - the context rule to be added

remove

public void remove(IndexedClassExpression target,
                   ChainableRule<Context> rule)
Description copied from interface: ModifiableOntologyIndex
Removes an existing context rule for the given IndexedClassExpression

Specified by:
remove in interface ModifiableOntologyIndex
Parameters:
target - the IndexedClassExpression for which to remove the rule
rule - the context rule to be removed

add

public void add(IndexedObject newObject)
Description copied from interface: ModifiableOntologyIndex
Adds the given IndexedObject to this OntologyIndex

Specified by:
add in interface ModifiableOntologyIndex
Parameters:
newObject - the object to be added

remove

public void remove(IndexedObject oldObject)
Description copied from interface: ModifiableOntologyIndex
Removes the given IndexedObject from this OntologyIndex

Specified by:
remove in interface ModifiableOntologyIndex
Parameters:
oldObject - the object to be removed

addReflexiveProperty

public void addReflexiveProperty(IndexedObjectProperty property)
Description copied from interface: ModifiableOntologyIndex
Assert reflexivity of the given IndexedObjectProperty

Specified by:
addReflexiveProperty in interface ModifiableOntologyIndex
Parameters:
property - the IndexedObjectProperty which should be asserted reflexive

removeReflexiveProperty

public void removeReflexiveProperty(IndexedObjectProperty property)
Description copied from interface: ModifiableOntologyIndex
Retracts reflexivity of the given IndexedObjectProperty

Specified by:
removeReflexiveProperty in interface ModifiableOntologyIndex
Parameters:
property - the IndexedObjectProperty which should not be reflexive anymore

getContextInitRuleChain

public Chain<ChainableRule<Context>> getContextInitRuleChain()
Returns:
a Chain view of context initialization rules assigned to this OntologyIndex; it can be used for inserting new rules or deleting existing ones


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