VIVO-1015 fix the redundancy check for restricted properties.

Now that we have faux properties, we consider two object properties to be different if they have different ranges.
However, an object property with a restriction appears to have a different range from its base property, but is
considered to be the same property. Fix this.
This commit is contained in:
Jim Blake 2015-04-13 16:25:25 -04:00
parent dc726d2600
commit c8eca40385

View file

@ -307,6 +307,11 @@ public class GroupedPropertyList extends BaseTemplateModel {
*
* Similarly, don't know the real problem with VIVO-989, except that the ranges are both
* blank nodes - probably the same blank node but on two different reads.
*
* For VIVO-1015, if op2 (the unpopulated property) is a Faux property, it will appear to
* be not redundant because of the range difference, and that's what we want. But if op2
* (the unpopulated property) has a different range than op1 because of a restriction,
* then we want to ignore that difference, so it appears to be redundant.
*/
private boolean redundant(ObjectProperty op, ObjectProperty op2) {
if (new FullPropertyKey((Property)op).equals(new FullPropertyKey((Property)op2))) {
@ -327,6 +332,9 @@ public class GroupedPropertyList extends BaseTemplateModel {
op2.getURI(),
fudgeBlankNodeInRange(op2.getRangeVClassURI())))) {
return true;
} else if (!(op instanceof FauxObjectPropertyWrapper) &&
op.getURI().equals(op2.getURI())) { // If not faux property, ignore range difference
return true;
} else {
return false;
}