Redland - RDF Application Framework - Java Interface

Redland Java interface

This is built if --with-java is given to the configure line, or --with-java=java to use a particular Java version/program.

The --with-jdk configure argument MUST be given give the location of the root of the full JDK installation so that the interface can be properly compiled against the correct Java Native Interface (JNI) headers for the JDK that provides the java program.

The standard 'make' at the top level will build it once enabled as above. You can also compile the Java interface by hand as follows:

  cd java
  make
  make check  # optional

(the make check may fail without the files being installed)

To install it system wide (this is optional) do this as root:

  root# make install

which will copy the librdf-java.jar to PREFIX/share/java and the shared library librdf-java.so to PREFIX/lib. This is not a standard location between systems so might have to be done by hand.

The Redland Java interface has been tested with JD2SDK 1.4.2, J2SDK 1.4.1_01 and J2SDK 1.3.1 on Linux/x86 only. The JNI header and library files are in different places on all systems so the --with-jdk MUST be used to give the location of the root of the full JDK installation. This should then find the header files in the include and include/system sub-directories (such as "solaris" or "linux").

Testing the Redland Java interface

There is the beginnings of an example program in example.java which is mostly for reading (along with the test1.java) but can be compiled and run with:

  make example

which tries to set the shared library path for librdf-java.so

Redland Java API Introduction

The Java API is an object-based API reflecting the same structure of the Redland objects with simple mappings between them:

ConceptRedland ClassJava ClassPurpose
Resource / Literallibrdf_nodeorg.librdf.redland.Node RDF Model & Syntax nodes
Statement / Triplelibrdf_statementorg.librdf.redland.Statement RDF Model & Syntax arcs (statements, triples) [isa Resource]
Modellibrdf_modelorg.librdf.redland.Model Set of Statements usually held in one Storage.
Storagelibrdf_storageorg.librdf.redland.Storage Storage for Models either persistant or in-memory.
Streamlibrdf_streamorg.librdf.redland.Stream Providing sequences of Statements from Parsers, queries.
Parserlibrdf_parserorg.librdf.redland.Parser Syntax parsers delivering Stream of Statements or writing to a Model
Serializerlibrdf_serializerorg.librdf.redland.Serializer Serialize Models into various syntaxes such as RDF/XML.
Iteratorlibrdf_iteratororg.librdf.redland.Iterator Enumerating lists (of Node) from queries.
URIlibrdf_uriorg.librdf.redland.URI Provides URIs for Resources, Parsers, ...
World org.librdf.redland.World RDF wrapper class handling Redland startup/shutdown
Digestlibrdf_digest  Internal content digest class
Hashlibrdf_hash  Internal key:value maps class
Listlibrdf_list  Internal list class

Other RDF Java APIs and applications

The follow are useful pure-Java applications (no C library)


Copyright 2001-2003 Dave Beckett, Institute for Learning and Research Technology, University of Bristol