Protege4DevDocs

From Protege Wiki
Revision as of 18:57, October 22, 2008 by JenniferVendetti (talk | contribs) (removed comment about p4 javadoc being incomplete. javadoc is now generated for all source code for all bundles.)

Jump to: navigation, search

Protege 4 Developer Documentation

This page is still somewhat under construction...




Guidelines

If you are writing code for P4, please compile it with java 1.5 for compatibility.
All current Protege 4.0 code is written in java 1.5. This will continue to be the case until Apple support java 1.6.

Please consider writing any P4 code as a plugin.
If you cannot do this for various reasons, please let us know as we may be able to improve the core design in order to support you.
Protege 4.0 has been written specifically to be modular. It uses equinox, one implementation of an OSGi framework to allow plugins to be created easily.

Please share.
It is surprising how many people have written plugins for P4 that we just don't hear about.
If you wish to publish to the community, please see our notes on code contributions.

Working with the Protege source code

Compiling and Running

Protege-OWL editor in IntelliJ

Protege-OWL editor in Eclipse

This section describes how to set up an IDE for plugin development. We describe this in two steps - first the core Protege sources are downloaded and compiled and then a plugin project is created. While these instructions were put together using eclipse we believe that they can be applied to other development environments and we welcome contributions from people using other development environments.

Plugin for Eclipse Users Only (Windows and Linux only)

Unlike the approaches for plugin development described above, the following instructions are only relevant to eclipse developers. These instructions use the OSGi development capabilities of eclipse (aka plugin development or rich client platform development). As far as I know - eclipse is the best IDE environment for developing OSGI applications.

Unfortunately - though we now know that this works - we have not yet finished the documentation. While this also has not yet been verified, it may be necessary to download the latest version of eclipse to get the OSGi runnable to work.

Anatomy of a Plugin

A short guide to writing a plug-in to show the class hierarchy. This doesn't delve deeply into setting up your build environment, but concentrates on a simple code example and making sure you understand the components and the structure of a plug-in.

This page also contains some information about the different parts of a plugin and how they work together. It also includes a very simple plugin and shows how to install it into the eclipse development environment.

The example delves into producing a view plugin, but we also have a short list of other useful plugin types that you may wish to implement (such as menu items etc).

Key Classes

Please check out the javadoc for Protege 4.0 code.

The most important three classes you will have access to from most plugins are:

  • OWLModelManager Access to the ontologies, reasoners, search renderings, change management etc
  • OWLWorkspace Access to the UI elements (menus, cell renderers, handy entity selectors), global selection management etc
  • OWLEditorKit The central access point for all of the model and UI elements of the OWL editor - you can get to both of the above from the editor kit

UI classes

There are many standard UI components, including all of the abstract view classes in org.protege.editor.owl.ui.view, and Protege 4.0 style lists in org.protege.editor.owl.ui.frame.

There are also many reusable UI components available such as OWLObjectTree, ExpressionEditor and standard dialogs in UIHelper.

Troubleshooting

Building The FaCT++ jni library

Because FaCT++ is written in C++, it is a little harder to get it to compile properly across platforms. In particular, a user may see errors such as

Link (dyld) error:
Symbol not found: _clock$UNIX2003

or a java.lang.UnsatisfiedLinkError with a message similar to the following

libFaCTPlusPlusJNI.so: /usr/lib/libstdc++.so.6: version `GL IBCXX_3.4.9' not found (required by libFaCTPlusPlusJNI.so)

This happens because the version of FaCT++ that was compiled into the Protege 4 owl editor is not compatible with the libraries in the users operating system. If this happens on a windows or an OS X machine then send a message to the P4 mailing list because the developers probably should fix this situation. (If you are not subscribed to this list look at this web page.) However on a linux or other operating system this is much more difficult because there are too many different variants. In this case you will probably have to build you own version of FaCT++. Hence we added the following page to make the work a little easier.