I am trying to compare two OntModels and checking if any class of model1 is missing in model2 then add a tag on model1 class that tells the time when it is deleted from model2. My code detects the missing classes correctly but does not append tag. How can I add tag/ class on the detected class?
for (Iterator i=model1.listClasses(); i.hasNext(); )
{
OntClass c=(OntClass)i.next();
if (model2.contains(c, null))
{
System.out.println("Contains : "+c.asClass());
}
else
{
System.out.println(time+" Does not contain : "+c.asClass());
final OntClass a = model1.createClass( URI+"DeletedOn"+time );
a.addSuperClass(c.getSuperClass());
c.addSuperClass(a);
}
}