ResourceDiffProducer rdp = new BinaryResourceDiffProducerImpl();
//we suppose that the package definition didn't change in the resource.
//That's why we are serching the current package as
//this.kbase.getKnowledgePackage(kpkg.getName())
ResourceDiffResult diff = rdp.diff(entry.getValue(), kpkg, (KnowledgePackageImp) this.kbase.getKnowledgePackage(kpkg.getName()));
for (KnowledgeDefinition kd : diff.getRemovedDefinitions()) {
this.listener.debug("KnowledgeAgent: Removing: " + kd);
removeKnowledgeDefinitionFromBase(kd);
}