Merge branch 'maint-rel-1.6' of git+ssh://github.com/vivo-project/Vitro into maint-rel-1.6
This commit is contained in:
commit
171f47d392
2 changed files with 28 additions and 15 deletions
|
@ -271,7 +271,6 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
|
|||
|
||||
public ObjectProperty getObjectPropertyByURI(String propertyURI) {
|
||||
|
||||
long start = System.currentTimeMillis();
|
||||
if( propertyURI == null ) return null;
|
||||
|
||||
OntModel ontModel = getOntModel();
|
||||
|
@ -279,7 +278,16 @@ public class ObjectPropertyDaoJena extends PropertyDaoJena implements ObjectProp
|
|||
|
||||
ontModel.enterCriticalSection(Lock.READ);
|
||||
try {
|
||||
localModel.add(ontModel.listStatements(ontModel.getResource(propertyURI), null, (RDFNode) null));
|
||||
Resource prop = ontModel.getResource(propertyURI);
|
||||
localModel.add(ontModel.listStatements(prop, null, (RDFNode) null));
|
||||
StmtIterator invit = ontModel.listStatements(prop, OWL.inverseOf, (RDFNode) null);
|
||||
while (invit.hasNext()) {
|
||||
Statement invSit = invit.nextStatement();
|
||||
if (invSit.getObject().isURIResource()) {
|
||||
Resource invProp = (Resource) invSit.getObject();
|
||||
localModel.add(ontModel.listStatements(invProp, null, (RDFNode) null));
|
||||
}
|
||||
}
|
||||
OntProperty op = localModel.getObjectProperty(propertyURI);
|
||||
return propertyFromOntProperty(op);
|
||||
} finally {
|
||||
|
|
|
@ -300,21 +300,26 @@ public class GroupedPropertyList extends BaseTemplateModel {
|
|||
return false;
|
||||
}
|
||||
for (ObjectProperty op : opList) {
|
||||
if (op.getURI() != null && op.getURI().equals(pi.getPropertyURI())) {
|
||||
if(op.getDomainVClassURI() == null) {
|
||||
if(pi.getDomainClassURI() == null) {
|
||||
return true;
|
||||
}
|
||||
} else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) {
|
||||
return true;
|
||||
boolean uriMatches = (op.getURI() != null
|
||||
&& op.getURI().equals(pi.getPropertyURI()));
|
||||
boolean domainMatches = false;
|
||||
boolean rangeMatches = false;
|
||||
if(op.getDomainVClassURI() == null) {
|
||||
if(pi.getDomainClassURI() == null) {
|
||||
domainMatches = true;
|
||||
}
|
||||
if(op.getRangeVClassURI() == null) {
|
||||
if (pi.getDomainClassURI() == null) {
|
||||
return true;
|
||||
}
|
||||
} else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) {
|
||||
return true;
|
||||
} else if (op.getDomainVClassURI().equals(pi.getDomainClassURI())) {
|
||||
domainMatches = true;
|
||||
}
|
||||
if(op.getRangeVClassURI() == null) {
|
||||
if (pi.getDomainClassURI() == null) {
|
||||
rangeMatches = true;
|
||||
}
|
||||
} else if (op.getRangeVClassURI().equals(pi.getRangeClassURI())) {
|
||||
rangeMatches = true;
|
||||
}
|
||||
if (uriMatches && domainMatches && rangeMatches) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Add table
Reference in a new issue