VIVO-976 The property is appearing twice in the list - remove one of them.
For some reason, the property shows up once with a domain of OWL:Thing, and once with a domain of a blank node. Treat them as equivalent and the problem disappears.
This commit is contained in:
parent
e3859b7863
commit
37a08c5dcf
1 changed files with 32 additions and 1 deletions
|
@ -17,6 +17,8 @@ import java.util.Map;
|
||||||
import org.apache.commons.logging.Log;
|
import org.apache.commons.logging.Log;
|
||||||
import org.apache.commons.logging.LogFactory;
|
import org.apache.commons.logging.LogFactory;
|
||||||
|
|
||||||
|
import com.hp.hpl.jena.vocabulary.OWL;
|
||||||
|
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
import edu.cornell.mannlib.vitro.webapp.beans.DataProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.FauxProperty;
|
import edu.cornell.mannlib.vitro.webapp.beans.FauxProperty;
|
||||||
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
import edu.cornell.mannlib.vitro.webapp.beans.Individual;
|
||||||
|
@ -300,9 +302,38 @@ public class GroupedPropertyList extends BaseTemplateModel {
|
||||||
return op;
|
return op;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
private boolean redundant(ObjectProperty op, ObjectProperty op2) {
|
private boolean redundant(ObjectProperty op, ObjectProperty op2) {
|
||||||
return new FullPropertyKey((Property)op).equals(new FullPropertyKey((Property)op2));
|
if (new FullPropertyKey((Property)op).equals(new FullPropertyKey((Property)op2))) {
|
||||||
|
return true;
|
||||||
|
} else if (
|
||||||
|
new FullPropertyKey(
|
||||||
|
fudgeBlankNodeInDomain(op.getDomainVClassURI()),
|
||||||
|
op.getURI(),
|
||||||
|
op.getRangeVClassURI())
|
||||||
|
.equals(
|
||||||
|
new FullPropertyKey(
|
||||||
|
fudgeBlankNodeInDomain(op2.getDomainVClassURI()),
|
||||||
|
op2.getURI(),
|
||||||
|
op2.getRangeVClassURI()))) {
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String fudgeBlankNodeInDomain(String rawDomainUri) {
|
||||||
|
if (rawDomainUri == null) {
|
||||||
|
return null;
|
||||||
|
} else if (rawDomainUri.contains("http://vitro.mannlib.cornell.edu/ns/bnode#")) {
|
||||||
|
return OWL.Thing.getURI();
|
||||||
|
} else {
|
||||||
|
return rawDomainUri;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void addObjectPropertyToPropertyList(String propertyUri, String domainUri, String rangeUri,
|
private void addObjectPropertyToPropertyList(String propertyUri, String domainUri, String rangeUri,
|
||||||
List<Property> propertyList) {
|
List<Property> propertyList) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue