List<EntityData> result = new ArrayList<EntityData>();
Set<OWLEntity> matchingEntities = rm.getEntities(propertyName);
// Which entity does it refer to? All messed up.
for (OWLEntity entity : matchingEntities) {
if (entity.isOWLObjectProperty()) {
OWLObjectPropertyHierarchyProvider hierarchyProvider = project.getObjectPropertyHierarchyProvider();
Set<OWLObjectProperty> subProperties = hierarchyProvider.getChildren(entity.asOWLObjectProperty());
for (OWLObjectProperty subProperty : subProperties) {
final EntityData entityData = rm.getEntityData(subProperty);
int notesCount = project.getNotesManager().getDirectNotesCount(subProperty);
entityData.setLocalAnnotationsCount(notesCount);
result.add(entityData);
}
}
else if (entity.isOWLDataProperty()) {
OWLDataPropertyHierarchyProvider hierarchyProvider = project.getDataPropertyHierarchyProvider();
Set<OWLDataProperty> subProperties = hierarchyProvider.getChildren(entity.asOWLDataProperty());
for (OWLDataProperty subProperty : subProperties) {
final EntityData entityData = rm.getEntityData(subProperty);
int notesCount = project.getNotesManager().getDirectNotesCount(subProperty);
entityData.setLocalAnnotationsCount(notesCount);
result.add(entityData);
}
}
else if (entity.isOWLAnnotationProperty()) {
OWLAnnotationPropertyHierarchyProvider hierarchyProvider = project.getAnnotationPropertyHierarchyProvider();
Set<OWLAnnotationProperty> subProperties = hierarchyProvider.getChildren(entity.asOWLAnnotationProperty());
for (OWLAnnotationProperty subProperty : subProperties) {
final EntityData entityData = rm.getEntityData(subProperty);
int notesCount = project.getNotesManager().getDirectNotesCount(subProperty);
entityData.setLocalAnnotationsCount(notesCount);
result.add(entityData);