3.2.1 Generation of Class Libraries
The creation of custom Java classes that map to the
Ontology classes is not a trivial process but one can
manually create them. However, there exists code
generators that can be used to ease this rather intri-
cate process. This Java code generation capability
does exist within the Prot
´
eg
´
e-OWL editor and it was
used for the generation of the Access Class Libraries
used for the development of this system. Several other
code generators exist; examples include OWL2Java
and Jastor (Zimmermann, 2009; Szekely, 2009). The
primary reason for the use of a Java class code genera-
tor was to delegate this task to mechanisms that would
do it instantly and hence save considerable amounts
of time. However, the code was then manual ex-
amined to identify omissions and physically amend
faults. These code generators are designed to create
a set of Java interfaces and implementation classes
from OWL Ontologies such that an instance of a Java
class represents an instance of an OWL class within
the Ontology. As will be discussed in the section that
follows the code generators may not represent all the
classes and constraints within the Ontology solely be-
cause of the difference between Java and OWL. Man-
ual inspection of the generated code and writing of
the omitted concept may still have to be performed.
3.2.2 OWL to Java Mismatches and their Fixes
It would have been ideal to have a one-to-one map-
ping of the Java classes to the OWL Ontology
classes including their properties and asserted restric-
tions. However due to significant differences inherent
within these languages this may not be attainable and
therefore alternative ways need to be devised to min-
imize the impact of these differences. One of the ma-
jor omissions by the code generator in our case was
a someValuesFrom restriction placed on several data
and object properties. The purpose of this restriction
was to constraint the creation of property values to
certain pre-listed classes and class instances. This im-
plies enumerated classes. Enumerated classes are ig-
nored by code generators since they are anonymous
classes. This has little impact on our system since our
primary focus is not on the creation of Ontology in-
stances but rather their use to drive the development
of a compositional system and in the cases where the
population of the Ontology is done through an On-
tology editor like Prot
´
eg
´
e this limitation would not
be applicable. It would however be quite important
for an application that alters the Ontology instances
to handle this variation.
We do however recognize solutions and mappings
provided in (Kalyanpur et al., 2004). The paper sug-
gests two rather simple solutions. The first solution
involves the definition of an enum, struct or a list ob-
ject that contains possible values for the property. The
method that creates the property value will then loop
through the enum checking to see if the new value is
one of the possible values contained in the enum. The
second solution is somewhat similar to the first one
but it instead makes use of listeners registered on the
restricted property which are invoked every time the
property is changed.
Java is a single inheritance object oriented lan-
guage while OWL is a very rich and highly expressive
description logic based language that supports multi-
ple inheritance. Java does not support what may be
referred to as multiple implementation inheritance. It
however allows a class to implement multiple inter-
faces. This is a feature that can be exploited to model
classes that have two or more super-classes. We have
however, managed to get away with not using multi-
ple inheritance in the implementation of our Ontolo-
gies so this remains a feature that can be explored
should the Ontology evolve and have classes that in-
herit from several other classes.
3.3 Data Flow
Our idea revolves around pulling already existing al-
gorithms and connecting them into a functional sys-
tem. We therefore developed a framework to facil-
itate this connectivity and the flow of data between
algorithms. This was achieved by developing a col-
lection of classes that defines a TaskGraph, Task,
Nodes and Connectors. A Task is a representation
of a unit that performs some function. For the pur-
pose of this prototype system this can be in the form
of an algorithm, a converter or any of the architectural
elements. A Task is created when the user chooses
an algorithm or when an architectural element is in-
voked to provide for compatibility of the algorithms.
A TaskGraph on the other hand is a collection of con-
nected tasks. Nodes represent the inputs and outputs
to an algorithm, converter or an element. They can
take the form of file input and output nodes, standard
input or output stream nodes, socket nodes and pa-
rameter nodes. We also define a Connector class that
describes methods needed to establish a connection
between algorithms. The possibility or absence of a
connection being established between selected algo-
rithms depends upon the compatibility of these out-
put and input nodes. The connectivity also depends
upon the availability of a glue component (either a
converter or element) that will be placed in between
the algorithms in case the algorithms nodes are in-
compatible.
KEOD 2009 - International Conference on Knowledge Engineering and Ontology Development
258