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
&& op.getURI().equals(pi.getPropertyURI()));
boolean domainMatches = false;
boolean rangeMatches = false;
if(op.getDomainVClassURI() == null) { if(op.getDomainVClassURI() == null) {
if(pi.getDomainClassURI() == null) { if(pi.getDomainClassURI() == null) {
return true; domainMatches = true;
} }
} else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) { } else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) {
return true; domainMatches = true;
} }
if(op.getRangeVClassURI() == null) { if(op.getRangeVClassURI() == null) {
if (pi.getDomainClassURI() == null) { if (pi.getDomainClassURI() == null) {
return true; rangeMatches = true;
} }
} else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) { } else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) {
return true; rangeMatches = true;
} }
if (uriMatches && domainMatches && rangeMatches) {
return true;
} }
} }
return false; return false;