//
// c) versioned URI request -> search the list for the exact match using the 'uri' field
//
RegisteredOntologyInfo foundRoi = null;
if ( version != null ) {
if ( log.isDebugEnabled() ) {
log.debug(getClass().getSimpleName()+ "getOntologyInfoWithVersionParams case a) version = " +version);
}
// a) explicit version given: search for exact match using the 'version' field:
for ( RegisteredOntologyInfo oi : list ) {
if ( version.equals(oi.getVersionNumber()) ) {
foundRoi = oi;
break;
}
}
}
else if ( ontologyUri.equals(unversOntologyUri) ) {
if ( log.isDebugEnabled() ) {
log.debug(getClass().getSimpleName()+ "getOntologyInfoWithVersionParams case b) unversioned request = " +unversOntologyUri);
}
// b) unversioned URI request, eg., http://mmisw.org/ont/seadatanet/qualityFlag
// just return first entry in list
// do not alter the first entry in the list!
// RegisteredOntologyInfo oi = list.get(0);
// oi.setUri(oi.getUnversionedUri());
// foundRoi = oi;
// here is how it should be done:
RegisteredOntologyInfo mostRecent = list.get(0);
foundRoi = _createOntologyInfo(
mostRecent.getUnversionedUri(), // NOTE: UnversionedURI for the URI
mostRecent.getDisplayLabel(),
mostRecent.getType(),
mostRecent.getUserId(),
mostRecent.getContactName(),
mostRecent.getVersionNumber(),
mostRecent.getDateCreated(),
mostRecent.getUsername(),
mostRecent.getOntologyId(),
mostRecent.getVersionStatus(),
mostRecent.getUnversionedUri(),
mostRecent.getAuthority(),
mostRecent.getShortName()
);
}
else {
if ( log.isDebugEnabled() ) {