Gold University of Minnesota M. Skip to main content.University of Minnesota. Home page.
 
 
 

What's inside.

Mailing list
Mailing list archives

Flash tour


Report a bug
Development wiki
 

GRAPE

GRAPE is the Graphical Relational Algebra Programming Environment. The Graphical Relational Algebra language was developed by Prof. John Carlis as a research and teaching tool for designing complex database queries. The language will be fully specified in Prof. Carlis' forthcoming book "Mastering Database Querying and Analysis." The GRAPE software, which will accompany the book, helps users map out Graphical Relational Algebra queries and automatically executes these queries using a database management system. (See a screenshot.)

GRAPE is beta-quality software. While most features work most of the time, there are serious known bugs. Because GRAPE isn't yet finished, its use is recommended but optional in Prof. Carlis' data modeling classes.

GRAPE is intended only for the University of Minnesota community at present. We're working on making it more widely usable. (GRAPE is being used for Macalester College's Databases course, using the University's database server.)

Installing GRAPE

GRAPE is written in Python, and requires the wxPython GUI library.

GRAPE automatically updates every time it is run. This is to ensure every user always runs a version that's compatible with the latest GRAPE server software. You don't have to worry about reinstalling GRAPE when new updates are released, as they will be downloaded automatically.

Windows

You do not need to install Python and wxPython to use GRAPE on Windows. You can even start using it without getting administrator privileges, since it doesn't have to be installed in any particular directory.

Download and extract this ZIP file (10 MB). You'll get a new directory called GRAPE. Double-click "grape.exe" to start GRAPE.

Please note: GRAPE has not been tested on Windows Vista.

Ubuntu Linux

You'll need root privileges to use GRAPE on Linux, since the GUI library it uses isn't part of a typical installation. Contact your system administrator if you don't have root access.

First, be sure you have the Universe component enabled. Then run:

sudo apt-get install python-wxgtk2.8
mkdir grape; cd grape
wget http://csrg.cs.umn.edu/grape/grape.py 

Make sure you always put the grape.py script in its own directory, since it will create some temporary files in whichever directory contains grape.py.

Run python grape.py in the grape directory to start GRAPE.

Mac OS X

GRAPE should run fine on Mac OS X with Python and wxPython installed, but we don't have a Mac, so we haven't tested it. We've heard it works, but crashes too often to be useable. Proceed with caution.

Install Python and wxPython according to the directions on their respective Web sites. (The version of Python that comes with Mac OS X is obsolete.) Then, in a terminal window, type:

mkdir grape; cd grape
curl http://csrg.cs.umn.edu/grape/grape.py > grape.py

Run python grape.py in the grape directory to start GRAPE. Press Ctrl-C in the terminal window to quit, as the "Quit Python" menu option doesn't seem to work.

(Thanks to David O'Brien for Mac advice.)

Remote access

GRAPE runs fine over a remote X11 connection. This is a good option for Mac users who have been experiencing frequent crashes running GRAPE on their personal machines.

First, make sure you have an X server running. Then, use ssh with the -Y option to connect to a Linux machine, and run GRAPE as usual.

Change your password!

If you're in the SENG 5707 class, please change your database password the first time you run GRAPE. We don't expect your classmates to be malicious, but one of them might accidentally use your account instead of his or her own. You can change your password after logging in by selecting "Change Database Password..." from the Edit menu.

Using GRAPE

We haven't had a chance to document GRAPE yet. Most of the program should be self-explanatory. Just remember:

  • Drag relations and operators from the left-hand side of the screen to the work space on the right side
  • Make intermediary relations by dragging the white rectangle from the toolbar, or selecting "Relation..." from the "Insert" menu.
  • Move the mouse over operators and relations to see their output ports (blue rectangles). Click an output port once to start drawing a connection, and click another shape's input port to terminate the connection.
  • Double-click a relation or operator to see options. Double-click a relation name on the left-hand side of the screen to view that relation in a tabular format.
  • Right-click any relation and select "Generate..." to see the commands that will derive that relation. Click "Execute" to run these commands.
  • Show the SQL Shell by selecting "SQL Shell" from the "Edit" menu. The shell shows both commands that you enter, and commands that GRAPE runs on its own. If a command returns a result table, it will have a green triangle next to it in the shell. Click the green triangle to view the result table.
  • You can use the arrow keys to scroll through commands you recently typed in the SQL shell, and tab completion is available for some commands.
  • The SQL shell has a few pseudo-SQL commands that are interpreted locally:
    • Type autocommit off to prevent the SQL Shell from automatically commiting your changes at the end of every non-idempotent transaction. This option is only for advanced users.
    • Type refresh to clear GRAPE's local caches and reload them from the database. GRAPE tries to do this automatically when it detects commands that alter the system catalog, but it doesn't catch every one.
    • Type clear to clear the SQL log (useful before typing a series of commands that you want to save).
  • The SQL shell also displays commands that GRAPE decides to execute, in addition to ones you type in yourself. This can be confusing for new users. Eventually this will be a configurable option.
  • Save your work often, as GRAPE occasionally crashes!

Common mistakes

  • To connect two objects in a GRAPE diagram, move the mouse over the first item until a blue box appears. Click once, then move the mouse to the second item until a blue box appears on that item, and click again. Dragging is only used to move relations and operators around, not to connect them.
  • You may frequently paste in transcripts of SQL sessions into the SQL Shell (for example, to create the example data sets). You have to press the Return key after pasting in a series of SQL commands, or they won't ever be executed.

Flash tour

If you're a flash-y sort of person, you might be interested in our tour of GRAPE features (work in progress).

Mailing list

If you use GRAPE (even if it's just for class), please subscribe to the "Grape-users" mailing list. You'll get updates when new features are added to GRAPE.

Reporting bugs

Please report bugs to Daniel Feldman or your course instructor. There's also a nifty bug report form if you'd rather use that.

Development

The current GRAPE developer is Daniel Feldman. Please send him any questions about using GRAPE.

To download the GRAPE source code, you'll need the SVN version control client. Run the command svn co https://dfeldman.org/svn/research/projects/grap/ to create an SVN working directory. If you'd like SVN commit privileges, contact Daniel Feldman.

 
The University of Minnesota is an equal opportunity educator and employer.
GRAPE