VIVO-499 fixes bug in deduping applicable properties

This commit is contained in:
brianjlowe 2013-11-06 11:02:33 -05:00
parent dc58791842
commit b276cd5049

View file

@ -300,21 +300,26 @@ public class GroupedPropertyList extends BaseTemplateModel {
return false; return false;
} }
for (ObjectProperty op : opList) { for (ObjectProperty op : opList) {
if (op.getURI() != null && op.getURI().equals(pi.getPropertyURI())) { boolean uriMatches = (op.getURI() != null
if(op.getDomainVClassURI() == null) { && op.getURI().equals(pi.getPropertyURI()));
if(pi.getDomainClassURI() == null) { boolean domainMatches = false;
return true; boolean rangeMatches = false;
} if(op.getDomainVClassURI() == null) {
} else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) { if(pi.getDomainClassURI() == null) {
return true; domainMatches = true;
} }
if(op.getRangeVClassURI() == null) { } else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) {
if (pi.getDomainClassURI() == null) { domainMatches = true;
return true; }
} if(op.getRangeVClassURI() == null) {
} else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) { if (pi.getDomainClassURI() == null) {
return true; rangeMatches = true;
} }
} else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) {
rangeMatches = true;
}
if (uriMatches && domainMatches && rangeMatches) {
return true;
} }
} }
return false; return false;