if (r == null)
return;
if (r.isClass()) {
OntClass c = r.asClass();
// simple class
if (c.isURIResource()) {
resources.add(c);
if (recursive)
getChildren(c, resources, true);
return;
}
// unionOf
else if (c.isUnionClass()) { // in form of unionOf or intersectionOf
UnionClass uc = c.asUnionClass();
for (Iterator<? extends OntClass> i = uc.listOperands(); i.hasNext(); ) {
try {
OntResource op = i.next();
// OntClass op = (OntClass) i.next();
getMembers(op, resources, recursive);
} catch (ConversionException e) {
logger.error(e.getMessage());
}
}
// intersectionOf
} else if (c.isIntersectionClass()) {
IntersectionClass ic = c.asIntersectionClass();
for (Iterator<? extends OntClass> i = ic.listOperands(); i.hasNext(); ) {
try {
OntResource op = i.next();
// OntClass op = (OntClass) i.next();
getMembers(op, resources, recursive);