Version 1 (modified by trac, 13 years ago) (diff)


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


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 :

Driver = PostgreSQL
Description = my test database
Server =
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


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
chmod 755

Then, go to 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 ./ 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.