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 boeing.com
Fri Sep 8 12:42:22 PDT 2006


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.

Jeff

Get and install Mysql from:

http://www.mysql.com

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:

http://dev.mysql.com/downloads/connector/j/5.0.html

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:

http://jena.sourceforge.net

Other good sources of JENA/SPARQL Docs include:
http://jena.sourceforge.net/ARQ/documentation.html
http://www-128.ibm.com/developerworks/xml/library/j-jena/
http://www-128.ibm.com/developerworks/library/j-sparql/

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:

jena_g1t0_reif
jena_g1t1_stmt
jena_g2t0_reif
jena_g2t1_stmt 
jena_graph
jena_long_lit
jena_long_uri
jena_prefix
jena_sys_stmt

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 gmail.com]
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.
  Marisa.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: winmail.dat
Type: application/ms-tnef
Size: 4778 bytes
Desc: not available
URL: <http://mailman.stanford.edu/pipermail/protege-owl/attachments/20060908/7d985a0d/attachment.dat>


More information about the protege-owl mailing list