Jena 2
A Semantic Web Framework
http://jena.sourceforge.net/
Hewlett Packard Laboratories, Bristol
Overview
Jena is a Java framework for writing Semantic Web applications. It
features:
- An RDF API
-
- statement centric methods for manipulating an RDF model as a set of RDF
triples
- resource centric methods for manipulating an RDF model as a set of
resources with properties
- cascading method calls for more convenient programming
- built in support for RDF containers - bag, alt and seq
- enhanced resources - the application can extend the behaviour of
resources
- integrated parsers and writers for RDF/XML (ARP), N3 and N-TRIPLES
- support for typed literals
-
- ARP - Jena's RDF/XML Parser
- ARP aims to be fully compliant with the latest decisions of the RDF Core
WG. The Jena 2.0 version is compliant with the Editor's Working Drafts at time
of release. ARP is typically invoked using Jena's read operations, but can
also be used standalone.
-
- Persistence
- The Jena2 persistence subsystem implements an extension to the Jena Model
class that provides persistence for models through use of a back-end database
engine. Jena2 is largely backwards-compatible for Jena1 applications with the
exception of some database configuration options. However, the persistence
subsystem has been largely reimplemented for Jena2. In particular, Jena2 uses
a different database layout than Jena1 that enables trade-offs between
retrieval time and disk space usage. Jena2 also supports a Fastpath capability for RDQL queries that
dynamically generates SQL queries to perform as much of the RDQL query as
possible within an SQL database engine. See the
persistence documentation for more details.
-
- Reasoning Subsystem
- The Jena2 reasoner subsystem includes a generic rule based inference
engine together with configured rule sets for RDFS and for the OWL/Lite subset of OWL Full.
These reasoners can be used to construct inference models which
show the RDF statements entailed by the data being reasoned over.
The subsystem is designed to be extensible so that it should be possible to
plug a range of external reasoners into Jena, though worked examples of doing
so are left to a future release.
See the reasoner documentation
for more details.
Of these components, the underlying rule engine and the RDFS configuration should
be reasonably stable. The OWL configuration is preliminary and still under development.
-
- Ontology Subsystem
- The Jena2 ontology API is intended to support programmers working
with ontology data based on RDF. Specifically, this means support for
OWL, DAML+OIL and RDFS. A set of Java abstractions extend the generic
RDF Resource and Property classes to model more directly the class and
property expressions found in ontologies using these languages, and
the relationships between these classes and properties, and the individuals
created from them. The ontology API
works closely with the reasoning subsystem to derive additional information
that can be inferred from a particular ontology source. Given that ontologists
typically modularise ontologies into individual, re-usable components,
and pulish these on the web, the Jena2 ontology subsystem also includes a
document manager that assists with process of managing imported ontology documents.
See the ontology documentation
for more details.
-
- RDQL query language
- RDQL is a query language for RDF data. The implementation
in Jena is coupled to relational database storage so that optimized
query is performed over data held in a Jena relational persistene
store.
- See RDQL Tutorial.
Also see RDQL_Usage.html,
RDQL_Examples.html and
rdql_grammar.html for condensed
documentation.
Documentation
Documentation is to be found in the doc/ directory
of the Jena download.
The latest documentation is available at
http://jena.sourceforge.net/.
Installation
- unzip the distribution file into a convenient directory, JENAROOT.
- set the Java classpath to include all the JAR files in the JENAROOT/lib/
directory
JENAROOT/lib/jena.jar
JENAROOT/lib/xercesImpl.jar
JENAROOT/lib/xmlParserAPIs.jar
JENAROOT/lib/icu4j.jar
JENAROOT/lib/concurrent.jar
JENAROOT/lib/jakarta-oro-2.0.5.jar
JENAROOT/lib/antlr.jar
JENAROOT/lib/junit.jar
JENAROOT/lib/log4j-1.2.7.jar
JENAROOT/lib/rdf-api-2001-01-19.jar
- Test the distribution by running the regression tests, either:
ant test // if you have ant configured to run junit
test.bat // on windows
. test.sh // on unix
The tests should all pass. If you are
behind a firewall, you may have to configure a proxy for some
of the tests - see below for the appropriate properties.
Applications
The Jena distribution includes some convenience applications.
jena.rdfcopy
will read an RDF file in either RDF/XML, N3 or
n-triple format and write it to standard out in either RDF/XML, N3 or n-triple
format. It can be used to translate between different RDF serialization
formats.
jena.rdfcompare
will read two RDF files, in either RDF/XML, N3
or n-triple format and test whether they are equal.
jena.rdfquery
will execute an RDQL query on an RDF data file,
in either RDF/XML or n-triple format and print the table of results in text or
HTML. It can also be used to query a Jena model held in a BerkeleyDB
persistent store.
jena.rdfparse
is command line interface to the ARP RDF/XML
parser.
jena.n3
is a command line interfacec to Jena's N3 parser.
jena.schemagen
takes and RDF Schema or OWL ontologies and generates
Java
source code for a constant class containing constants for all the classes and
properties defined in that schema.
These programs can be set use use a proxy to traverse a firewall by setting
system properties. To use a socks proxy include the following in the command
line:
-DsocksProxyHost=<your-proxy-domain-name-or-ip-address>
To use an http proxy include the following on the command line:
-DproxySet=true -DproxyHost=<your-proxy> -DproxyPort=<your-proxy-port-number>
License
Jena is distributed under a BSD-style open source license.
It includes software developed by the Apache Software Foundation
(http://www.apache.org/), both in the form of jar files and source code.
Acknowledgements
Jena is built on top of other sub-systems which we gratefully
acknowledge: