*/
private Collection getRelations(TypeHierarchy hierarchy, Iterator iterator) {
logger.debug("Creating relations with " + hierarchy);
LinkedList<Relation> relations = new LinkedList<Relation>();
while (iterator.hasNext()) { // concat . map
OntClass relatedClass = (OntClass) iterator.next();
if (!isOwlInternalClass(relatedClass)) {
Relation relation = factory.createRelation();
relation.setHierarchy(hierarchy);
/* Setting description in superclass and subclass, relations overwrite this value.*/
relation.setDescription(OntologyHelper.getPublicName(relatedClass));
collectRelatedClassDescription(relatedClass, relation);
relation.setUri(relation.getOnproperty());
relations.add(relation);
logger.debug("Added relation with hierarchy " + relation.getHierarchy() + " on property "+ relation.getOnproperty());
} else {
logger.debug("Discarding related class " + relatedClass.getURI());
}
}
logger.debug("End relations with " + hierarchy);
return relations;
}