Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Storing ontologies.

Schmitz, Jeffrey A Jeffrey.A.Schmitz at
Tue Sep 12 14:21:29 PDT 2006

Hmm, Not really sure, but here is what my build path looks like.  I probably have a few things you don't need, but I would make sure you have at least all the  protege and jena jar files.
Also, I'm using the protege 3.1 jars...


From: Marisa Santos Amaro [mailto:marisa.osantos at] 
Sent: Tuesday, September 12, 2006 4:06 PM
To: User support for the Protege-OWL editor
Subject: Re: [protege-owl] Storing ontologies.

Ok, Jeffrey. 
Before using MySQL and Jena, I´m trying to run some basic examples in the Protege-OWL API programmer´s guide, but I don´t know how to configure the Eclipse classpath (I´ve installed Protege 3.2, Eclipse 3.2 and Java2SDK 1.5.08).
At the "installation & getting started" section, the guide says "add all jars files from the installation to your project classpath".  
As my project home, I selected the "Protege_3.2_beta" directory and I created a "Demo" folder  where I put the Java class from the "HelloWorld"  example code. For "add jars", I selected 
project>> properties>>Java buid path>>Libraries>>add external JARs
selected the jar files from "edu.stanford.smi.protegex.owl" and "edu.stanford.smi.protegex.standard_extensions" folders to add.
It didn´t work; I got  2 running error messages 
 >> "the project was not buit since its buid path is incomplete..."and 
>> "the type edu.stanford.smi.protege.model.DefaultKnowledgeBase cannot be resolved. It´s indirectly referenced ...."
What is wrong with this setup ?
Thank you.
On 9/8/06, Schmitz, Jeffrey A <Jeffrey.A.Schmitz at> wrote: 

	First you will need to get everything installed on your machine.  For that, here are some notes I took down from my experience.  Once things are setup as below, you'll need to start coding using the JENA api.  I can send you some samples of that if you want, but first things first.  Note that I'm using the JENA JDBC Database option, not the Protege Database option.  To get the Protege model into the JENA Database you will read in the Protege OWL file and then add that to the JENA Database Model. 
	Also, in this case it is not one table=one class but one ontology=one class.  All the classes in an Ontology will be loaded into a single table (see below).  If you have two Ontologies, each will get it's own table.  A frequent usage is to put your Ontology class defintion in one Ontology/table, and your Instance Ontology in another. 
	Get and install Mysql from:
	You will then need to create a database and a MySQL user account in MySQL.
	For example, start the MySQL Command Line Client application (or log into MySQL as the root user from the terminal). 
	Enter the following commands to create the Pizza database and Pizza user:
	mysql> CREATE DATABASE Pizzas;
	mysql> CREATE USER PizzaMan at localhost;
	mysql> SET PASSWORD FOR PizzaMan at localhost = password('pizzaPW'); 
	mysql> GRANT ALL PRIVILEGES ON *.* TO PizzaMan at localhost WITH GRANT OPTION;
	Get and install the MySQL JDBC driver from: 
	For Eclipse installation:
	1. Add the JDBC Driver's jar into the build's build path, perhaps as an external jar from the Tomcat directory above, or copy it to your workspace project in Eclips and add it: 
	For Protégé installation:
	1.  Rename the drive jar file to driver.jar and copy to the protégé installation folder.
	Get and install JENA from: 
	Other good sources of JENA/SPARQL Docs include:
	For Eclipse Installation: 
	If you're going to develop in eclipse, make sure and add the jars to your eclipse build path.
	Run from Eclipse:
	Now you can develop and run your Eclipse/Jena/MySQL application from Eclipse.  To check database tables manually, log on to the mysql server.  For example, to login as PizzaMan: 
	Shell> mysql -u PizzaMan at localhost -ppizzaPW
	Then select the database being used in your application.  For example to use the Pizzas database:
	Mysql> use Pizzas;
	Then query the database tables for the information.  For example: 
	Mysql> show tables;
	You should see (for example) the Jena tables created in your database:
	To look at specific OWL statements, query one of the ...stmt tables;
	Mysql> select * from jena_g1t1_stmt;
	-----Original Message-----
	From: Marisa Santos Amaro [mailto: marisa.osantos at]
	Sent: Sun 9/3/2006 9:07 AM
	To: protege-owl at lists.Stanford.EDU
	Subject: [protege-owl] Storing ontologies. 
	Hi people.
	Does anyone know a "step-by-step" guide that I could use to learn how to
	store an OWL ontology in a MySQL database ?
	As a beginner, I have some basic doubts :
	a) After building the ontology, I would like to query it using an 
	application to read the classes definitions, properties and instances,
	because using the Protege resources I coudn´t  get all mixed searches I
	need. What kind of environment is more suitable for this goal :  does 
	people  usually access the ontology as a owl file (with yours instances
	saved embedded in the code) or  does it work with a backend database? The
	instances usually
	b) By reading the Protege2000  "saving a database project" section I 
	understood that an OWL ontology can be stored as a single table. One table
	represents only one class, right ? So, how to save all the ontology classes
	? Do I need to repeat a save-project operation for each class of my model 
	? And how about the instances,  where/how are they saved ?
	Where could I get good examples about these topics ?
	Thanks a lot for any help.
	protege-owl mailing list
	protege-owl at 

      Marisa de Oliveira Santos Amaro
             Capitão-de-Fragata ( T )
     Superintendente de Infra-estrutura e
   Serviços de Tecnologia da Informação 
Diretoria de Finanças da Marinha - DFM

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Outlook.jpg
Type: image/jpeg
Size: 156298 bytes
Desc: Outlook.jpg
URL: <>

More information about the protege-owl mailing list