Migrating from Jena1 to Jena 2

Jena 2 supports the Jena 1 API. However a number of changes have been made that will cause existing code not to run out of the box. The Jena team expect that there will be tools to help with the migration of Jena 1 code, but they don't exist yet, as we are not encouraging folks to migrate.

The changes are conceptually minor, mostly just renaming things into a more sensible pattern. Exceptions are reification and a bug fix on the I/O API.

What Must be changed:

package renaming:

new model factory:

iterators now implement java.util.iterator

I/O bug fix

Changes in the RDF/XML parser now mean that (the frequent) character encoding problems related to use of java.io.FileReader are reported. Changes in the RDF/XML output means that the not-so-very-portable character encoding used in a java.io.FileWriter is explicit in the XML document. See the IO mini HowTo for more explanation.

reification changes

Statements are no longer Resources. Instead Statements can be converted into Resources using the asResource() method. These new Resources are ReifiedStatement objects. See the API proposal document for the moment.

Statement.set

The Statement.set(X) methods have been removed. In its place we have the Statement.changeObject(X) methods. These methods update the model in the same way, but they do not alter the Statement object - they construct a new one and return it. This avoids certain technical difficulties which arose from having mutable Statement objects.

What Should be Changed

new SimpleSelector

*Impl classes