sszuev commented on issue #2868:
URL: https://github.com/apache/jena/issues/2868#issuecomment-2536039961
@cdorn
Could you please provide a complete minimal example? I couldn't find the
`#deleteProperties()` method. Maybe this is some kind of extension external
method?
There are number of ways to delete triple\statement from a graph\model. The
`Model#remove()` method triggers corresponding event.
```java
public static void main(String[] args) {
var listener = new MCL();
var m =
OntModelFactory.createModel(OntSpecification.OWL2_DL_MEM_RDFS_INF);
m.register(listener);
var type = m.createOntClass("http://x");
m.remove(type.getMainStatement());
Assertions.assertEquals(1, listener.added.size());
Assertions.assertEquals(1, listener.removed.size());
}
static class MCL extends ObjectListener {
private final List<Object> added = new ArrayList<>();
private final List<Object> removed = new ArrayList<>();
@Override
public void added(Object x) {
System.out.println("added: " + x);
added.add(x);
}
@Override
public void removed(Object x) {
System.out.println("removed: " + x);
removed.add(x);
}
}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]