How to use the Java Ontology
Bean Generator for JADE
The
beangenerator allows to generate Java files representing an ontology
that can be used within the JADE Toolkit (3.0).
The beangenerator is implemented as a plug-in for Protégé
(1.9). Within Protégé you can import and export RDF
and RDFS. With the beangenerator tool you can generate JADE compliant
ontologies from RDF(S), XML and Protégé projects.
Installation
The beangenerator requires the following tools:
The Ontology Bean
Generator must be downloaded from the JADE download page. After downloading
you must unzip the Bean Generator package under the root of the jade
distribution tree. You should end having a hierarchy like
jade/add-ons/beangenerator.
Compilation For handling the
compilation process of the Ontology Bean Generator you have to use the
'build.xml' ant-file located in the beangenerator directory. Note:the environment
variable PROTEGE_HOME must point on the Protégé home
directory. The
following rules are available:
ant - compiles the Bean Generator classes
ant lib - creates the beangenerator.jar
archive in the lib directory
ant install - install the Bean Generator
plug-in for Protégé.
ant clean - removes the compiled classes and
the beangenerator.jar archive
ant examples - install into the
Protégé directory some examples of ontologies defined
with Protégé
Usage
You
should also let your CLASSPATH link to the beangenerator.jar
file
open a new or existing
Protégé project
include the SimpleJADEAbstractOntology
into your project
create concepts
by making subclasses of the class [Concept], e.g. CD,
Items.
create agentactions
by making subclasses of the class [AgentAction],
e.g. Sell, Buy.
create agents
by making subclasses of the class [AID], e.g. Seller,
Buyer
create predicates
by making subclasses of the class [Predicate],
e.g. Owns, Contains
go to menu of Protégé:
open project>configure...
and select the OntologyBeanGeneratorTab checkbox
select the Ontology Bean Generator tab
specify (or select from the combobox) a
package name, e.g. mypackage.onto
specify (or select from the combobox or
from the [...] button) a location where the java files are to be
created
(make sure the directory exists) e.g.
.../projects/mypackage/src/mypackage/onto
specify (or select from the combobox) a
ontology name: e.g. Newspaper
press the generate button (old
generated files will be overwritten)
import the the ontology files into your
agent project