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>();
|
||||
// now first get the properties this entity actually has, presumably populated with statements
|
||||
List<ObjectProperty> objectPropertyList = subject.getObjectPropertyList();
|
||||
for (ObjectProperty op : objectPropertyList) {
|
||||
for (ObjectProperty op : objectPropertyList) {
|
||||
op.setEditLabel(op.getDomainPublic());
|
||||
mergedPropertyList.add(op);
|
||||
}
|
||||
|
|
|
@ -79,23 +79,28 @@ public class ObjectPropertyStatementDaoJena extends JenaBaseDao implements Objec
|
|||
if( uriToObjectProperty.containsKey(prop.getURI())){
|
||||
objPropertyStmt.setProperty(uriToObjectProperty.get(prop.getURI()));
|
||||
}else{
|
||||
ObjectProperty p = opDaoJena.propertyFromOntProperty(getOntModel().createOntProperty(prop.getURI()));
|
||||
uriToObjectProperty.put(prop.getURI(), p);
|
||||
objPropertyStmt.setProperty(uriToObjectProperty.get(prop.getURI()));
|
||||
ObjectProperty p = opDaoJena.propertyFromOntProperty(getOntModel().getObjectProperty(prop.getURI()));
|
||||
if( p != null ){
|
||||
uriToObjectProperty.put(prop.getURI(), p);
|
||||
objPropertyStmt.setProperty(uriToObjectProperty.get(prop.getURI()));
|
||||
}else{
|
||||
//if ObjectProperty not found in ontology, skip it
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} catch (Throwable g) {
|
||||
ObjectProperty q = new ObjectProperty();
|
||||
q.setDomainPublic("error");
|
||||
// g.printStackTrace();
|
||||
//do not add statement to list
|
||||
log.debug("exception while trying to get object property for statement list, statement skipped.", g);
|
||||
continue;
|
||||
}
|
||||
if (objPropertyStmt.getObjectURI() != null) {
|
||||
Individual objInd = getWebappDaoFactory().getIndividualDao().getIndividualByURI(objPropertyStmt.getObjectURI());
|
||||
objPropertyStmt.setObject(objInd);
|
||||
}
|
||||
if ((objPropertyStmt.getSubjectURI() != null) && (objPropertyStmt.getPropertyURI() != null) && (objPropertyStmt.getObject() != null))
|
||||
objPropertyStmtList.add(objPropertyStmt);
|
||||
else {
|
||||
//log.error("At least one null value in ObjectPropertyStatement. Discarding.");
|
||||
|
||||
//add object property statement to list for Individual
|
||||
if ((objPropertyStmt.getSubjectURI() != null) && (objPropertyStmt.getPropertyURI() != null) && (objPropertyStmt.getObject() != null)){
|
||||
objPropertyStmtList.add(objPropertyStmt);
|
||||
}
|
||||
} catch (Throwable t) {
|
||||
t.printStackTrace();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue