W3C AnnoteaDocumentation

RDF SQL HOWTO

This document describes how to set up a MySQL datastore as part of installing a W3C-Perllib Annotation server.

Overall Steps

  1. General
  2. Get MySQL
  3. Set MySQL Access Tables
  4. Create MySQL RDF database
  5. Create Properties Files

1. General

The RDF persistent database uses an SQL store. The code has been tested with MySQL. It is likely the code will work with other SQL databases. Please drop a line to the list if you set it up with another database.

2. Get MySQL

MySQL is available via HTTP from MySQL.com. If you have a RedHat Linux system, install the RPM, Debian users can use apt-get install mysql-server. Other platforms may have to build the source from scratch.

3. Set MySQL Access Tables

The MySQL documentation describes the MySQL authentication scheme. In summary: MySQL grants access based on user/host and tables in the mysql database. For the purpose of keeping a consistent example, we will use the username: AnnotateUser, password: AnnotatePassword, and host: localhost . SQL commands are case-insensitive and examples will use SQL commands in UPPERCASE. The following commands will grant the RDF persistent database access:

mysql -u root mysql
INSERT INTO user (Host,User,Password,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Reload_priv,Shutdown_priv,Process_priv,File_priv,Grant_priv,References_priv,Index_priv,Alter_priv) VALUES ('%','AnnotateUser',password('AnnotatePassword'),'Y','Y','Y','Y','N','N','N','N','N','N','N','N','N','N');

4. Create MySQL RDF database

The Perllib Rdf bin directory (W3C/Rdf/bin) contains a shell script to tell MySQL how to create the Rdf database.

mysql <W3C/Rdf/bin/RdfObjects.mysql

5. Create Properties Files

The RDF annotate script agent needs a configuration file for the database related properties. The file should be named as rdf.prop and look something like:

user: AnnotateUser
password: AnnotatePassword
database: rdf
queryHost: localhost

The script agents find this and other configuration files under the Conf directory which is located under the root WWW directory class path. For instance, if the RDF libraries are checked out into /usr/local/perl/modules/W3C/Rdf/..., the configuration properties files should be located in /usr/local/perl/modules/Conf/ . The configuration file is used in the scripts e.g. in the following way W3C::Util::Properties ('.../Conf/rdf.prop').


Eric Prud'hommeaux,
@(#) $Id: RdfSQL-HOWTO.html,v 1.37 2003/01/10 18:00:24 marja Exp $ Valid HTML 4.0!