changes = kb.changes.clone();
if( PelletOptions.USE_INCREMENTAL_DELETION ) {
deletedAssertions = new HashSet<ATermAppl>();
dependencyIndex = new DependencyIndex( this );
syntacticAssertions = new HashSet<ATermAppl>();
}
if( emptyABox ) {
abox = new ABox( this );
individuals = new HashSet<ATermAppl>();
instances = new HashMap<ATermAppl, Set<ATermAppl>>();
// even though we don't copy the individuals over to the new KB
// we should still create individuals for the
for( ATermAppl nominal : kb.getExpressivity().getNominals() ) {
addIndividual( nominal );
}
}
else {
abox = kb.abox.copy(this);
if( PelletOptions.KEEP_ABOX_ASSERTIONS ) {
for( AssertionType assertionType : AssertionType.values() ) {
Set<ATermAppl> assertions = kb.aboxAssertions.get( assertionType );
if( !assertions.isEmpty() )
aboxAssertions.put( assertionType, new HashSet<ATermAppl>( assertions ) );
}
}
individuals = new HashSet<ATermAppl>( kb.individuals );
instances = new HashMap<ATermAppl, Set<ATermAppl>>( kb.instances );
// copy deleted assertions
if( kb.getDeletedAssertions() != null ) {
deletedAssertions = new HashSet<ATermAppl>( kb.getDeletedAssertions() );
}
if( PelletOptions.USE_INCREMENTAL_CONSISTENCY && PelletOptions.USE_INCREMENTAL_DELETION ) {
// copy the dependency index
dependencyIndex = new DependencyIndex( this, kb.dependencyIndex );
}
// copy syntactic assertions
if( kb.syntacticAssertions != null ) {
syntacticAssertions = new HashSet<ATermAppl>( kb.syntacticAssertions );