use of edu.stanford.bmir.protege.web.shared.frame.PropertyValue in project webprotege by protegeproject.
the class PropertyValueMinimiser method minimisePropertyValues.
public List<PropertyValue> minimisePropertyValues(List<PropertyValue> propertyValues) {
List<PropertyValue> result = Lists.newArrayList(propertyValues);
for (int i = 0; i < propertyValues.size(); i++) {
for (int j = 0; j < propertyValues.size(); j++) {
if (i != j && result.get(i) != null && result.get(j) != null) {
PropertyValue propertyValueA = propertyValues.get(i);
PropertyValue propertyValueB = propertyValues.get(j);
if (subsumptionChecker.isSubsumedBy(propertyValueA, propertyValueB)) {
// Don't show B because this is more specific!
result.set(j, null);
}
}
}
}
result.removeIf(Objects::isNull);
return result;
}
Aggregations