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 is very likely to be required to declare 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 # optional make check
(the make check may fail without the files being installed)
To install it system wide do this as root (or maybe via sudo make install):
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 is beta quality - the object based API is present but not been used extensively. The API has been has been tested with the following versions:
1.4.2-p5 on FreeBSD/x86
1.4.2 on Linux/x86
1.4.1_01 on Linux/x86
1.4.1 on OSX/PPC
1.2.1 on Solaris/Sparc
The JNI header and library files are in different places on all systems so the --with-jdk may need to be used to give the location of the root of the full JDK installation if it cannot be found by the paths that the configure program knows of. This should then find the JNI header files in the include and include/system sub-directories (such as "solaris" or "linux").
There is an example Java 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
The Java API is an object-based API reflecting the same structure of the Redland objects with simple mappings between them:
Concept | Redland Class | Java Class | Purpose |
---|---|---|---|
Resource / Literal | librdf_node | org.librdf.redland.Node | RDF Model & Syntax nodes |
Statement / Triple | librdf_statement | org.librdf.redland.Statement | RDF Model & Syntax arcs (statements, triples) [isa Resource] |
Model | librdf_model | org.librdf.redland.Model | Set of Statements usually held in one Storage. |
Storage | librdf_storage | org.librdf.redland.Storage | Storage for Models either persistant or in-memory. |
Stream | librdf_stream | org.librdf.redland.Stream | Providing sequences of Statements from Parsers, queries. |
Parser | librdf_parser | org.librdf.redland.Parser | Syntax parsers delivering Stream of Statements or writing to a Model |
Serializer | librdf_serializer | org.librdf.redland.Serializer | Serialize Models into various syntaxes such as RDF/XML. |
Iterator | librdf_iterator | org.librdf.redland.Iterator | Enumerating lists (of Node) from queries. |
URI | librdf_uri | org.librdf.redland.URI | Provides URIs for Resources, Parsers, ... |
World | org.librdf.redland.World | RDF wrapper class handling Redland startup/shutdown | |
Digest | librdf_digest | Internal content digest class | |
Hash | librdf_hash | Internal key:value maps class |
Copyright (C) 2001-2005 Dave Beckett, Copyright (C) 2001-2005 University of Bristol