You are on page 1of 8

I n t e l l i g e n t I n f o r m a t i o n P r o c e s s i n g

Using JessTab to
Integrate Protégé
and Jess
Henrik Eriksson, Linköping University

D evelopment environments for ontology definition and knowledge modeling

require integration with other types of software—for example, to communicate

with and control external programs. External programs must sometimes control a devel-
Integration with
opment environment. For example, it is often useful to create programs that perform
external systems, such
operations on ontologies or modify a knowledge base mapping between these tools’ knowledge represen-
as problem solvers, is in certain ways. We might want to define rules that tation schemes, JessTab lets us build knowledge
trigger actions after matching knowledge base pat- bases in Protégé that work with Jess programs and
becoming increasingly terns, or run a problem-solving method and record rule bases. JessTab can also propagate modifications
the results in a knowledge base. Integrating devel- automatically to mapped Protégé instances on Jess.
important for ontology opment environments with other software is a criti-
cal factor for using these systems in a range of orga- JessTab integration model
development and nizations and a key to widespread acceptance of such A Jess engine running inside the Protégé frame-
environments. work is the basis for the JessTab integration model
knowledge-modeling Protégé1 is a popular, modular ontology devel- (see Figure 1a). Because Protégé and Jess are imple-
opment and knowledge acquisition tool. It produces mented in Java, we can run them together in a single
tools. The author’s output (that is, ontologies and knowledge bases) that Java virtual machine. This approach lets us use Jess
other programs can read. Protégé assumes that the as an interactive tool for manipulating Protégé
JessTab extension system’s performance engine runs as a separate pro- ontologies and knowledge bases. Furthermore, we
gram, perhaps on a different platform. This separa- can propagate changes in Protégé to Jess (for exam-
lets you write Jess tion is often advantageous because the development ple, by monitoring Protégé events).
and runtime environments are different. Neverthe- There are several alternative approaches to inte-
programs that manage less, tight integration with the performance engine grating systems such as Protégé and Jess. The main
is sometimes essential. Currently, we can access considerations are as follows:
Protégé ontologies and Protégé knowledge bases using Java and an appli-
cation-programming interface, but doing so is time • Information transfer. We can transfer information
knowledge bases. consuming. between systems in different ways. Loosely cou-
I built a plug-in called JessTab (www.ida.liu.se/ pled systems use files to communicate asynchro-
~her/JessTab), which integrates Protégé with Jess, a nously. Other systems communicate directly
light, fast rule engine and scripting environment. (See through network connections (such as TCP/IP
the “Background” sidebar on page 46 for more streams, Corba, and remote method invocation).
detailed information on Jess, Protégé, and the Pro- Tightly coupled systems try to integrate the soft-
tégé Axiom Language.) By creating a declarative ware (for example, by merging source code).

MARCH/APRIL 2003 1094-7167/03/$17.00 © 2003 IEEE 43


Published by the IEEE Computer Society
I n t e l l i g e n t I n f o r m a t i o n P r o c e s s i n g

Jess models. It also provides limited back-


ward compatibility with Clips, which is a
Protégé knowledge predecessor of Jess implemented in C,
base Protégé because Jess rules can match resulting facts
JessTab knowledge
functions in the same manner Clips rules match objects
base API
Protégé Jess (see the sidebar for more information).
Jess engine The design philosophy behind JessTab is
to make the use of Protégé and Jess seam-
Jess fact base
less—that is, the systems should appear
tightly integrated to users. However, our goal
(a) (b) (c) is not to integrate their source code, because
that is impractical: the Protégé and Jess
Figure 1. Aspects of the JessTab integration model. (a) The Jess engine runs as a implementers are actively developing their
Protégé plug-in. (b) JessTab maps instances of the Protégé knowledge base to Jess systems and releasing major and minor revi-
facts. (c) JessTab provides functions for managing Protégé knowledge bases. sions. The JessTab distribution is a plug-in
(Java archive, jar, file) to both Protégé and
Jess, which works with a range of Protégé
and Jess versions. JessTab does not modify
• Integration modeling. There are different tious approach might try to add function- Protégé or Jess. In addition to the mapping
ways to reconcile the knowledge repre- ality beyond the original system features. between the representation models, JessTab
sentation models that systems use. Chang- provides a set of additional Jess functions for
ing or extending them might be necessary. JessTab integrates the knowledge rep- managing ontologies and knowledge bases
The models employed by frame- and rule- resentation models by mapping Protégé (see Figure 1c). JessTab also adds graphical
based systems are fundamentally different instances to Jess facts (see Figure 1b). This tools to make rapid editing of Jess programs
and are sometimes difficult to bring representation of instances as facts in Jess in Protégé easy.
together. lets us effectively write Jess rules that
• Design considerations. There are several match instance patterns. In the Protégé frame JessTab implementation
possible design philosophies for integrat- model, classes, slots, and facets are them- JessTab provides a Jess console window
ing systems. For example, a minimalist selves instances. So, it is sufficient to map in the Protégé environment (see Figure 2).
design tries to make as few changes and Protégé instances to facts. This mapping We can easily switch between the Jess read-
extensions as possible, whereas an ambi- approach fits well with both the Protégé and evaluate-print dialogue and the normal
graphical interaction with Protégé. To make
Jess development in the Protégé environ-
ment easier, JessTab implements graphical
inspectors for Jess facts and definitions
(rules, functions, defglobals, deftemplates,
and deffacts). These inspectors facilitate Jess
code navigation and definition editing.
In addition to the graphical tools, JessTab
extends Jess and Protégé functionality in five
areas: It

• Provides the two functions mapclass and


mapinstance that map Protégé knowledge
bases consisting of instances to facts in the
Jess fact list
• Adds several functions to Jess that let Jess
programs query and manipulate Protégé
knowledge bases
• Implements message handlers and meth-
ods for the Protégé frame system, with
functionality similar to corresponding
Clips features
• Adds functions that examine and modify
the Protégé ontology
• Mirrors Jess definitions in Protégé knowl-
edge bases; instances represent Jess defi-
Figure 2. A Jess console window as a Protégé tab. nitions, such as rules and functions

44 computer.org/intelligent IEEE INTELLIGENT SYSTEMS


Mapping Protégé knowledge classes by enumerating them explicitly. format to specify communication with native
bases to Jess facts For example, the pattern (object (is-a Person| Java classes.) The make-instance function lets
A core component of Protégé–Jess inte- Customer|Employee)) matches instances of the us create an instance of a specified class in
gration is the mapping mechanism. This Person, Customer, and Employee classes. This type the knowledge base and, optionally, provide
approach makes it possible to mark classes of pattern is especially useful if we want initial slot values for it. Using defclass and
in the ontology for mapping to Jess facts. By to identify classes in different parts of the make-instance, we can experiment with creat-
using the expression (mapclass <class-name>), we ontology. ing instances and then map them to facts. The
can map all instances of the specified class An alternative approach to multiclass following example illustrates how we create
to Jess facts. The mapclass expression applies matching is to use an expression to define a Person class and a person instance named
to direct and indirect instances—for exam- the matching classes. We can use the func- John:
ple, instances of subclasses. An alternative tion superclassp to test if a class is indeed
to the class-mapping mechanism is to map another class’s superclass. We can then use Jess> (defclass Person (is-a :THING)
a specific instance to a fact through the rule patterns that match direct and indirect (slot name (type string))
expression (mapinstance <instance>). An impor- instances of a class—for example, (object (is-a (slot age (type integer)))
tant design goal for the JessTab mapping Person|?c&:(superclassp Person ?c)) (name “John”)). In TRUE
mechanism is letting Jess rules pattern- this case, Jess binds ?c to the class name and Jess> (make-instance john of Person (name “John”)
match on mapped instances. We can then calls the superclassp function. (age 20))
write rules that fire when the appropriate <External-Address:SimpleInstance>
conditions in the Protégé knowledge base Jess> (mapclass Person)
are met. For example, mapping the class Person
Person, which has a single instance repre-
senting John, age 20, results in a Jess fact The motivation for designing this The mapclass expression marks the Person class
with the format (object (is-a Person) (name “John”) as mapped, and it will assert facts of the
(age 20)). This fact represents the instance type of mapping to facts is that instances (direct and indirect) of Person. After
with its slot values for name and age. (I sim- the mapclass operation, we can check the
plified the fact in this example for clarity;
the actual fact holds additional information
it lets us define Jess rules that resulting Jess fact:

Jess> (facts)
about the instance.)
JessTab asserts facts based on a certain
pattern-match on mapped f-0 (object (is-a Person) (is-a-name “Person”)
pattern (template). The pattern starts with (OBJECT <External-Address:SimpleInstance>)
object and always contains the class name and instances in many ways. (age 20) (name “John”))
a direct reference to the Protégé object. As For a total of 1 facts.
the example shows, the instance’s slot–value
pairs are also part of the fact. The mapping This fact represents the instance of the class
mechanism asserts a fact for every instance Mapping from instances to facts is uni- Person we created. In addition to the class name
(of a mapped class). Creating a new instance directional because changes to the Jess fact and the slot–value pairs, the fact contains a
of the class Person, for example, will result in list, such as fact assertions, are not propagated reference to the actual Protégé instance (the
the assertion of a new fact matching the back to the Protégé knowledge base. How- Java object representing it). This reference is
instance. ever, we can make changes to the knowledge useful when defining rules that perform oper-
The motivation for designing this type of base from Jess by calling functions that oper- ations on the object in the action part. The is-
mapping to facts is that it lets us define Jess ate on knowledge base constructs. a-name value is a string version of the class
rules that pattern-match on mapped instances name, which is useful in some rule patterns.
in many ways. For example, we can write Knowledge base operations Because the class Person is marked as
rules that match instances regardless of their from Jess mapped, changing a Protégé slot value results
class by using a wild card for the is-a prop- JessTab provides several functions for in a change of the corresponding fact. We use
erty. The pattern (object (is-a ?) (name “John”)) retrieving information from Protégé knowl- the slot-set function to change the age to 21:
matches every (mapped) instance that has a edge bases and for modifying them. Func-
slot name with the value “John.” (The charac- tions exist for getting slot values from Jess> (slot-set john age 21)
ter ? represents a wild card in patterns.) instances, defining new classes, and instan- Jess> (facts)
In addition to wild-card matching, it is tiating classes. Whenever possible, these f-1 (object (is-a Person) (is-a-name “Person”)
often useful to define rules that match functions are compatible with their corre- (OBJECT <External-Address:SimpleInstance>)
instances of several alternative classes. The sponding Clips counterparts (if any). (age 21) (name “John”))
mapping ensures that the is-a fact slot con- How can we use JessTab to create Protégé For a total of 1 facts.
tains the unique class name for the instance classes and instances from Jess? Just as in
(as a Jess atom). Fortunately, Jess provides a Clips, we can use the defclass construct to cre- When we change a fact property, Jess actu-
rich language for rule patterns, which lets us ate a new class and attach slots to it. (Jess ally retracts the old fact and asserts a new ver-
express classes that match in several ways. also implements an alternative format for sion of it—that is, the fact number changes.
One approach is to match several alternative defclass.2 Advanced developers can use this This behavior is normal Jess semantics.

MARCH/APRIL 2003 computer.org/intelligent 45


I n t e l l i g e n t I n f o r m a t i o n P r o c e s s i n g

Background
Some background information on the current Protégé we cannot use it to define inferences and behaviors. We invoke
implementation (http://protege.stanford.edu), the comple- PAL explicitly to perform constraint checking. The result of this
mentary Protégé Axiom Language extension, and the Jess process is a report (rather than a behavior). Unlike Jess, PAL is
language (http://herzberg.ca.sandia.gov/jess) and its imple- custom tailored for expressing constraints when checking
mentation should help users understand and use the JessTab knowledge bases.
implementation. Jess and PAL are complementary languages; we can use PAL
to test a knowledge base’s integrity, whereas we can use Jess
to implement operations on the knowledge base. Because Jess
Protégé is Turing complete, we can use it to implement custom-tailored
The Protégé tool supports knowledge acquisition and knowl- constraint checkers and programs that modify the knowledge
edge base development.1 It is a powerful development and base.
knowledge-modeling tool with an open architecture. Protégé
includes an ontology editor and a system for generating and
custom-tailoring forms for data entry by domain specialists.
Jess
The user interface consists of several tabs that provide differ-
Jess2 is a reimplementation of a subset of Clips3 in Java. Jess
ent views of the knowledge base. For example, tabs exist for
implements some additional functionality not provided by
ontology editing, form layout, knowledge entry, and knowledge
Clips. Like Clips, reasoning in Jess is based on a list of known
base search. Protégé is implemented as an open-source Java
facts and a set of rules that try to match on these facts in its
application.
fact base.
An important feature of Protégé is the possibility to extend
Facts are basically a list of known values, such as (temperature
its functionality through plug-in modules. By defining slot-
outdoor 25), which represents the value 25 for the temperature at
widget plug-ins, we can extend the functionality of data entry
the outdoor location. The rules’ preconditions are patterns
widgets (for example, by implementing new interaction modes).
with wild cards and conditional expressions, which match such
The mechanism for tab-widget plug-ins lets us add new tabs to
facts. For example, the pattern (temperature ? ?t&:(> ?t 20)) matches
the Protégé user interface. Developers often use this plug-in
temperatures greater than 20, while ignoring the location.
application programming interface to implement project-
Rules can assert new facts when they fire, which in turn could
specific tabs that provide unique views of the knowledge base.
result in other rules firing. Jess uses the Rete algorithm to ensure
The Protégé Java API lets us control the ontology’s internal
efficient pattern matching and rule activation. Jess supports
representation. For example, we can create new classes and
mainly forward chaining and, to some extent, backward chaining.
instances programmatically. Although we can use this API to
Integrating Jess with other Java programs is easy because it
manage all aspects of the Protégé internal representation,
has a well-defined API for controlling the reasoning engine
doing so is complicated because of the API’s flexible but low-
from Java. For example, Java programs can send expressions to
level nature.
the Jess engine for evaluation. In addition, we can define new
The tool has no performance engine, so we must use proce-
Jess functions in Java. The JessTab implementation takes advan-
dural Java code to access the API.
tage of the Jess API to map information in the Protégé knowl-
edge base to Jess facts and to extend Jess with additional func-
tions for communication with Protégé.
Protégé Axiom Language
PAL is a language for expressing constraints in Protégé
knowledge bases. It is based on first-order predicate logic. PAL References
lets us define constraints that the PAL interpreter can check.
Once the knowledge base under development is in a reason- 1. J.H. Gennari et al., “The Evolution of Protege: An Environment for
ably coherent state, we can invoke the PAL engine to check Knowledge-Based Systems Development,” Int’l J. Human–Computer
consistency with respect to the constraints. PAL then reports Studies, vol. 58, no. 1, 2003, pp. 89–123.
any constraint violations. PAL is implemented as a tab-widget
2. E.J. Friedman-Hill, Jess in Action: Java Rule-Based Systems,
plug-in to Protégé. Manning, 2003.
The main difference between JessTab and PAL is that JessTab
lets us use Jess as a programming language and inference 3. CLIPS Reference Manual, Software Technology Branch, Lyndon B.
engine. PAL, however, is not a programming language because Johnson Space Center, NASA, 1991.

Creating a second instance adds a new fact f-1 (object (is-a Person) (is-a-name “Person”) Because the mapping of the class Person is
to the Jess list of facts: (OBJECT <External-Address:SimpleInstance>) reactive, JessTab asserts a new fact automat-
(age 21) (name “John”)) ically when we create a new instance.
Jess> (make-instance sue of Person (name “Sue”) f-4 (object (is-a Person) (is-a-name “Person”) We can now write a Jess rule that pattern-
(age 22)) (OBJECT <External-Address:SimpleInstance>) matches on the facts. The following rule
<External-Address:SimpleInstance> (age 22) (name “Sue”)) prints the name for every person age 21 or
Jess> (facts) For a total of 2 facts. older:

46 computer.org/intelligent IEEE INTELLIGENT SYSTEMS


Jess> (defrule twentyone (defmessage-handler Person incrementAge (?i) resemblance to make it easy for Clips devel-
(object (is-a Person) (name ?n) (age ?a&: (slot-set ?self age (+ (slot-get ?self age) ?i))) opers to start using Protégé and JessTab and
(>= ?a 21))) to facilitate porting Clips code.
=> lets us send messages to instances of the
(printout t “The person ” ?n “ is 21 or Protégé class Person. The expression (send john Ontology integration
older” crlf)) incrementAge 1) sends the incrementAge message JessTab lets Jess programs integrate with
TRUE to the john instance. In this case, the message Protégé ontologies. There are several ways
Jess> (run) handler then adds 1 to the value of the slot in which Jess programs can examine and
The person John is 21 or older age of the instance john. manipulate ontologies. Let us consider four
The person Sue is 21 or older Methods are similar to message handlers in aspects briefly:
2 that they let us define behavior for instances.
Jess> However, the method dispatcher can consider • Ontology reflection. Jess programs can
several parameters, and the methods can over- reflect on the makeup of Protégé ontologies.
This rule format lets us write rules that per- load existing functions. For example, the method Built-in functions, such as class-subclasses, can
form object matching in several different discover an ontology’s structure. These
ways. For example, we can write rules with (defmethod >= ((?p Person) (?q Person)) functions let us develop Jess programs that
constraints or wildcards for the class name. (>= (slot-get ?p age) (slot-get ?q age))) analyze ontologies.
The action part of the rules can perform rea- • Metalevel objects. Protégé provides ad-
soning tasks, such as asserting new facts and vanced support for metalevel objects.3 For
making changes to slot values. Note that the example, classes are instances of meta-
rules’ format is similar to the Clips rule for- classes. Slots and facets are instances as
mat for pattern matching on objects. Although the Clips legacy well. JessTab supports these metalevel
To actively modify the knowledge base, we objects by letting programs create new
need functions for accessing and modifying val- facilitates the Protégé and Jess classes by instantiating a metaclass (for
ues in Protégé. The functions slot-get and slot-set example, with the make-instance function).
let us retrieve and change slot values, respec- integration, it results in • Mapping metaclasses. Because classes
tively. For example, the expression (slot-get sue behave as instances (of a metaclass) in
age) will return the age slot value for the instance
sue. The expression (slot-set sue age 23) will set the
somewhat inconsistent most aspects, we can map them to facts just
as regular instances. Thus, by mapping
slot value for age to 23. Continuing this example, classes to facts, we can apply Jess rules to
we can define a generalized rule that changes
functionality and syntax. Protégé classes. For example, we can write
the age from 22 to 23 for every person: rules that pattern-match certain classes in
a large ontology and modify them.
Jess> (defrule changeage • Definition mirroring. JessTab mirrors Jess
?o <- (object (is-a Person) (age 22)) definitions in the Protégé ontology. For
=> overloads the built-in Jess function >= and lets example, Jess defrules are mirrored as an
(slot-set ?o age 23)) us compare Person instances on the basis of instance of the system class :JESS-RULE
TRUE their age. You can use expressions such as in Protégé. These mirror instances contain
(>= john sue) to compare people’s ages. Hence, a textual representation of the Jess defin-
There are also functions for getting and the message handlers and methods complement ition (that is, the source code). Thus, Jess
setting facet values (or slot properties). We the mapping of instances to facts by providing programs can examine their own structure
can use the expressions (facet-get <class-name> elements for object-oriented programming. by inspecting the mirror instances (for
<slot-name> <facet-name>) and (facet-set <class- example, by mapping them to facts and
name> <slot-name> <facet-name> <new-value>) to Clips heritage applying rules). Furthermore, we can save
access the facets. An important consideration for JessTab these mirror instances together with the
design is the Clips heritage. JessTab tries to be rest of the knowledge base and reinsert
Message handlers and methods compatible with Clips whenever possible. In them during reload from files.
Object-oriented programming is some- some cases, compatibility is not possible
times an alternative or supplement to the because of differences between Clips and Jess Metalevel objects in Protégé fit well with
rule-based paradigm. JessTab adds support and differences between the Clips and Pro- Jess. (Note that Clips does not support meta-
for message passing, message handlers, and tégé object models. Although the Clips legacy classes or other metalevel objects at all.)
generic methods to Jess. You can use the facilitates the Protégé and Jess integration, it JessTab lets Jess programs inspect and mod-
defmessage-handler and defmethod constructs to results in somewhat inconsistent functional- ify ontologies just like instances, which result
create object-oriented programs based on ity and syntax. For example, the naming of in a superior expressive power for rules oper-
Protégé ontologies. Message handlers and certain functions, such as get-defclass-list and class- ating on the ontology.
methods in JessTab follow the same inheri- subclasses, is inconsistent. Complete source
tance model and dispatch model as Clips. For code compatibility was never JessTab’s goal. Ontology reflection
example, the message handler The JessTab additions to Jess aim at close Jess programs can reflect the structure of

MARCH/APRIL 2003 computer.org/intelligent 47


I n t e l l i g e n t I n f o r m a t i o n P r o c e s s i n g

Protégé ontologies. Functions such as class- ment. For example, such Jess scripts can cre- as slots and facets, using the same approach.
subclasses and class-slots return information about ate, modify, and move sets of classes in large For example, we can print out all slots with
the ontology’s structure. Programs that ana- ontologies. The major advantages of using a certain value type.
lyze ontologies can then use this information Jess over Java are that we can develop and Another application is to modify the ontol-
to discover ontology properties and to draw test programs quickly (through the interac- ogy (or the instances) in rule conclusions.
conclusions from the ontologies. Examples tive Jess console) and that we can use the Jess For example, the following rule changes the
of such analysis tasks are searching for cer- rule engine to write declarative programs for role to abstract for classes that have sub-
tain patterns, detecting inconsistencies, and managing ontologies. classes but do not have any instances:
generating reports. As I mentioned previously, another way
These basic reflection functions are simi- of using JessTab is to use it as the basis for a Jess> (defrule make-abstract
lar to the ones Clips provides. In JessTab, problem solver, which could then operate ?c <- (object (:NAME ?n)
however, programmers get direct access to directly on metalevel objects. (:ROLE Concrete)
the ontology as it evolves in the editor. In (:DIRECT-INSTANCES))
addition to the basic reflection functions, Mapping metaclasses (not (object (:NAME ?n)
JessTab provides a means for advanced The Protégé metaobject model and the Jess- (:DIRECT-SUBCLASSES)))
reflection. Tab support for handling classes as instances =>
apply to the JessTab mapping functions. Jess- (slot-set ?c :ROLE Abstract))
Metalevel objects
Protégé provides advanced support for The left-hand side of this rule matches
metalevel objects.3 Every class has a meta- classes where the value of the
class, and every slot has a metaslot. Protégé
users can create custom metaclasses by extend- The metalevel objects in Protégé • :ROLE slot is Concrete
ing the standard metaclass (:STANDARD-CLASS). • :DIRECT-INSTANCES slot is an empty list
Custom metaclasses can contain additional are not only useful for extending • :DIRECT-SUBCLASSES slot is not an empty list
slots, which result in new class properties and
new fields on the class-editor form. The met- the ontology editor, they are also Mapping system classes lets the Jess pro-
alevel objects in Protégé are not only useful for gram examine the ontology declaratively
extending the ontology editor, they are also the
basis for ontology reflection and modification.
the basis for ontology reflection through the list of facts rather than function
calls such as class-abstractp, slot-get, and facet-get.
Examining and manipulating such meta-
level objects is a powerful tool for ontology
and modification. Protégé’s metaobject protocol is suitable for
this task because we can view classes, slots,
management. We can handle classes as reg- and facets as regular instances and first-
ular instances in Jess and apply functions for class citizens.
manipulating instances to classes. For exam-
ple, instantiating a metaclass is equivalent to Tab can map instances of Protégé metaclasses Definition mirroring
creating a regular class. The expression to facts just as it maps regular instances to facts. JessTab adds the mirroring of Jess defini-
This functionality lets us map class defini- tions in Protégé ontologies and knowledge
(make-instance A of :STANDARD-CLASS tions—that is, instances of metaclasses—to bases. This mirroring is a reflective mapping
(:DIRECT-SUPERCLASSES :THING)) facts. The expression (mapclass :STANDARD-CLASS) from Jess to Protégé. During initialization,
maps all classes to facts. JessTab adds Jess-related system classes to
creates a new Protégé class A, which is a sub- Now we can write Jess rules that pattern- Protégé. Jess constructs such as defrule and def-
class of :THING. By setting the value of the match metaobject values. For example, the function have corresponding system classes
:DIRECT-TEMPLATE-SLOT slot of the class, we can following Jess code prints out all abstract (:JESS-RULE, :JESS-FUNCTION, and so on). Figure 3
attach slots to the class. The expression classes in the ontology: shows the system classes added by JessTab.
Instances of these classes represent actual def-
(slot-set A :DIRECT-TEMPLATE-SLOTS Jess> (mapclass :STANDARD-CLASS) initions in Jess. For example, when we define
(create$ (instance-address :NAME))) :STANDARD-CLASS a Jess rule, JessTab will automatically create
Jess> (defrule print-abstract a corresponding instance of the class :JESS-RULE.
sets the slots for the class A. The slot list now (object (:NAME ?n) (:ROLE Abstract)) Several advantages exist for mirroring Jess
consists of the (predefined) slot :NAME. Thus, => definitions in Protégé. Because the instances
we can view the defclass function as “syn- (printout t ?n “ is abstract.” crlf)) representing Jess definitions are regular Pro-
tactical sugar” for the standard metaclass TRUE tégé instances, we can edit them using forms.
instantiation. Jess> (run) Figure 4 shows the form for an instance of a
Jess can essentially perform all the ontol- Jess rule in Protégé. Furthermore, we can
ogy operations available from the Protégé The left-hand side of this rule matches map these instances to Jess facts in the same
GUI by manipulating metalevel objects. This classes (metaclass instances) where the value way we map other instances. Thus, this func-
functionality lets us use Jess as a scripting of the :ROLE slot is Abstract. In the same way, we tionality lets us write Jess programs that
language for supporting ontology develop- can pattern-match other system classes, such examine themselves.

48 computer.org/intelligent IEEE INTELLIGENT SYSTEMS


Regular instances can refer to Jess defin-
ition instances. For example, a form for
knowledge entry in Protégé can refer to a Jess
rule or a list of Jess rules. By following the
link to the rule instance, the user can edit the
rule in the rule-definition field (see Figure
4). Clicking on the Parse! button in the rule
editor results in redefinition of the construct
in the Jess engine.
Another advantage of mirroring defini-
tions is that this approach lets Protégé save
the Jess definition instances together with
other instances in the knowledge base.
Reloading the project will result in reload-
ing these instances into Protégé. Once the
Jess definition instances reload, defining
them in the Jess engine is possible.

Discussion
During the course of development, both the
user and developer communities broadened
Protégé’s scope from an environment that
mainly supported knowledge acquisition from Figure 3. Jess system classes in Protégé.
domain experts (by generating knowledge
acquisition tools) to a general tool for ontol-
ogy and knowledge base development with an
open architecture.1 The advantage of today’s
Protégé is the combined power of the plug-in
components and the ability to tailor the envi-
ronment by developing custom components.
A practical goal is for JessTab to be a use-
ful tool for projects originating from both the
Protégé and Jess communities. For the Pro-
tégé user, the JessTab extension adds a per-
formance engine to Protégé and support for
a declarative mapping between Protégé and
Jess. For the Jess developer, JessTab makes
it possible to take advantage of Protégé as a
graphical development environment and use
third-party plug-ins (tabs) added to Protégé.
A development tool and a performance sys-
tem working together is a powerful combina-
tion, and one we can use in several ways. Com-
bining graphical environments and reasoners
is not a new approach. In the mid-1980s,
hybrid tools such as KEE featured graphical
development environments. These tools, how-
ever, did not have the richness and flexibility
of current knowledge-modeling tools, and they
lacked the suppleness of the Java-based Jess
engine. JessTab lets us use the performance
system for ontology and knowledge base
Figure 4. A Jess rule as a Protégé instance. This instance represents the rule
development (for example, using Jess to query print-abstract. The instance form serves as a rule editor.
and modify ontologies). There are also recent
tools that have performance counterparts, such
as OntoEdit (which uses Ontobroker4), Web- Defining the requirements for JessTab is taining JessTab is that it combines two sys-
ODE,5 WebOnto,6 and Ontosaurus7 (which not an obvious task. A major technical chal- tems, both of which are under active and
uses Loom). lenge for designing, developing, and main- sometimes experimental development. They

MARCH/APRIL 2003 computer.org/intelligent 49


I n t e l l i g e n t I n f o r m a t i o n P r o c e s s i n g

are two separate moving targets. In addition The current users of JessTab range from
to this dynamic software environment, there ontology maintainers to agent-based systems T h e A u t h o r
are emerging user communities. The Jess and developers. For example, developers use
Protégé user communities consist mainly of JessTab for Web data mining, medical advi- Henrik Eriksson is a
researchers and developers who are design- sory systems, and implementation of problem- professor of computer
science at Linköping
ing their own systems. Our goal is to make solving methods. Currently, there are several University. He has a
future JessTab requirement specification and hundred JessTab users, most of whom are PhD in computer sci-
development a community process as much researchers and developers working on ence from Linköping
as possible. We welcome requests for addi- advanced projects with specific goals. They University. His research
interests include knowl-
tional functionality, and we invite others to use Protégé and Jess as building blocks in their edge-based systems,
extend the system by encouraging source systems, and they often extend Protégé and knowledge acquisition, reusable problem-solv-
code development. Jess—for instance, by developing custom-tai- ing methods, the Semantic Web, medical infor-
Generalizing the JessTab approach beyond lored plug-ins. Some developers use Protégé matics, and ubiquitous computing. Contact him
Jess is an interesting prospect. Currently, and Jess as rapid-prototyping tools; they pre- at the Dept. of Computer and Information Sci-
ence, Linköping Univ., S-581 83 Linköping,
JessTab serves as an example of how you can fer reimplementing their production systems Sweden; her@ida.liu.se.
integrate programming languages, expert- in a different environment (for example, for
system shells, and other performance engines interoperability and performance reasons).
with Protégé. Although the mapping from
Protégé instances to facts is Jess-specific, we tems Development,” Int’l J. Human–Computer
can mirror structures in Protégé to other sys- Studies, vol. 58, no. 1, 2003, pp. 89–123.
tems. From a communication perspective,
integrating systems implemented in Java, the
same programming language that Protégé
T he JessTab project contributes to the
understanding of how ontology editors
and performance systems can work together.
2. E.J. Friedman-Hill, Jess in Action: Java Rule-
Based Systems, Manning, 2003.

uses, is relatively straightforward. (Examples This understanding includes the mapping 3. H. Eriksson et al., “Automatic Generation of
of such integrated Protégé plug-ins are from the Protégé knowledge representation Ontology Editors,” Proc. 12th Workshop
JessTab, PrologTab, and the Algernon rea- to the Jess representation and the use of Jess Knowledge Acquisition, Modeling, and Man-
agement, Univ. Calgary, 1999, pp. 4.6.1–4.6.20.
soner.) However, we can achieve integration definitions as system classes in Protégé
with systems running in other environments ontologies. In practice, JessTab contributes 4. S. Decker, “Ontobroker: Ontology Based
through Corba or native interfaces. (Exam- to the Protégé community by enabling the use Access to Distributed and Semi-structured Infor-
ples of Protégé tabs that take advantage of of Jess under Protégé. JessTab also supports mation,” Proc. DS-8: Semantic Issues in Multi-
media Systems, Kluwer, 1999, pp. 351–369.
this approach are the OntoViz, OIL, and the Jess community by allowing the use of
Flora tabs.) Although appealing, a general- Protégé as an object-oriented extension to 5. J.C. Arpirez et al., “WebODE: A Workbench
ized tab for any programming language Jess and by providing a tool for using Protégé for Ontological Engineering,” Proc. 1st Int’l
beyond a simple console window is difficult as a graphical front end to Jess. Conf. Knowledge Capture (K-CAP 2001),
to achieve because of the differences in com- JessTab is a solid basis for further develop- ACM Press, 2001, pp. 6–13.
munication and representation formats. ment of the Protégé–Jess integration. Exam- 6. E. Motta, S. Buckingham Shum, and J.
One major advantage of the Protégé– Jess ples of such potential integration projects are Domingue, “Ontology-Driven Document
combination is that we can use other Protégé the representation of Jess problem solvers in Enrichment: Principles, Tools and Applica-
plug-ins and other Jess extensions and inter- ontologies and detailed modeling of Jess def- tions, Int’l J. Human–Computer Studies, vol.
52, no. 6, 2000, pp. 1071–1109.
faces. For example, Jess and JessTab let us use initions (such as rules) in knowledge bases.
Protégé for development of software agents. Furthermore, the JessTab approach is a road 7. W. Swartout et al., “Toward Distributed Use
The Java Agent Development Framework8 map for integrating Protégé and other perfor- of Large-Scale Ontologies,” Proc. 10th Banff
(JADE) can communicate with Jess, which in mance systems. Knowledge Acquisition for Knowledge-Based
turn communicates with Protégé using Systems Workshop, Univ. Calgary, 1996, pp.
32.1–32.19; http://ksi.cpsc.ucalgary.ca/KAW/
JessTab. Using this approach, you can get Pro- KAW96/swartout/Banff_96_final_2.html.
tégé ontology support for JADE agents by Acknowledgments
using Jess rules. Jess rules can create Protégé The JessTab user community contributed to this 8. F. Bellifemine, A. Poggi, and G. Rimassa,
article with testing, bug reports, and suggestions “Developing Multi-Agent Systems with a
instances based on messages from agents. Fur- for further improvements. Ray Fergerson and FIPA-Compliant Agent Framework,” Soft-
thermore, Jess rules can create and send agent Ernest Friedman-Hill provided Protégé and Jess ware: Practice and Experience, vol. 31, no.
messages based on the content of Protégé support, respectively. Samson Tu provided valu- 2, 2001, pp. 103–128.
knowledge bases. Another possibility is using able insights in the problem of transferring infor-
Protégé and Jess to develop Semantic Web mation from Protégé and Jess via Java. Vinnova 9. T. Berners-Lee, J. Hendler, and O. Lassila,
supported this work in part under grant 2002- “The Semantic Web,” Scientific American,
applications.9 Protégé supports encoding 00907, project P22454-1A. vol. 284, no. 5, May 2001, pp. 34–44.
ontologies in the resource description frame-
work (RDF) format. Thus, Jess can operate on
such ontologies through JessTab. Used in this References
For more information on this or any other com-
fashion, the Protégé–Jess combination is a 1. J.H. Gennari et al., “The Evolution of Protege: puting topic, visit our Digital Library at http://
building block for the Semantic Web. An Environment for Knowledge-Based Sys- computer.org/publications/dlib.

50 computer.org/intelligent IEEE INTELLIGENT SYSTEMS

You might also like