Difference between revisions of "Protege 5 Development Environment"

From Protege Wiki
Jump to: navigation, search
(Install From Svn and Server Startup)
(Setting Up the Protege 4 Server Development Environment)
Line 13: Line 13:
 
To configure the server, run '''ant install'''.  This will build a copy of Protege with the server installed in the directory 'build/Protege'. At this point, you will have some ant targets that can replace some of the steps listed below:
 
To configure the server, run '''ant install'''.  This will build a copy of Protege with the server installed in the directory 'build/Protege'. At this point, you will have some ant targets that can replace some of the steps listed below:
 
<ol>
 
<ol>
<li> ''ant run.client'' runs the Protege client.</li>
+
<li> <b>run.client</b> runs the Protege client.</li>
 +
<li><b>run.database.manager</b> 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 </li>
 +
<li><b>run.server</b> builds and runs the server.  As part of this target the install target is also built.</li>
 +
<li><b>debug.server</b> builds and runs the server with debugging turned on at port 8500.</li>
 +
 
 +
<li><b>run.client</b> builds and runs the client. As part of this target the install target is also built.</li>
 +
<li><b>debug.client</b> builds and runs the client with debugging turned on at port 8501</li>
 
</ol>
 
</ol>
  
There are three ways of starting the client:
+
== Loading the database and installing files ==
<ol>
+
 
<li>''ant run.client''</li>
+
 
<li>after an ''ant install'' go to the build/Protege directory and run one of the start scripts.</li>
 
<li>run the client using an ide (recommended for debugging).
 
</ol>
 
The following steps will then load an ontology from the server:
 
<ol>
 
<li> After starting the client, click on ''Connect to Server''</li>
 
<li> In the text field type "localhost:8080" and click on connect.</li>
 
<li> After it connects select an ontology (e.g. pizza)</li>
 
<li> Click on the "Open in Protege" button.
 
</ol>
 
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.
 
  
 
== Configuring the server ==
 
== Configuring the server ==
Line 40: Line 36:
  
 
When the server is run, this process
 
When the server is run, this process
 
+
<pre>
== Running the server as a developer ==
+
Attempting to start server using metaproject sample-metaproject.owl
 
+
Restful Services Server Connection Factory reporting for duty
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.
+
Database Server Factory reporting for duty
 
+
Trying to configure server <http://protege.org/ontologies/SampleMetaproject.owl#sampleServer>
Now there are a couple of ant tasks that are available:
+
Matched <http://protege.org/ontologies/SampleMetaproject.owl#sampleServer> with server backend (Database Server Factory).
<ul>
+
Core Conflict Managers Factory reporting for duty
<li><b>install</b> installs the Protege client and server in the subdirectory build/Protege.</li>
+
Matched <http://protege.org/ontologies/SampleMetaproject.owl#sampleServer> with conflict manager(Core Conflict Managers Factory).
<li><b>run.server</b> builds and runs the server.  As part of this target the install target is also built.</li>
+
</pre>
<li><b>debug.server</b> builds and runs the server with debugging turned on at port 8500.</li>
 
<li><b>run.database.manager</b> 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 </li>
 
<li><b>run.client</b> builds and runs the client. As part of this target the install target is also built.</li>
 
<li><b>debug.client</b> builds and runs the client with debugging turned on at port 8501</li>
 
</ul>
 
 
 
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.
 
  
  

Revision as of 10:42, September 14, 2011

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. This will build a copy of Protege with the server installed in the directory 'build/Protege'. At this point, you will have some ant targets that can replace some of the steps listed below:

  1. run.client runs the Protege client.
  2. 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
  3. run.server builds and runs the server. As part of this target the install target is also built.
  4. debug.server builds and runs the server with debugging turned on at port 8500.
  5. run.client builds and runs the client. As part of this target the install target is also built.
  6. debug.client builds and runs the client with debugging turned on at port 8501

Loading the database and installing files

Configuring the server

In Protege, navigate to the Protege distribution and open the owl file sample-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.

If you want to have a better understanding of what you have done, in the individuals tab, navigate down the class hierarchy from Thing->PolicyControlledObject->Server->OWL 2 Server. There you will see a single individual called sampleServer. When the Protege server starts up, it sees this individual and uses it as a specification of how to set up a server. In theory there could be multiple servers running in the same jvm but this does not work yet. This sampleServer individual has three object property values. These property values specify what server backend should be used, what connection component should be used and what conflict manager should be used. Currently the only one of these individuals can be further customized (the databaseBackend individual) but this will change in future releases. The connectionManager individual is a RestfulServicesConnection manager and there is a specification of a port which the connectionManager uses. This port property is not yet used but it would be the basis for having more than one server running on the same jvm. The conflictManager individual is of type StrictConflictManager and this is currently the only type that is accepted. Finally the databaseBackend individual is what needed configuring as described above to complete your setup.

When the server is run, this process

	Attempting to start server using metaproject sample-metaproject.owl
Restful Services Server Connection Factory reporting for duty
Database Server Factory reporting for duty
Trying to configure server <http://protege.org/ontologies/SampleMetaproject.owl#sampleServer>
Matched <http://protege.org/ontologies/SampleMetaproject.owl#sampleServer> with server backend (Database Server Factory).
Core Conflict Managers Factory reporting for duty
Matched <http://protege.org/ontologies/SampleMetaproject.owl#sampleServer> with conflict manager(Core Conflict Managers Factory).


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.