Redland - RDF Application Framework - Java Interface

Redland Java interface

The Java interface is still rather experimental and is still likely to change somewhat.

This is not automatically built or installed at present since this interface may not be required. You can easily build it by hand as follows

  cd java
  make build-java
  make test-java   # optional
  # might need to run the test code like this:
  LD_LIBRARY_PATH=. java -classpath . test

To install it system wide, you will have to copy the redland-java.jar file to somewhere in your java CLASSPATH and the shared library libredland-java.so to somewhere in your dynamic library load path such as /usr/lib or /usr/local/lib. This varies between systems.

The Redland Java interface has been tested with J2SDK 1.3.1 and J2SDK 1.4.1_01 on Linux/x86 only. It will need customising for different operating systems since the shared library creation has been hard-coded for Linux. (This in particular will be hard to make portable).

Testing the Redland Java interface

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

  make example
  # the following asssumes you have done 'make install' for Redland
  java -classpath .:redland-java.jar example

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-2002 Dave Beckett, Institute for Learning and Research Technology, University of Bristol