VIVO-898 Call removedStatements.add(), not removedStatements.remove()
Also, in RefactorOperationController, edit events must be fired against the base model, not against the ontModel itself. Also, add some debugging statements.
This commit is contained in:
parent
ba56c3de06
commit
f389d320ed
3 changed files with 27 additions and 3 deletions
|
@ -238,10 +238,10 @@ public class RefactorOperationController extends BaseEditController {
|
|||
Model model = null;
|
||||
|
||||
if (TBOX_ASSERTIONS.equals(graphURI)) {
|
||||
model = ModelAccess.on(getServletContext()).getOntModel(TBOX_ASSERTIONS);
|
||||
model = ModelAccess.on(getServletContext()).getOntModel(TBOX_ASSERTIONS).getBaseModel();
|
||||
doNotify = true;
|
||||
} else if (ABOX_ASSERTIONS.equals(graphURI)) {
|
||||
model = ModelAccess.on(getServletContext()).getOntModel(ABOX_ASSERTIONS);
|
||||
model = ModelAccess.on(getServletContext()).getOntModel(ABOX_ASSERTIONS).getBaseModel();
|
||||
doNotify = true;
|
||||
} else {
|
||||
model = dataset.getNamedModel(graphURI);
|
||||
|
|
|
@ -173,10 +173,17 @@ public class ConfiguredReasonerListener implements ModelChangedListener {
|
|||
|
||||
@Override
|
||||
public void notifyEvent(Model m, Object event) {
|
||||
log.debug("Notified of event.");
|
||||
if (event instanceof EditEvent) {
|
||||
EditEvent ee = (EditEvent) event;
|
||||
if (!ee.getBegin()) {
|
||||
log.debug("Notified of ending EditEvent.");
|
||||
|
||||
TBoxChanges changes = changeSet.getAndSet(new TBoxChanges());
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("Change set: " + changes);
|
||||
}
|
||||
|
||||
this.reasonerDriver.runSynchronizer(changes);
|
||||
}
|
||||
}
|
||||
|
@ -190,6 +197,10 @@ public class ConfiguredReasonerListener implements ModelChangedListener {
|
|||
// ----------------------------------------------------------------------
|
||||
|
||||
public void tryAdd(Statement stmt) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("try to add statement: " + stmt);
|
||||
}
|
||||
|
||||
if (suspended.get()) {
|
||||
return;
|
||||
}
|
||||
|
@ -215,6 +226,10 @@ public class ConfiguredReasonerListener implements ModelChangedListener {
|
|||
}
|
||||
|
||||
public void tryRemove(Statement stmt) {
|
||||
if (log.isDebugEnabled()) {
|
||||
log.debug("try to remove statement: " + stmt);
|
||||
}
|
||||
|
||||
if (suspended.get()) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -36,7 +36,7 @@ public class TBoxChanges {
|
|||
}
|
||||
|
||||
public void removeStatement(Statement stmt) {
|
||||
removedStatements.remove(stmt);
|
||||
removedStatements.add(stmt);
|
||||
}
|
||||
|
||||
public void deleteDataProperty(Statement stmt) {
|
||||
|
@ -80,4 +80,13 @@ public class TBoxChanges {
|
|||
return deletedObjectPropertyUris;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "TBoxChanges[addedStatements=" + addedStatements
|
||||
+ ", removedStatements=" + removedStatements
|
||||
+ ", deletedDataPropertyUris=" + deletedDataPropertyUris
|
||||
+ ", deletedObjectPropertyUris=" + deletedObjectPropertyUris
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue