Jena2 Database Interface

 

This document refers to the database subsystem that ships with Jena for compatibility reasons.

All new development should carried out with either TDB or SDB.

TDB is a non-transactional, faster database solution for use by a single system.  It scales well beyond SDB and is simpler to setup.

SDB is a system that uses relational databases for storage of RDF and OWL.  It supports many open source and commercial databases including MySQL, PostgreSQL, Oracle 11g, Microsoft SQL server and IBM DB2. It scales to graphs of 100 million triples.

Both these storage subsystems are supported by Joseki.


 

Jena provides persistent storage of RDF data in relational databases. The same interfaces such as Model, Resource and Query, are used to access and manipulate persistently stored RDF. The application does not directly access the database nor does it need to be aware of the database schema.

Implementations for MySQL, HSQLDB, PostgreSQL, Oracle and Microsoft SQL Server are provided and other databases have been added by 3rd parties.

Documents : Quick Links

Features

The Jena2 persistence subsystem implements the Jena Model interface providing persistence for models through use of a back-end relational database engine.  The default Jena2 database layout uses a denormalized schema in which literals and resource URIs are stored directly in statement tables. The Jena2 layout enables faster insertion and retrieval for fine-grained API operations at the cost of storage over a normalized triples and nodes schema. Configuration options are available that give Jena2 users some control over the degree of denormalization in order to reduce storage consumption.

The persistence subsystem supports a Fastpath capability for SPARQL queries that dynamically generates SQL queries for SPARQL Basic Graph Patterns to perform significant parts of the SPARQL query within the database engine.

For an overview of creating and accessing persistent Jena models, see "How To Create Persistent Models". A summary of the various configuration options available is given in Options.

Database Engine Support

The following table lists the database engines and JDBC drivers that are known to work with Jena. Older newer versions usually work but wil need testing; newer versions generally work. Please report further configurations to jena-dev@groups.yahoo.com.

See the database-specific how-to documents for more details on using these databases for Jena applications (HSQLDB, MySQL, Oracle, PostgreSQL, MS SQL Server).

Database Engine JDBC Driver
HSQLDB 1.8.0  
MySQL 4.1.11
MySQL 5.0.18
JDBC driver versions: 3.0, 3.1, 5.0
PostgreSQL 7.3
PostgreSQL 8.0
JDBC driver 7.3
JDBC driver 8.0
Apache Derby 10.1  
Oracle 10 XE Oracle ojdbc14 driver (thin driver) 10.2.0.2
Oracle 9i Release 2 Oracle ojdbc14 driver (thin driver) 10.2.0.2
Oracle 10g Release 2 Oracle ojdbc14 driver (thin driver) 10.2.0.2
Microsoft SQL Server 2005 Express SP1 Microsoft SQL Server 2005 JDBC Driver
Microsoft SQL Server 2000
Microsoft SQL Server Desktop Edition
Microsoft SQL Server 2005 JDBC Driver
jTDS version 1.2

MySQL Notes

Individuals in the Jena user community have developed Jena drivers for other database engines. See the Jena FAQ for a list of such drivers. For details on developing your own Jena database driver, see the porting notes.

Note that the database layout used by Jena is not intended for direct access by users and applications. The database should only be accessed indirectly, through the Jena API. This is because there is not a simple mapping from Jena models and statements into database tables. For example, resource URIs and literal values are encoded such that the plain text values may not be easily discernable. Users should not attempt to access the Jena database tables using SQL or other relational database tools unless they really know what they are doing. For those interested, a details on the Jena database schema are provided in the layout notes.