I have a SPARQL update query like following
DELETE { ?s <http://ex#> <http://ex#OLD> }
INSERT { ?s <http://ex#> <http://ex#NEW> }
WHERE { ?s <http://ex#> <http://ex#OLD> }
I want to run this query on my model. This will result in deleting some triples and addition of some other triples in the model. I am looking for a way to get these affected triples in Apache jena.
Till now I have made a ModelChangedListner (https://jena.apache.org/documentation/notes/event-handler-howto.html) to get these triples. Even though it is working fine but the problem is that I want the affected triples before they are committed to the dataset. But the model changed listener does not provide any such guarantee.
Edit: If there is no solution in current version of Jena, I am open to modify and recompile the Jena code if someone can point me to the location where this modification should be made.