DAML+OIL support in Jena 1.2.0

Introduction

Beginning with version 1.2.0, Jena now includes support for processing DAML+OIL documents. DAML+OIL is an emerging standard for encoding ontologies for use by web and other online services, agents, digital libraries or meta-data repositories. DAML+OIL defines a conceptualisation for the terms used in, say, an RDF document. It shares some motivations with RDF Schema, but differs by being more powerful in what it can represent, and in having a well-defined formal semantics. Full details of DAML+OIL can be found on the DAML web site: www.daml.org.

Formally, the semantic basis for DAML+OIL is a description logic. In order to produce the full range of inferences that can be correctly made from a set of DAML+OIL statements, a description logic reasoner is required. The current Jena support for DAML+OIL does not do this. We imagine a layered architecture, such as:

Description logic reasoner
DAML+OIL convenience wrappers
RDF store
Currently, Jena provides the RDF storage mechanisms, and the com.hp.hpl.jena.daml package provides DAML+OIL convenience support. A future release of Jena may include one or more reasoning components. The intent is that the convenience wrappers will allow programmers to more easily use such parts of the DAML+OIL specification as can be used without recourse to a reasoning engine.

The design goals for the DAML+OIL support are to build upon the mechanisms provided Jena to manipulate RDF statements, and, in addition provide the following support to programmers wishing to process DAML documents:

Current limitations

DAML+OIL support in this release of Jena should be considered alpha quality. Known limitations include:

Getting started

To create a model that is known to contain DAML objects, use the DAMLModel implementation class DAMLModelImpl, to read one or more DAML documents from a URL:

    DAMLModel m = new DAMLModelImpl();
    m.read( "http://www.daml.org/2001/03/daml+oil-ex.daml" );
    if (! m.getLoadSuccessful()) {
        System.err.println( "Failed to load DAML document!" );
    }
Note, several different variants of the read() method exist, check the JavaDoc for details.

The read process will evaluate each RDF resource and property loaded, to see if it matches one of the known DAML values. If so, the standard RDF resource or property will be replaced with a sub-class that exploits knowledge of the DAML+OIL specification. These specialised resource classes are:

In addition, a common root class DAMLCommon acts as a super-type for all DAML+OIL convenience classes, and defines a number of shared utility methods.

These specialised resources and properties can be accessed by name, via lookup methods on DAMLModel. For example, to get the DAMLClass that corresponds to Person in the example document, assuming model m is initialised as above:

    String ns = "http://www.daml.org/2001/03/daml+oil-ex#";
    DAMLClass clsPerson = (DAMLClass) m.getDAMLValue( ns + "Person" );
The set of super-classes of Person can then be iterated over, using the information from the underlying DAML+OIL model:
    for (Iterator i = clsPerson.getSuperClasses();  i.hasNext(); ) {
        System.out.println( "Class " + clsPerson + " has super-class " + i.next() );
    }

In general, properties that are defined in the DAML specification, such as comment, label, subClassOf, etc, can be accessed via pre-defined accessors on the corresponding DAML class. In general, there are five common operations we wish to perform given a property of a resource: get the value, get all values, remove all values, remove one value, count, and add a value. To reduce the explosion in the set of methods on each DAML+OIL convenience class, these common operations have been condensed into a utility class called a property accessor. Property accessors are uniformly exposed from a convenience class by a method prop_XXX, where XXX is the property name. Thus, to count the number of comments on a given DAMLClass object, we have:

    System.out.println( "No of comments = " + clsPerson.prop_comment().getCount() );
Thus, a DAML convenience class with N standard properties exposes only N property accessors, rather than 6N individual methods. This is particularly noteworthy in DAMLRestriction, which has eleven standard properties, thus eleven accessors rather than 66 "convenience" methods!


CVS info: $Id: daml-intro.html,v 1.1 2001/09/26 11:46:23 ijd Exp $