ModelJEB 1.0beta2

ModelJEB is an extension to Jena which allows models to be stored in BDB Java Edition databases. (For more information on BDB JE, visit http://www.sleepycat.com/products/je.shtml.)

This is the beta version of an experimental initial release. Don't use it for anything critical.

constraints

This release of ModelJEB has been built and tested against the Jena 2.2beta2 release (which you must download and install separately), and the enclosed version of BDB Java Edition. Don't try and use it with a different je.jar.

installation

Download and unzip the release file into a convenient directory (which you've presumably already done, to be reading this).

Run the tests. You will need to create a directory (here called $WHERE) for the tests to keep their database files, and create in that directory a file named jeb-tests-only. (Its contents are unimportant.)

Warning: when the tests are run, they will delete any existing file called je.lck, and all files ending in .jdb, in that directory, to ensure a clean test run. So don't try and use this directory for any other BDB JE databases.

You will also need to specify where your Jena jars are (here called $JENA_HOME). Run:

ant test -Dwhere=$WHERE -Djena.home=$JENA_HOME
(Note: junit.jar must be on your class-path. If necessary, add it to your system jars, or to the ant lib directory. Otherwise you will get complaints that the <junit> task is misspelt or not on your classpath.)

If the tests don't pass, something is horribly wrong. Let us know about it, and don't proceed further.

Once you are satisfied that the tests have been passed, you can add the dist/lib/je.jar and dist/lib/jena-bdb.jar to your usual development classpath.

The doc directory contains (some) documentation, including this file and the javadoc directory.

using ModelJEB

ModelJEB is not currently integrated into Jena's ModelFactory or ModelSpec subsystems. Instead you have to use the ModelJEB class directly.
    ModelJEB m = ModelJEB.open( directory, modelName );
directory is the filename of the directory in which the model will be stored. We strongly recommend that this directory is used only for storing ModelJEB models. modelName is the name of the model in that database directory. It will be created if it does not already exist.
If you look inside the directory you will see files with names like 00000000.jdb and je.lck; you will not see files named with the modelName. This is how BDB JE stores databases.
The model m is the usual Jena model, but statements written into it persist and are available the next time you open the model. ModelJEBs should be closed properly when you have finished with them, otherwise data may be lost.

command-line utility

A command-line utility provides simple access to ModelJEB models, allowing data to be inserted and extracted, model names to be listed, and models to be queried using RDQL. The general form of the command is
java jena.jeb command location:model [options]
location is the name of the directory in which ModelJEB databases are stored, and model is the name of the model in that database. The commands are: The options that may be supplied are:

missing features

We hope to include/fix these in 1.0final.

support

Support is provided in the same way as for Jena itself: post to the jena-dev mailing list for questions on how to use ModelJEB, and to the jena-devel mailing list for questions (or answers) about the internals. Any support is provided on a voluntary basis, as and when the effort is available.