ResultSet rs = _stmt.executeQuery(query);
while ( rs.next() ) {
OntologyInfo ontology = new OntologyInfo();
ontology.setId(rs.getString(1));
ontology.setOntologyId(rs.getString(2));
ontology.setFilePath(rs.getString(3));
ontology.setFilename(rs.getString(4));
String ontology_id = rs.getString(5);
ontology.setUri(ontology_id);
ontology.setDisplayLabel(rs.getString(6));
ontology.setAuthor(rs.getString(7));
ontology.setVersion(rs.getString(8));
String version_status = rs.getString(9);
if (version_status == null || version_status.trim().length() == 0) {
if (version_statuses.containsKey(ontology_id)) {
version_status = version_statuses.get(ontology_id);
}
else {
version_status = "undefined";
}
}
version_statuses.put(ontology_id, version_status);
ontology.setVersionStatus(version_status);
if ( allVersions ) {
// just add item immediately:
onts.add(ontology);
}
else {
// "update" the most recent item for this ontology_id
mostRecent.put(ontology.getOntologyId(), ontology);
}
}
if ( allVersions ) {
// just return the list