Protege 5 Development Environment

From Protege Wiki
Revision as of 10:05, September 14, 2011 by Tredmond (talk | contribs) (Setting Up the Protege 4 Server Development Environment)

Jump to: navigation, search

Setting Up the Protege 4 Server Development Environment

The Protege server is going to be released with a version of Protege 4.2 very soon. At that time this page will be divided into instructions for users wanting to try it out and a developer page for developers. Until that time, we will only include the developer page.

Install From Svn and Server Startup

First checkout the development tree

     svn checkout http://smi-protege.stanford.edu/repos/protege/protege4/misc/composite/protege.server

If you are using eclipse this will become your eclipse workspace later.

To configure the server, run ant install and then open the owl file build/Protege/sampe-metaproject.owl. Go to the individuals tab, navigate down the class hierarchy from Thing->ServerComponent->ServerBackend->DatabaseServerBackend and select the individual databaseBackend. This individual will have three properties that you can configure: username, password and url. These properties tell the server how to access the database. MySQL and PostGreSQL databases should work. A typical mysql url will look like this: jdbc:mysql://localhost/protege4.

To load projects on the server run ant run.database.manager, enter your database parameters, connect and add projects to the database. When the server starts it will load all the projects found in the database.

Now there are a couple of ant tasks that are available:

  • install installs the Protege client and server in the subdirectory build/Protege.
  • run.server builds and runs the server. As part of this target the install target is also built.
  • debug.server builds and runs the server with debugging turned on at port 8500.
  • run.database.manager runs the database manager which will allow one to copy owl ontologies into the database. Ontologies in the database will automatically become available on the server
  • run.client builds and runs the client. As part of this target the install target is also built.
  • debug.client builds and runs the client with debugging turned on at port 8501

After the install step, a copy of the client and the server is put in the directory build/Protege. When the server is running, this client can be used to connect to the server and edit the shared ontologies.

Running the Protege Client

There are three ways of starting the client:

  1. ant run.client
  2. after an ant install go to the build/Protege directory and run one of the start scripts.
  3. run the client using an ide (recommended for debugging).

The following steps will then load an ontology from the server:

  1. After starting the client, click on Connect to Server
  2. In the text field type "localhost:8080" and click on connect.
  3. After it connects select an ontology (e.g. pizza)
  4. Click on the "Open in Protege" button.

If you run a couple of clients you can experiment with propagating changes. Also the server menu has some items that will allow you to propagate changes manually.

Setting up Eclipse

To set up eclipse,

  1. unzip the ide-eclipse.zip file.
  2. start eclipse using protege.server as the workspace.
  3. import the projects (File -> Import -> General -> Existing Projects Into Workspace).

This eclipse workspace will come with a couple of runnables:

  • Client starts the Protege OWL Client.
  • Server starts the Protege OWL Sever
  • ConnectToAntServer connects to the "ant debug.server" script for debugging.