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
|
@ -1244,6 +1244,7 @@ public class SimpleReasoner extends StatementListener {
|
|||
@Override
|
||||
public void run() {
|
||||
|
||||
log.info("starting DeltaComputer.run");
|
||||
Model retractions = aBoxDeltaModeler1.getRetractions();
|
||||
boolean finished = (retractions.size() == 0);
|
||||
String qualifier = "(1)";
|
||||
|
@ -1252,7 +1253,7 @@ public class SimpleReasoner extends StatementListener {
|
|||
retractions.enterCriticalSection(Lock.READ);
|
||||
|
||||
try {
|
||||
log.info("started computing inferences for batch " + qualifier + " update");
|
||||
log.info("run: started computing inferences for batch " + qualifier + " update");
|
||||
StmtIterator iter = retractions.listStatements();
|
||||
|
||||
int num = 0;
|
||||
|
@ -1260,7 +1261,9 @@ public class SimpleReasoner extends StatementListener {
|
|||
Statement stmt = iter.next();
|
||||
|
||||
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) {
|
||||
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) {
|
||||
log.info("still computing inferences for batch " + qualifier + " update...");
|
||||
}
|
||||
|
||||
}
|
||||
} finally {
|
||||
retractions.removeAll();
|
||||
|
@ -1292,6 +1294,8 @@ public class SimpleReasoner extends StatementListener {
|
|||
log.info("switching from batch mode 2 to batch mode 1");
|
||||
} else {
|
||||
finished = true;
|
||||
batchMode1 = false;
|
||||
batchMode2 = false;
|
||||
log.info("finished processing retractions in batch mode");
|
||||
}
|
||||
}
|
||||
|
@ -1306,10 +1310,13 @@ public class SimpleReasoner extends StatementListener {
|
|||
aBoxDeltaModeler2.getRetractions().removeAll();
|
||||
}
|
||||
|
||||
if (batchMode1 || batchMode2) {
|
||||
log.warn("Unexpected condition at the end of DeltaComputer.run method: batchMode1=" + batchMode1 + ", batchMode2 =" + batchMode2 + ". (both should be false)" );
|
||||
batchMode1 = false;
|
||||
batchMode2 = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static String stmtString(Statement statement) {
|
||||
return " [subject = " + statement.getSubject().getURI() +
|
||||
|
|
Loading…
Add table
Reference in a new issue