NIHVIVO-2869 batch retracted statements for inferencing at the end
This commit is contained in:
parent
21c8f4990d
commit
b9b5cb208a
1 changed files with 13 additions and 6 deletions
|
@ -159,7 +159,7 @@ public class SimpleReasoner extends StatementListener {
|
||||||
log.error("Exception while retracting inferences: " + e.getMessage());
|
log.error("Exception while retracting inferences: " + e.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Performs incremental selected ABox reasoning based
|
* Performs incremental selected ABox reasoning based
|
||||||
* on changes to the class or property hierarchy.
|
* on changes to the class or property hierarchy.
|
||||||
|
@ -1244,6 +1244,7 @@ public class SimpleReasoner extends StatementListener {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|
||||||
|
log.info("starting DeltaComputer.run");
|
||||||
Model retractions = aBoxDeltaModeler1.getRetractions();
|
Model retractions = aBoxDeltaModeler1.getRetractions();
|
||||||
boolean finished = (retractions.size() == 0);
|
boolean finished = (retractions.size() == 0);
|
||||||
String qualifier = "(1)";
|
String qualifier = "(1)";
|
||||||
|
@ -1252,7 +1253,7 @@ public class SimpleReasoner extends StatementListener {
|
||||||
retractions.enterCriticalSection(Lock.READ);
|
retractions.enterCriticalSection(Lock.READ);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.info("started computing inferences for batch " + qualifier + " update");
|
log.info("run: started computing inferences for batch " + qualifier + " update");
|
||||||
StmtIterator iter = retractions.listStatements();
|
StmtIterator iter = retractions.listStatements();
|
||||||
|
|
||||||
int num = 0;
|
int num = 0;
|
||||||
|
@ -1260,7 +1261,9 @@ public class SimpleReasoner extends StatementListener {
|
||||||
Statement stmt = iter.next();
|
Statement stmt = iter.next();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
removedStatement(stmt);
|
removedABoxTypeAssertion(stmt, inferenceModel);
|
||||||
|
setMostSpecificTypes(stmt.getSubject(), inferenceModel, new HashSet<String>());
|
||||||
|
//TODO update this part when subproperty inferencing is added.
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("exception while computing inferences for batch " + qualifier + " update: " + e.getMessage());
|
log.error("exception while computing inferences for batch " + qualifier + " update: " + e.getMessage());
|
||||||
}
|
}
|
||||||
|
@ -1269,7 +1272,6 @@ public class SimpleReasoner extends StatementListener {
|
||||||
if ((num % 6000) == 0) {
|
if ((num % 6000) == 0) {
|
||||||
log.info("still computing inferences for batch " + qualifier + " update...");
|
log.info("still computing inferences for batch " + qualifier + " update...");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
retractions.removeAll();
|
retractions.removeAll();
|
||||||
|
@ -1292,6 +1294,8 @@ public class SimpleReasoner extends StatementListener {
|
||||||
log.info("switching from batch mode 2 to batch mode 1");
|
log.info("switching from batch mode 2 to batch mode 1");
|
||||||
} else {
|
} else {
|
||||||
finished = true;
|
finished = true;
|
||||||
|
batchMode1 = false;
|
||||||
|
batchMode2 = false;
|
||||||
log.info("finished processing retractions in batch mode");
|
log.info("finished processing retractions in batch mode");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1306,8 +1310,11 @@ public class SimpleReasoner extends StatementListener {
|
||||||
aBoxDeltaModeler2.getRetractions().removeAll();
|
aBoxDeltaModeler2.getRetractions().removeAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
batchMode1 = false;
|
if (batchMode1 || batchMode2) {
|
||||||
batchMode2 = false;
|
log.warn("Unexpected condition at the end of DeltaComputer.run method: batchMode1=" + batchMode1 + ", batchMode2 =" + batchMode2 + ". (both should be false)" );
|
||||||
|
batchMode1 = false;
|
||||||
|
batchMode2 = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue