fixed check for redundant possible object properties (#358)

Co-authored-by: Georgy Litvinov <georgy.litvinov@tib.eu>
This commit is contained in:
Georgy Litvinov 2023-01-24 13:09:57 +01:00 committed by GitHub
parent a7215cc932
commit 7dabc6b2ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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<ObjectProperty> 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.