Difference between revisions of "Protege4DevDocs"
(→Protege 4 OWL editor in Eclipse) |
Nickdrummond (talk | contribs) (→Building Protege4.1 from scratch using ant) |
||
Line 49: | Line 49: | ||
First you must set the PROTEGE_HOME environment variable which is described [[ConfiguringAntBuildFiles|here]]. Then you can build Protege 4.1 by following the following steps. | First you must set the PROTEGE_HOME environment variable which is described [[ConfiguringAntBuildFiles|here]]. Then you can build Protege 4.1 by following the following steps. | ||
− | # ''svn checkout http://smi-protege/repos/protege/protege4/protege-base/trunk protege-base'' | + | # ''svn checkout http://smi-protege.stanford.edu/repos/protege/protege4/protege-base/trunk protege-base'' |
# ''cd protege-base'' and ''ant install'' and ''cd ..''. '''Warning:''' this step deletes the existing contents of ${PROTEGE_HOME}. | # ''cd protege-base'' and ''ant install'' and ''cd ..''. '''Warning:''' this step deletes the existing contents of ${PROTEGE_HOME}. | ||
− | # ''svn checkout http://smi-protege/repos/protege/protege4/plugins/org.protege.common/trunk org.protege.common'' | + | # ''svn checkout http://smi-protege.stanford.edu/repos/protege/protege4/plugins/org.protege.common/trunk org.protege.common'' |
# ''cd org.protege.common'' and ''ant install' and ''cd ..''' | # ''cd org.protege.common'' and ''ant install' and ''cd ..''' | ||
− | # ''svn checkout http://smi-protege/repos/protege/protege4/plugins/org.protege.editor.core.application/trunk org.protege.editor.core.application'' | + | # ''svn checkout http://smi-protege.stanford.edu/repos/protege/protege4/plugins/org.protege.editor.core.application/trunk org.protege.editor.core.application'' |
# ''cd org.protege.editor.core.application'' and ''ant install'' and ''cd ..'' | # ''cd org.protege.editor.core.application'' and ''ant install'' and ''cd ..'' | ||
− | # ''svn checkout http://smi-protege/repos/protege/protege4/plugins/org.semanticweb.owl.owlapi/trunk org.semanticweb.owl.owlapi'' | + | # ''svn checkout http://smi-protege.stanford.edu/repos/protege/protege4/plugins/org.semanticweb.owl.owlapi/trunk org.semanticweb.owl.owlapi'' |
# ''cd org.semanticweb.owl.owlapi'' and ''ant install'' and ''cd ..'' | # ''cd org.semanticweb.owl.owlapi'' and ''ant install'' and ''cd ..'' | ||
− | # ''svn checkout http://smi-protege/repos/protege/protege4/plugins/org.protege.editor.owl/trunk org.protege.editor.owl'' | + | # ''svn checkout http://smi-protege.stanford.edu/repos/protege/protege4/plugins/org.protege.editor.owl/trunk org.protege.editor.owl'' |
# ''cd org.protege.editor.owl'' and ''ant install'' and ''cd ..'' | # ''cd org.protege.editor.owl'' and ''ant install'' and ''cd ..'' | ||
This will give a minimal installation and other plugins can be added as desired. Source plugins can be created by adding ''ant add.source'' before the ''ant install'' step. A full run on an extremely slow machine is shown [[Protege41FullBuild|here]]. | This will give a minimal installation and other plugins can be added as desired. Source plugins can be created by adding ''ant add.source'' before the ''ant install'' step. A full run on an extremely slow machine is shown [[Protege41FullBuild|here]]. |
Revision as of 03:54, December 4, 2009
Protege 4 Developer Documentation
Pointers for developers of plugins and understanding the core APIs of Protege 4.
Contents
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 supports Java 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 4 OWL editor in IntelliJ
Protege 4 OWL editor in Eclipse
- Setup and run the Protege 4.1 Editor in Eclipse
This page gives directions for compiling and running Protege 4.1 using Eclipse's plugin development framework. - Setup and run the Protege 4 Editor in Eclipse (External link)
This page gives directions for compiling Protege 4.0 sources in Eclipse where all bundles are encapsulated in one Eclipse project. This page has not yet been updated for Protege 4.1.
Protege 4 OWL editor in a Generic IDE
This section describes how to set up an IDE for plugin development. While we have used eclipse to illustrate these pages, we have tried to describe an approach that is generic and will work for all IDE platforms. We welcome others to add pages above to describe how to get Protege 4 running in their favorite IDE. We describe this in two steps - first the core Protege sources are downloaded and compiled and then a plugin project is created.
- Downloading, compiling and running the core Protege sources. The following links cover much the same ground.
- Compile and run the Protege-OWL editor in a Generic IDE - this page gives directions for compiling Protege 4.0 sources in Eclipse where all bundles are encapsulated in one Eclipse project.
Building Protege4.1 from scratch using ant
First you must set the PROTEGE_HOME environment variable which is described here. Then you can build Protege 4.1 by following the following steps.
- svn checkout http://smi-protege.stanford.edu/repos/protege/protege4/protege-base/trunk protege-base
- cd protege-base and ant install and cd ... Warning: this step deletes the existing contents of ${PROTEGE_HOME}.
- svn checkout http://smi-protege.stanford.edu/repos/protege/protege4/plugins/org.protege.common/trunk org.protege.common
- cd org.protege.common and ant install' and cd ..
- svn checkout http://smi-protege.stanford.edu/repos/protege/protege4/plugins/org.protege.editor.core.application/trunk org.protege.editor.core.application
- cd org.protege.editor.core.application and ant install and cd ..
- svn checkout http://smi-protege.stanford.edu/repos/protege/protege4/plugins/org.semanticweb.owl.owlapi/trunk org.semanticweb.owl.owlapi
- cd org.semanticweb.owl.owlapi and ant install and cd ..
- svn checkout http://smi-protege.stanford.edu/repos/protege/protege4/plugins/org.protege.editor.owl/trunk org.protege.editor.owl
- cd org.protege.editor.owl and ant install and cd ..
This will give a minimal installation and other plugins can be added as desired. Source plugins can be created by adding ant add.source before the ant install step. A full run on an extremely slow machine is shown here.
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).
Once you have written a plugin you want people to use it. Some very simple steps allow you to advertise your plugin and enable auto-update.
Protege APIs
Here is a summary of the main parts of the Protege 4 API for gaining access to the model and various utilities.
Also see the javadoc for Protege 4.0 code.
UI components
The Protege core and the OWL editor kit both provide a large number of reuseable components and utilities for generating user interfaces for ontologies.
Updating to Protege 4.1
A short guide to migrating plugins from Protege4.0 to Protege4.1 (in progress).
Misc
For people embedding Protege 4 services inside a non-OSGi based applications here is a short example showing how this can work.
Troubleshooting
- Troubleshooting class loader issues
- Building the FaCT++ JNI Library - issues with FaCT++ libraries not found, linking errors etc
- Troubleshooting and fixing problems with the Java 5 compiler