The Trio system is implemented in the Python programming language and layered on top of the PostgreSQL open-source DBMS. The system comes shipped with two user interfaces: trioplus
, a command-line interface (CLI), and TrioExplorer
, a web-based GUI with user-friendly control features, help pages, and some sample applications and queries. Trio also includes a basic Application Programming Interface (API) similar to the Python DB-API specification, on which the user interfaces are built.
The complete Trio functionality is available through the Python implementation, including a TriQL grammar parser and a hierarchical rewriting architecture that creates standard SQL queries from TriQL, which are then executed over a relational encoding of our data structures. Only a few complex operations such as on-demand lineage traversal and confidence computation are implemented as stored procedures.
The core functionality such as data-intensive fetch operations and cursor management are implemented redundantly in Python and a precompiled C-code library extension using the PostgreSQL-specific Server Programing Interface (SPI) to achieve better performance. However, the current release only contains slower Python implementation. If you are interested in performance experiments, please contact us!
In its default configuration, the Trio system requires the following software packages:
trioplus
and TrioExplorer
.TrioExplorer
.Currently we are running the system successfully on Linux, Mac OS X, and Windows XP/Vista.
apt-get
or yum
).http://www.python.org/download/
.http://www.python.org/download/
.Easy Install
doesn’t have a windows installer for Python 2.6 yet.bin
directory (e.g., C:\Python25;C:\Python25\Scripts
) is in your PATH
environment (by running python -V
).apt-get
or yum
).http://www.postgresql.org/download/macosx
.http://www.postgresql.org/ftp/binary/v8.2.11/win32/
.triospi.dll
for PostgreSQL 8.3 is not provided.bin
directory (e.g., C:\Program Files\PostgreSQL\8.2\bin
) is in your PATH
environment (by running postgres -V
and pg_config
).pg_config
is in the development package. We recommend installing pg_config
because it will detect the correct location of triospi.so
or triospi.dll
.plpgsql
support is enabled.createlang plpgsql template1
to enable plpgsql
for newly created databases.postgres
, you need to create a database with the account name (e.g., run createdb trio
). Please refer to The PostgreSQL User Account and Creating a Database Cluster.apt-get
or yum
).http://www.graphviz.org/Download.php
.bin
directory (e.g., C:\Program Files\Graphviz 2.21\bin
) is in your PATH
environment (by running d
t -V
).Depending on the environment, you might need root privileges to complete these steps.
Easy Install
. Please see http://pypi.python.org/pypi/setuptools
for instructions.PyGreSQL
win32 package at http://www.pygresql.org/readme.html#download-pygresql-here
(Installing PyGreSQL
with Easy Install
requires the Microsoft Visual C++).easy_install -U -f http://
infolab.stanford.edu/trio/code/ Trio TrioExplorer
to install Trio packages and all required libraries.triospi_install
to get the SPI module working.pg_config
. You can manually do this step by copying site-packages/Trio-1.1-py2.5.egg/trio/spi/{linux2|darwin|win32}/pg-{8.2|8.3}/triospi.{so|dll}
into PostgreSQL’s lib
directory (e.g., /usr/lib/pgsql
or C:\Program Files\PostgreSQL\8.2\lib
). site-packages
is usually in /usr/lib/python2.5
or C:\Python25\Lib
.
Preparing TrioExplorer
for its first use requires generating trioexplorer.ini
. Please run paster make-config TrioExplorer trioexplorer.ini
inside a directory of your choice (e.g., C:\Trio
or ~/Trio
). While running TrioExplorer
, some temporary files will be generated as well in the directory.
TrioExplorer
paster serve trioexplorer.ini
paster serve -
-daemon trioexplorer.ini
and paster serve -
-stop-daemon
to start and stop TrioExplorer. Please run paster serve -h
for more options.postgres
).TrioExplorer
should now be reachable from your browser, e.g., using http://127.0.0.1:8080/
or http://localhost:8080/
.
Preparing trioplus
for its first use requires a new user role and database instance be installed manually (denoted in the following as foo
and bar
), which should be different from the default PostgreSQL instance, and which requires logging in onto the PostgreSQL server with admin privileges (denoted in the following by the admin user name postgres
).
If you already have created a user login and database instance under TrioExplorer
, you may just skip this step and directly jump to the last bullet, i.e., run trioplus -u foo -d bar -p
.
createuser [-U postgres] -S -D -R -P foo
createdb [-U postgres] -O foo bar
createuser -U postgres foo
.triosetupdb [-U postgres] bar foo
trioplus -u foo -d bar -p