merge for NIHVIVO-3511

This commit is contained in:
stellamit 2011-12-15 17:42:40 +00:00
parent 5966c5e945
commit 77c49f7c65
3 changed files with 69 additions and 19 deletions

View file

@ -87,7 +87,7 @@ public class SimpleReasoner extends StatementListener {
aBoxDeltaModeler2 = new CumulativeDeltaModeler();
stopRequested = false;
aboxModel.getBaseModel().register(this);
aboxModel.getBaseModel().register(this);
}
/**
@ -307,7 +307,7 @@ public class SimpleReasoner extends StatementListener {
*
*/
public void addedABoxTypeAssertion(Statement stmt, Model inferenceModel, HashSet<String> unknownTypes) {
tboxModel.enterCriticalSection(Lock.READ);
try {
@ -450,9 +450,6 @@ public class SimpleReasoner extends StatementListener {
// Returns true if it is entailed by class subsumption that
// subject is of type cls; otherwise returns false.
public boolean entailedType(Resource subject, OntClass cls) {
//log.debug("subject = " + subject.getURI() + " class = " + cls.getURI());
aboxModel.enterCriticalSection(Lock.READ);
tboxModel.enterCriticalSection(Lock.READ);
@ -465,7 +462,7 @@ public class SimpleReasoner extends StatementListener {
while (iter.hasNext()) {
OntClass childClass = iter.next();
if (childClass.equals(cls)) break;
if (childClass.equals(cls)) continue;
Statement stmt = ResourceFactory.createStatement(subject, RDF.type, childClass);
if (aboxModel.contains(stmt)) return true;
}

View file

@ -138,6 +138,7 @@ public class SimpleReasonerSetup implements ServletContextListener {
SimpleReasonerTBoxListener simpleReasonerTBoxListener = new SimpleReasonerTBoxListener(simpleReasoner);
sce.getServletContext().setAttribute(SimpleReasonerTBoxListener.class.getName(),simpleReasonerTBoxListener);
assertionsOms.getTBoxModel().register(simpleReasonerTBoxListener);
inferencesOms.getTBoxModel().register(simpleReasonerTBoxListener);
log.info("Simple reasoner connected for the ABox");