Fixing NIHVIVO-276 Types showing up in public individual display.
This commit is contained in:
parent
e743a3fc0f
commit
495093638b
2 changed files with 16 additions and 11 deletions
|
@ -107,7 +107,7 @@ public class EntityMergedPropertyListController extends VitroHttpServlet {
|
||||||
List<Property> mergedPropertyList = new ArrayList<Property>();
|
List<Property> mergedPropertyList = new ArrayList<Property>();
|
||||||
// now first get the properties this entity actually has, presumably populated with statements
|
// now first get the properties this entity actually has, presumably populated with statements
|
||||||
List<ObjectProperty> objectPropertyList = subject.getObjectPropertyList();
|
List<ObjectProperty> objectPropertyList = subject.getObjectPropertyList();
|
||||||
for (ObjectProperty op : objectPropertyList) {
|
for (ObjectProperty op : objectPropertyList) {
|
||||||
op.setEditLabel(op.getDomainPublic());
|
op.setEditLabel(op.getDomainPublic());
|
||||||
mergedPropertyList.add(op);
|
mergedPropertyList.add(op);
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,23 +79,28 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec
|
||||||
if( uriToObjectProperty.containsKey(prop.getURI())){
|
if( uriToObjectProperty.containsKey(prop.getURI())){
|
||||||
objPropertyStmt.setProperty(uriToObjectProperty.get(prop.getURI()));
|
objPropertyStmt.setProperty(uriToObjectProperty.get(prop.getURI()));
|
||||||
}else{
|
}else{
|
||||||
ObjectProperty p = opDaoJena.propertyFromOntProperty(getOntModel().createOntProperty(prop.getURI()));
|
ObjectProperty p = opDaoJena.propertyFromOntProperty(getOntModel().getObjectProperty(prop.getURI()));
|
||||||
uriToObjectProperty.put(prop.getURI(), p);
|
if( p != null ){
|
||||||
objPropertyStmt.setProperty(uriToObjectProperty.get(prop.getURI()));
|
uriToObjectProperty.put(prop.getURI(), p);
|
||||||
|
objPropertyStmt.setProperty(uriToObjectProperty.get(prop.getURI()));
|
||||||
|
}else{
|
||||||
|
//if ObjectProperty not found in ontology, skip it
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} catch (Throwable g) {
|
} catch (Throwable g) {
|
||||||
ObjectProperty q = new ObjectProperty();
|
//do not add statement to list
|
||||||
q.setDomainPublic("error");
|
log.debug("exception while trying to get object property for statement list, statement skipped.", g);
|
||||||
// g.printStackTrace();
|
continue;
|
||||||
}
|
}
|
||||||
if (objPropertyStmt.getObjectURI() != null) {
|
if (objPropertyStmt.getObjectURI() != null) {
|
||||||
Individual objInd = getWebappDaoFactory().getIndividualDao().getIndividualByURI(objPropertyStmt.getObjectURI());
|
Individual objInd = getWebappDaoFactory().getIndividualDao().getIndividualByURI(objPropertyStmt.getObjectURI());
|
||||||
objPropertyStmt.setObject(objInd);
|
objPropertyStmt.setObject(objInd);
|
||||||
}
|
}
|
||||||
if ((objPropertyStmt.getSubjectURI() != null) && (objPropertyStmt.getPropertyURI() != null) && (objPropertyStmt.getObject() != null))
|
|
||||||
objPropertyStmtList.add(objPropertyStmt);
|
//add object property statement to list for Individual
|
||||||
else {
|
if ((objPropertyStmt.getSubjectURI() != null) && (objPropertyStmt.getPropertyURI() != null) && (objPropertyStmt.getObject() != null)){
|
||||||
//log.error("At least one null value in ObjectPropertyStatement. Discarding.");
|
objPropertyStmtList.add(objPropertyStmt);
|
||||||
}
|
}
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue