minor improvement for NIHVIVO-205 ontology upgrade
This commit is contained in:
parent
f5627b74a6
commit
4a3ef8d03d
2 changed files with 12 additions and 4 deletions
|
@ -59,9 +59,12 @@ public class OntologyUpdater {
|
|||
settings.getAddedDataFile(), settings.getRemovedDataFile());
|
||||
}
|
||||
|
||||
public void update() throws IOException {
|
||||
public boolean update() throws IOException {
|
||||
|
||||
// Check to see if the update is necessary.
|
||||
if (updateRequired()) {
|
||||
|
||||
boolean updateRequired = updateRequired();
|
||||
if (updateRequired) {
|
||||
performUpdate();
|
||||
|
||||
if (!logger.errorsWritten()) {
|
||||
|
@ -74,6 +77,9 @@ public class OntologyUpdater {
|
|||
record.writeChanges();
|
||||
logger.closeLogs();
|
||||
}
|
||||
|
||||
return updateRequired;
|
||||
|
||||
}
|
||||
|
||||
private void performUpdate() throws IOException {
|
||||
|
|
|
@ -100,8 +100,10 @@ public class UpdateKnowledgeBase implements ServletContextListener {
|
|||
settings.setNewTBoxAnnotationsModel(newTBoxAnnotationsModel);
|
||||
|
||||
try {
|
||||
doMiscAppMetadataReplacements(ctx.getRealPath(MISC_REPLACEMENTS_FILE), oms);
|
||||
(new OntologyUpdater(settings)).update();
|
||||
boolean updateRequired = (new OntologyUpdater(settings)).update();
|
||||
if (updateRequired) {
|
||||
doMiscAppMetadataReplacements(ctx.getRealPath(MISC_REPLACEMENTS_FILE), oms);
|
||||
}
|
||||
} catch (IOException ioe) {
|
||||
String errMsg = "IOException updating knowledge base " +
|
||||
"for ontology changes: ";
|
||||
|
|
Loading…
Add table
Reference in a new issue