Search Mailing List Archives
[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.
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 Drivers jar into the builds 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 youre 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
Mysql> select * from jena_g1t1_stmt;
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.
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
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.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 4778 bytes
Desc: not available
More information about the protege-owl