You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Given OntModel m with inference model:
var m = OntModelFactory.createModel( OntSpecification.OWL2_DL_MEM_RDFS_INF );
Given we register some model changed listener:
m.register(listener);
and we create a type
var type = m.createOntClass(SOMEURI);
and we delete that type:
type.deleteProperties();
then listener is not called with any deleted statements.
I also identified the cause:
inside ModelCom.register(ModelChangedListener listener) //line 1359
the getGraph() call returns the inference graph and not the underlying UnionGraph, hence any fine granular changes in the union graph and below have no listener registered
my current work around is pasted below in "Relevant output and stacktrace"
not sure if that workaround would work for other OntModel implementations and inference models.
Relevant output and stacktrace
my current workaround is:
private void register(OntModel model, ModelChangedListener listener) {
var given = model.getGraph();
if (given instanceof InfGraph infG) {
Graph raw = infG.getRawGraph();
if (raw instanceof UnionGraph ugraph) {
ugraph.getEventManager().register(((ModelCom)model).adapt(listener));
}
}
if (given instanceof UnionGraph ugraph) {
ugraph.getEventManager().register(((ModelCom)model).adapt(listener));
}
}
Are you interested in making a pull request?
Maybe
The text was updated successfully, but these errors were encountered:
let me test and use that workaround a bit more, as I'm not sure whether in the InfGraph case, the listener should also be added the the outer InfGraph as well (and not just the UnionGraph below).
Version
5.1.0
What happened?
Given OntModel m with inference model:
var m = OntModelFactory.createModel( OntSpecification.OWL2_DL_MEM_RDFS_INF );
Given we register some model changed listener:
m.register(listener);
and we create a type
var type = m.createOntClass(SOMEURI);
and we delete that type:
type.deleteProperties();
then listener is not called with any deleted statements.
I also identified the cause:
inside ModelCom.register(ModelChangedListener listener) //line 1359
the getGraph() call returns the inference graph and not the underlying UnionGraph, hence any fine granular changes in the union graph and below have no listener registered
my current work around is pasted below in "Relevant output and stacktrace"
not sure if that workaround would work for other OntModel implementations and inference models.
Relevant output and stacktrace
Are you interested in making a pull request?
Maybe
The text was updated successfully, but these errors were encountered: