diff --git a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java index 7964adce9..75a40773e 100644 --- a/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java +++ b/api/src/main/java/edu/cornell/mannlib/vitro/webapp/web/templatemodels/individual/GroupedPropertyList.java @@ -258,10 +258,8 @@ public class GroupedPropertyList extends BaseTemplateModel { if (possibleOP == null) { continue; } - for(ObjectProperty populatedOP : populatedOPs) { - if (redundant(populatedOP, possibleOP)) { - continue; - } + if (isInPopulatedOPs(populatedOPs, possibleOP)) { + continue; } if (!vClassUris.contains(possibleOP.getDomainVClassURI())) { continue; @@ -288,6 +286,15 @@ public class GroupedPropertyList extends BaseTemplateModel { return possibleProperties; } + private boolean isInPopulatedOPs(List populatedOPs, ObjectProperty possibleOP) { + for(ObjectProperty populatedOP : populatedOPs) { + if (redundant(populatedOP, possibleOP)) { + return true; + } + } + return false; + } + /** * Don't know what the real problem is with VIVO-976, but somehow we have the same property * showing up once with a blank node as a domain, and once with null or OWL:Thing as a domain.