public Iterator rootClasses( OntModel m ) {
List roots = new ArrayList();
for (Iterator i = m.listClasses(); i.hasNext(); ) {
OntClass c = (OntClass) i.next();
try {
// too confusing to list all the restrictions as root classes
if (c.isAnon()) {
continue;
}
if (c.hasSuperClass( m.getProfile().THING(), true ) ) {
// this class is directly descended from Thing
roots.add( c );
} else if (c.getCardinality( m.getProfile().SUB_CLASS_OF() ) == 0 ) {
// this class has no super-classes
// (can occur if we're not using the reasoner)
roots.add( c );
}
} catch (Exception e) {