* @param assertion
* @param type
*/
private void restoreType(ATermAppl assertion, TypeDependency type) {
final Node node = kb.getABox().getNode( type.getInd() );
final ATermAppl desc = type.getType();
if( DependencyIndex.log.isLoggable( Level.FINE ) ) {
if( node instanceof Individual )
DependencyIndex.log.fine( " Removing type? " + desc + " from "
+ ((Individual) node).debugString() );
else
DependencyIndex.log.fine( " Removing type? " + desc + " from " + node );
}
// get the dependency set - Note: we must normalize the concept
DependencySet ds = node.getDepends( ATermUtils.normalize( desc ) );
// return if null - this can happen as currently I have dupilicates in
// the index
if( ds == null || desc == ATermUtils.TOP )
return;
// clean it
ds.removeExplain( assertion );
// remove if the explanation set is empty
if( ds.getExplain().isEmpty() ) {
final IncrementalChangeTracker tracker = kb.getABox().getIncrementalChangeTracker();
kb.getABox().removeType( node.getName(), desc );
// update the set of removed types
tracker.addDeletedType( node, type.getType() );
// add to updated individuals