//
for ( AttrGroup attrGroup : metadataBaseInfo.getAttrGroups() ) {
for ( AttrDef attrDef : attrGroup.getAttrDefs() ) {
// get value of MMI property:
Property mmiProp = uriPropMap.get(attrDef.getUri());
String prefixedMmi = MdHelper.prefixedName(mmiProp);
String value = JenaUtil2.getValue(ontRes, mmiProp);
// DC equivalent, which is obtained if necessary
Property dcProp = null;
if (value == null) {
// try a DC equivalent to use:
dcProp = MdHelper.getEquivalentDcProperty(mmiProp);
if ( dcProp != null ) {
value = JenaUtil2.getValue(ontRes, dcProp);
}
}
if ( value != null ) {
// get value:
if ( log.isDebugEnabled() ) {
log.debug("Assigning: " +attrDef.getUri()+ " = " + value);
}
originalValues.put(attrDef.getUri(), value);
// Special case: Omv.acronym/OmvMmi.shortNameUri
if ( Omv.acronym.getURI().equals(attrDef.getUri()) ) {
// add also the value of OmvMmi.shortNameUri:
String shortNameValue = JenaUtil2.getValue(ontRes, OmvMmi.shortNameUri);
if ( log.isDebugEnabled() ) {
log.debug("Also assigning " +OmvMmi.shortNameUri.getURI()+ " = " +shortNameValue);
}
originalValues.put(OmvMmi.shortNameUri.getURI(), shortNameValue);
}
// add detail:
if ( dcProp != null ) {
String prefixedDc = MdHelper.prefixedName(dcProp);
_addDetail(moreDetails, prefixedMmi, "not present", "Will use " +prefixedDc);
}
else {
_addDetail(moreDetails, prefixedMmi, "present", " ");
}
}
else {
if ( attrDef.isRequired() && ! attrDef.isInternal() ) {
if ( dcProp != null ) {
String prefixedDc = MdHelper.prefixedName(dcProp);
_addDetail(moreDetails, prefixedMmi, "not present", "and " +prefixedDc+ " not present either");
}
else {
_addDetail(moreDetails, prefixedMmi, "not present", " not equivalent DC");
}
}
}
}
}
}
else {
//
// No ontology resource. Check required attributes to report in the details:
//
for ( AttrGroup attrGroup : metadataBaseInfo.getAttrGroups() ) {
for ( AttrDef attrDef : attrGroup.getAttrDefs() ) {
if ( attrDef.isRequired() && ! attrDef.isInternal() ) {
Property mmiProp = uriPropMap.get(attrDef.getUri());
String prefixedMmi = MdHelper.prefixedName(mmiProp);
_addDetail(moreDetails, prefixedMmi, "not present", "required");
}
}
}