OWLClass currentClazz = addClass(clazz);
Set set = kbase.getSuperClasses(clazz, true);//localOntology.getSuperClasses(base.getClass(new URI("http://127.0.0.1/ontology/univ-bench.owl#Chair")),true);
set.remove(clazz);
debugDisplay("Superclasses of " + clazz.getURI().toString());
debugDisplay(set.toString());
OntClass c_ont;
OWLClass c_owl;
Resource res = null;
for(Iterator iter= set.iterator(); iter.hasNext();) {
c_owl = (OWLClass)iter.next();
c_ont = (OntClass) ( (Resource)c_owl.getImplementation()).as(OntClass.class);
if(c_ont.toString().indexOf("http://www.w3.org/2000/01/rdf-schema")>=0)
debugDisplay(" - Skipped - " + c_ont);
else if (c_ont.isRestriction()) {
res = createRestriction(base,c_ont.asRestriction());
}
else if (c_ont.isIndividual()) {
debugDisplay(" asIndividual ");// + r.asIndividual().toString() );
res = local.createIndividual(c_ont);
}
else if (c_ont.isIntersectionClass()) {
debugDisplay(" asIntersectionClass " + c_ont.asIntersectionClass().toString());
res = local.createIntersectionClass(c_ont.getURI(),c_ont.asIntersectionClass().getOperands());
}
else if(c_ont.isComplementClass() && (!c_ont.toString().contains("http://www.w3.org/2002/07/owl")) ) {
debugDisplay(" asComplementClass " +c_ont.asComplementClass().toString());
res = local.createComplementClass(c_ont.getURI(), c_ont.asComplementClass().getOperands());
}
else if(c_ont.isEnumeratedClass() && (!c_ont.toString().contains("http://www.w3.org/2002/07/owl")) ) {
debugDisplay(" asEnumeratedClass " + c_ont.asEnumeratedClass().toString());
res = local.createEnumeratedClass(c_ont.getURI(),c_ont.asEnumeratedClass().getOneOf());
}
else if(c_ont.isUnionClass() && (!c_ont.toString().contains("http://www.w3.org/2002/07/owl")) ) {
debugDisplay(" asUnionClass " + c_ont.asUnionClass().toString());
res = local.createUnionClass(c_ont.getURI(),c_ont.asUnionClass().getOperands());
}
else {
debugDisplay(" OntClass " + c_ont.toString());
res = (Resource) createClass(kbase,c_owl).getImplementation();
}
if (res!=null)
addSuperClass(currentClazz,res);
else