JenaMulgara
From Jena Wiki
JenaMulgara is a bridge between the Jena API, a Java-based framework for writing semantic webapplications and Mulgara, an RDF database, written in Java.
The objective of the bridge is to provide the complete set of Jena APIs working on data stored in a Mulgara database.
Mulgara is open source and available from the Mulgara download area.
The JenaMulgara bridge is developed with version 2.5.4 of Jena, on the client side, and an unmodified Mulgara v1.1.1 server.
Contents |
Availability
The source code is available from Jena SVN in the
com.hp.hpl.jena.mulgara
.
The repository is http://jena.svn.sourceforge.net/svnroot/jena/JenaMulgara
The two classes JenaMulgara (the factory) and GraphMulgara (the Jena graph backed by a Mulgara database connection) are needed.
Setup
The bridge needs itql-1.1.1.jar on the classpath and a running Mulgara server.
The simplest way to create a model that is backed by a Mulgara server is to give the RMI URI and model name (derived from the server URI) as strings:
String server = "rmi://localhost/server1" ;
String graphURI = server+"#model1" ;
Model model = JenaMulgara.connectModel(server, graphURI) ;
Once the Jena model is created, it is used in the usual way, including as part of OntModels.
The application can construct a Session object and use that to create the model:
URI uriGraph = ... ; Session session = ... ; // Mulgara Session object Model model = JenaMulgara.createModel(session, uriGraph) ;
There are similar operations for Jena Graphs.
Implementation
The implementation is based on the Mulgara Session interface. This interface is usually provided by implementation over RMI. There are also implementations for other protocols, including a direct, local use with DatabaseSession.
The bridge is an implementation of a Jena graph. It extends com.hp.hpl.graph.impl.GraphBase
and implements the three operations find, add and delete.
All Jena APIs operate over RDF stored behind a Graph interface, which is the storage and inference abstraction.
Jena blank nodes have to be skolemized (that is, they are stored as URIs in the (unofficial) "bnode:" URI scheme).
Mixing blank nodes created directly with Mulgara's native interfaces and statement query and manipulation with Jena is fully supported (including correct behaviour of SPARQL isBlank) . The implementation unifies to the two different implementations of blank nodes.
Status
All the Jena APIs are supported given the restrictions related to blank nodes on accessing data loaded into Mulgara via other routes.
The implementation is designed to provide the functionality of the Jena interfaces. Future work will bring some efficiency gains by supporting batched updates and a more powerful conjunctive pattern access to the
It is a non-objective of the current development is to provide the most efficient SPARQL support possible - that will await a server-side implementation of SPARQL in Mulgara.
Notes
The Mulgara client code will, by default, print:
INFO [main] (RmiSessionFactory.java:250) - Unable to find ServerInfo. This may cause problems if this is a server
This can be ignored.
Support
Unsupported.
Email to jena-dev may solicit help (but please make sure the issue is to do with the JenaMulgara bridge or Jena itself). Mulgara questions to mulgara-general.
