I've had a go at removing all bulk update handler add and delete calls in the (graph level) BulkUpdateHandler.

There is a branch "jena-core-simplified".

Graph acquires

removeAll()
remove(s,p,o)   // Remove by pattern.

and the utility class GraphUtil has the implementations taken from SimpleBulkUpdateHandler so code changes to callers has been remove the bulk update call with a call to the equivalent static in GraphUtil.

1/
Currently, there isn't a Graph.add(Graph)

2/
ARP has been "de-bulked" - it sends triples off to the target graph of the parser straight away; it used to batch them into units of 1000.

3/
There some issues arising around event callbacks.

There are various events, one for each way triples are added.
-- see GraphListener.

notifyAddArray( Graph g, Triple [] ts )
notifyAddTriple( Graph g, Triple t )
notifyAddList( Graph g, List<Triple> L )
notifyAddIterator( Graph g, List<Triple> it )
notifyAddIterator( Graph g, Iterator<Triple> it )
notifyAddGraph( Graph g, Graph added )

This seems rather complicated but it can't simply be removed now because all this is reflected at the model level:

http://jena.apache.org/documentation/notes/event-handler-howto.html

The main way to get events is via ModelListenerAdapter which wires the ModelChnagedListener level to the graph level.

And we don't believe there are any other implementations of Model (at least, amongst people who upgrade).

If we switch to just two events,
  notifyAddTriple
  notifyDeleteTriple

will anyone notice or care?

In the branch currently, because currently all former bulk update operations go via GraphUtil, the old-style events are generated and the tests all pass unchanged.

Proposal - part 1:

Ask in [email protected] to see what, if any, use is make of model listeners.

Plan to make all changes either a single "added" or "removed" call.
If there is no evidence of use, remove extra calls now, and the next version is 2.10.0.

Proposal - part 2:

Leave, deprecated, the call Graph.getBulkUpdateHandler and implementation machinery of SimpleBulkUpdateHandler for one release, then remove it.

        Andy


Reply via email to