Previous Topic

Next Topic

JRDF Tutorial

JRDF is a set of APIs that provide a concise implementation of the Resource Description Framework (RDF) using standard Java conventions. JRDF offers a highly modular and type safe interface allowing users to create, store and query RDF statements. It includes a default memory implementation that can be used in conjunction with MulgaraTM to provide a scalable RDF solution.

The example code provided in this tutorial is from the org.jrdf.mem.JRDFExample class. The JRDFExample class uses an in-memory JRDF graph implementation and can be run by typing at a command line:

java -cp <TKS installation directory>/driver-2.1.jar org.jrdf.mem.JRDFExample

The code for JRDFExample is in the Resources directory of your TKS installation. The JRDF API documentation is in <TKS install>/docs/api/jrdf.

There are four JRDF graph implementations to choose from:

  1. JRDF graph (memory graph)

    The JRDF jar provides a memory implementation under 60Kb and is available for download from http://sourceforge.net/projects/jrdf/. The memory graph is easy to create and is useful for small graphs and caching of results from larger graphs (subgraphs). The classes are in the org.jrdf.graph.mem package of the JRDF jar.

  2. Server-side JRDF Graph (server graph)

    Mulgara provides a server-side JRDF Graph interface for accessing a model. The graph must be created in the same JVM that the Mulgara server is running in.

    Server graphs can be used for direct access to the database using a graph API. This is useful for applications that use Mulgara as an embedded component. The server graph classes are in the org.mulgara.jrdf package of the server jar.

  3. Server backed JRDF graph (client graph)

    Mulgara also provides a client-side JRDF graph interface for accessing a model. This provides a scalable RDF solution for remote client applications.

    Client graphs can be used in conjunction with memory graphs. Memory implemented nodes and triples can be inserted into, removed from and used to query client graphs. Other JRDF implementations can also be used, but may not be supported. The client graph classes are in the org.mulgara.client.jrdf package of the Driver jar.

  4. Read-only iTQL result JRDF graph (iTQL graph)

    Mulgara also allows you to create read-only JRDF graphs from the results of an iTQL query. This provides a powerful mechanism for displaying search results as a subgraph. The classes are in the org.mulgara.client.jrdf package of the Driver jar.

Each of these JRDF graph implementations are outlined in the following sections.

In This Section

Prerequisites

Obtaining a Session from a Mulgara Server

Comparison of JRDF Graph Implementations

Creating the Graph

Creating Nodes and Triples

Adding Triples to the Graph

Searching the Graph

Reify Triples

Removing Triples from the Graph

See Also

Integration Tutorials

HTTP Resolver and MP3 Content Handler Tutorial

Jena

Perl

JavaServer Pages Tag Library

Open Source logo

© 2001-2004 Tucana Technologies, Inc. Some rights reserved.

© 2006 The Mulgara Project. Some rights reserved.
Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the section entitled "GNU Free Documentation License".