Difference between revisions of "Protege4DevDocs"

From Protege Wiki
Jump to: navigation, search
(Key Classes)
(Compiling and Running)
Line 29: Line 29:
 
* [[CompileProtege4InIntelliJ|Setup and run the Protege 4 Editor in IntelliJ]]
 
* [[CompileProtege4InIntelliJ|Setup and run the Protege 4 Editor in IntelliJ]]
  
==== Protege 4 OWL editor in Eclipse (In Progress) ====
+
==== Protege 4 OWL editor in Eclipse ====
  
* [[CompileProtege4InEclipse|Setup and run the Protege 4 Editor in Eclipse]]
+
* [http://www.cs.man.ac.uk/~iannonel/eclipseSetup/eclipseSetupMain.html Setup and run the Protege 4 Editor in Eclipse] (External link) '''RECOMMENDED''' <br />This page gives directions for compiling Protege 4.0 sources in Eclipse where ''all bundles are encapsulated in one Eclipse project''
 +
* [[CompileProtege4InEclipse|Setup and run the Protege 4 Editor in Eclipse]] (In Progress) <br />This page gives directions for compiling and running Protege 4.0 using Eclipse's plugin development framework.
  
 
==== Protege 4 OWL editor in a Generic IDE ====
 
==== Protege 4 OWL editor in a Generic IDE ====
Line 37: Line 38:
 
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.   
 
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 two links cover much the same ground.
+
* Downloading, compiling and running the core Protege sources.  The following links cover much the same ground.
** [http://www.cs.man.ac.uk/~iannonel/eclipseSetup/eclipseSetupMain.html Setup and run the Protege 4 OWL Editor in a generic IDE]  <b>(External link)</b> - this page gives directions for compiling Protege 4.0 sources in Eclipse where ''all bundles are encapsulated in one Eclipse project''
 
 
** [[CompileProtege4InEclipseOneProject|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''.
 
** [[CompileProtege4InEclipseOneProject|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''.
  

Revision as of 04:25, June 22, 2009

Protege 4 Developer Documentation

Pointers for developers of plugins and understanding the core APIs of Protege 4.




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

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.

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.

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

Don't be confused by some classes that have a name similar to the OWLModelManager class:

  • OWLModelManager is a Protege 4 class which give access to the ontologies, reasoners, search renderings, change management etc.
  • OWLManager is utility class in the OWL API that you can use to create an OWLOntologyManager class. In general you probably won't need this when writing Protege 4 code but it is the starting point for most OWL API code.
  • OWLOntologyManager is a class in the OWL API that is not specific to Protege 4. The OWLOntologyManager plays a central role in the development of OWLAPI code. It provides access to the ontologies, reasoners, change management, etc. An OWLModelManager has a getter method that will recover the OWLOntologyManager.

UI classes

The Protege core and the OWL editor kit both provide a large number of reuseable components and utilities for generating user interfaces for ontologies.

Troubleshooting