NIHVIVO-3504 improved retrieval of display rank values for class and property groups
This commit is contained in:
parent
4c56ce9ce1
commit
a16f504315
2 changed files with 4 additions and 27 deletions
|
@ -270,23 +270,9 @@ public class PropertyGroupDaoJena extends JenaBaseDao implements PropertyGroupDa
|
|||
group.setURI(groupInd.getURI());
|
||||
group.setNamespace(groupInd.getNameSpace());
|
||||
group.setLocalName(groupInd.getLocalName());
|
||||
try {
|
||||
if (groupInd.getProperty(PUBLIC_DESCRIPTION_ANNOT)!=null) {
|
||||
// without the convenience method, just for reference
|
||||
// String valueStr = ((Literal)groupInd.getProperty(PUBLIC_DESCRIPTION_ANNOT).getObject()).getLexicalForm();
|
||||
String valueStr = null;
|
||||
if ((valueStr=getPropertyStringValue(groupInd,PUBLIC_DESCRIPTION_ANNOT)) != null) {
|
||||
group.setPublicDescription(valueStr);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("error setting public description in groupFromGroupIndividual() for "+groupInd.getURI());
|
||||
}
|
||||
try {
|
||||
group.setDisplayRank(Integer.decode(((Literal)(groupInd.getProperty(DISPLAY_RANK).getObject())).getString()).intValue());
|
||||
} catch (Exception e) {
|
||||
log.debug("error setting display rank in groupFromGroupIndividual() for "+groupInd.getURI());
|
||||
}
|
||||
group.setPublicDescription(getPropertyStringValue(
|
||||
groupInd, PUBLIC_DESCRIPTION_ANNOT));
|
||||
group.setDisplayRank(getPropertyNonNegativeIntValue(groupInd, DISPLAY_RANK));
|
||||
return group;
|
||||
}
|
||||
|
||||
|
|
|
@ -180,16 +180,7 @@ public class VClassGroupDaoJena extends JenaBaseDao implements VClassGroupDao {
|
|||
group.setURI(groupInd.getURI());
|
||||
group.setNamespace(groupInd.getNameSpace());
|
||||
group.setLocalName(groupInd.getLocalName());
|
||||
try {
|
||||
DatatypeProperty drProp = (ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM)).createDatatypeProperty(VitroVocabulary.DISPLAY_RANK);
|
||||
if( drProp == null ){
|
||||
log.debug("No display rank in model for " + groupInd.getURI() );
|
||||
}else{
|
||||
group.setDisplayRank(Integer.decode(((Literal)(groupInd.getProperty(drProp).getObject())).getString()).intValue());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("Cannot get display rank for " + groupInd.getURI() + " " + e.getMessage() );
|
||||
}
|
||||
group.setDisplayRank(getPropertyNonNegativeIntValue(groupInd, DISPLAY_RANK));
|
||||
return group;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue