RDF processing tools in Java
Corneliu Dicusar, Petru Rebeja
Web Application Development papers,
Faculty of Computer Science,
Abstract. This paper presents a comparison of several tools for RDF processing
in Java taking in account the following aspects: storage, SPARQL support,
support for developers and copyright.
Keywords: RDF, Java, RDFSchema, SPARQL, METAMorphoses, Jena, JRDF
RDF1 became a key concept in knowledge interchange on the Web  nowadays and
one of the briks on which Semantic Web2 will be build. It allows software tools to
link data with their semantics rather than just acknowledge their existence without
further knowledge of means of data interpretation. Thus, RDF pushes the immense
collection of data stored today on the Web to a new, higher level towards Semantic
Web. Still, RDF in essence isn’t but just a framework for metadata. In order to use
this framework, developers need tools to do so. This paper presents a short
comparison of RDF processing tools in Java. The comparison will be made on how
RDF triples are stored, whether the specified tool provides SPARQL3 support, how
well it is documented for developers and it’s copyright. Each of these aspects will be
presented in a separated section of this document, all these sections being preceded by
a section containing a short description of each tool.
In order to comprise the notions of this document, the reader must be accustomed to
the following notions:
2 Corneliu Dicusar, Petru Rebeja
2 Java tools for RDF processing
Although there are a lot more tools for RDF processing in Java, this paper presents
only the three most popular of them. These are:
─ METAMorphoses4 developed by Martin Švihla5. It is a tool designed for
transforming data from a relational database into RDF documents, according to
mapping. It uses schema mappings and template documents written in XML
languages. It can be used as a common Java Library. This is not an actual RDF
handling tool, but we have chosen it, as an example of a very useful idea.
─ Jena6, from Hewlett-Packard, is a framework designed for building Semantic
Web applications. It offers the tools to handle RDF, RDFS, OWL, SPARQL,
and more, including a build in inference engine.
─ JRDF7, developed by Andrew Newman, a library that gives a simple user
interface following RDF standard for creation and management for RDF graphs.
3 Storing the triples
─ METAmorphoses transforms data stored in a relation database into RDF triples,
so it is natural that these triples appear in XML format. It takes the schema of
the database, and adapts it to an existing ontology. A great example is given by
the authors . Having a simple database schema:
PERSON(#id, id_department,username, first_name,
And given the corresponding ontology:
RDF processing tools in Java 3
A corresponding example of mapping would be:
<Class > <ClasstemplateName="person"rdfLabel="Person"
FROM person p, department d WHERE d.id =
─ Jena, creates RDF models, the simplest way is by creating a default one:
ModelFactory.createDefaultModel(), and these models are stored in
─ JRDF stores these triples in a manner similar to Hibernate, as Java Object Api.
Being able to talk directly to a triple store in a common manner with the ability
to swap differing implementations is one of the key aims of the project.
4 Corneliu Dicusar, Petru Rebeja
4 SPARQL Support
─ METAmorphoses does not have a support for SPARQL.
─ Jena uses ARQ8, a query engine that supports SPAQRL. ARQ offers support
for standard SPARQL, and some extensions like SPARQL algebra, also other
features such as:
o Free text search via Lucene9
o Support for custom filter functions
o Property functions for custom processing of semantic relationships
o Aggregation, GROUP BY and assignment as SPARQL extensions
o Support for federated query
o Support for extension to other storage systems
─ JRDF offers even a separate GUI that makes handling the SPARQL queries
easier, the results being displayed in a tabular form. It also contains the package
org.jrdf.sparql that implements it. And implements the interface
SPARQLConnection - that offers a connection through which to send the query,
and extends the class: DefaulSPARQLConnection and SPARQLQueryBuilder,
which builds queries from string format into Query objects.
5 Support for developers
─ METAmorphoses has a small description on the official site, and also some
examples can be found in the documentation manual. Though the example is
analyzed in an intuitive manner, and working with the tool is like using a simple
Java Library, it doesn’t provide enough information for building complex
applications right away.
─ Jena is documented well enough. Detailed information can be found on the site.
Also they offer support, and if a question appears, one can address it to the
─ JRDF is also well documented and structured into a tree-like hierarchy
containing all included packages. A very useful thing for a developer who wants
to use this tool
All of these tools can be used as Java libraries in a common way. In addition, JRDF
offers a simple GUI.
RDF processing tools in Java 5
5.3 Learning curve
The learning curve of these tools is common with the learning of other Java Libraries.
Naturally JRDF and Jena, being much more complex, take more time to get used to.
But once classes and functions are learned, you encounter little problems, also due to
the excellent documentation. If you don’t want to use the JRDF API, you could just
instead use JRDF GUI that shortens the time you need to spend, before using the tool.
Unfortunately, until now, no discussion forums were found for these tools using a
5.4 Copyright terms
─ METAmorphoses is being developed under the Lesser GPL licence10.
─ Jena is under the licence of Hewlett-Packard Development Company
─ JRDF is under BSD-Licence11
Semantic Web is becoming more and more of a reality, and no technology that is
oriented on building software for the Web (with or without a capital w), can afford
ignoring this fact. RDF is a key concept in Semantic Web so it’s only natural that
tools for RDF processing are developed. Java, being one of the most popular
programming languages nowadays, definitely needs such tools. With the need comes
expectance, with expectance comes evolution. The three tools illustrated in this paper
are the most promising (from the author’s point of view) ones in becoming
indispensable libraries for building applications for Semantic Web.
2. METAmorphoses v0.2.1: mapping and template language documentation,