wiki:SilkRoute
Last modified 12 years ago Last modified on 05/08/06 13:34:25

SilkRoute II allows users to publish relational data as XML by providing an XQuery view of their data. SilkRoute is database independent, transforming XQueries over a Public View to one or more SQL Queries which can be executed on relational engines.

There are three parts to a silkroute query. See the samples/ directory for examples of each.

  1. The Canonical View (CV), which is a representation of the relational database schema in a terse format. The CV can be written by hand, or see the "tools/cvgen/" directory to translate SQL statements to the CV format. Currently the database connection information (ODBC DSN, username, and password) is also stored in the CV, but it can be overridden from the command line.
  2. The Public View (PV), which is the Xquery format for the virtual XML document that maps the entire relational database. The PV references the CV with CanonicalView(). Again, the PV can be written by hand, or we provide the "PVGen" tool which allows RXQuery for complex mapping on large databases. See tools/pvgen/" for more information.
  3. The User Query (UQ), which is actual XQuery to process. The UQ references the PV with PublicView().

Currently, you must have the CV, PV, and UQ in the same directory or use absolute paths within the views. Complete command line invocation is:

/path/to/silkroute myquery.uq

or, to override the DB:

/path/to/silkroute -db ODBC_DSN -u USERNAME -p PASSWORD myquery.uq

CREATING ODBC DSN

If you haven't used ODBC before, you need to create a Data Source Name (DSN) for your database. On Red Hat Enterprise Linux 4 the relevant rpms are:

  • unixODBC # ODBC package and PostgreSQL ODBC driver
  • MyODBC # MySQL driver
  • freetds # Sybase/MS SQL Server (TDS protocol) driver

If you are using MyODBC or freetds, you need to edit /etc/odbcinst.ini and add or uncomment the configuration. Then, add a DSN with the following format to /etc/odbc.ini or ~/.odbc.ini :

[my_dsn]
Driver = PostgreSQL
Description = my test database
Server = 127.0.0.1
Database = my_db_name

(Note that you must configure PostgreSQL to allow TCP/IP connections.)

You can test your DSN with the "isql" tool included with unixODBC:

isql my_dsn myusername mypassword -v

BUILDING SILKROUTE

SilkRoute has many dependencies, but the GODI tool makes it pretty easy. To prepare, on any RHEL4 machine do the following:

up2date gcc-c++ pcre-devel unixODBC-devel
adduser godi
su - godi
wget http://sig.biostr.washington.edu/~joshuadf/silkroute/silkroute-makefile.constants
wget http://sig.biostr.washington.edu/~joshuadf/silkroute/galax-Makefile
wget http://sig.biostr.washington.edu/~joshuadf/silkroute/godi-silkroute.sh
chmod 755 godi-silkroute.sh

Then, go to http://www.galaxquery.org/Downloads/download-galax-0.5.0-source.html and fill out the silly form to download the galax source. Put the galax-0.5.0.tar.gz in /home/godi/ as well, and run ./godi-silkroute.sh until the build is complete (about an hour on a fast machine). You have to press ENTER near the beginning to verify you want to install GODI, but it's automatic after that.