On 26/07/16 21:05, Raphael W. Majeed wrote:
Hello there,

I was working with Jena dependencies in my projects for some time and was
always wondering why the org.apache.jena.util.iterator.ClosableIterator
didn't extend the java.lang.AutoCloseable interface.

The API predates AutoCloseable.

That means there is applciation and user code that already exists and works perfectly well.

Making changes

It appears to me like a simple change that would allow other developers
(and me) to use these iterators in try-with-resource statements. This would
simplify working with Jena significantly.

Is there a specific reason why the ClosableIterator doesn't extend the
AutoClosable interface?

A way forward to consider is to develop a new API under a new package - whether that's incremental change to the existing one, or a new oen with a different focus (maybe designed for bulk processing from the ground up; maybe a mor functional style, maybe ....).

Jena can support multiple APIs over the same core (SPI) of Graph/Triple/Node.

See also CommonsRDF although that is half way between the Graph/Triple/Node level (which is what RDF 1.1 calls "generalised RDF") and the Jena Model/Statement/Resource (which has an entity aspect Resource.getProperty etc)

CommonsRDF is typed (subjects can't be literal) but does not have the entity aspect.

        Andy



Regards,
Raphael


Reply via email to