Main Page | Report this Page
 
   
Linux Forum Index  »  General Linux Discussion  »  a GPL'ed hierarchical database for Linux/Cygwin...
Page 1 of 1    
Author Message
Kevin O'Kane...
Posted: Sat Jul 26, 2008 9:18 pm
Guest
Mumps, for those not familiar with it, is a database scripting language developed in late 60's.
It supported a hierarchical database and was/is widely used in medical applications.
Our Linux/Cygwin implementation of Mumps is open source/GPL and available at:

http://www.cs.uni.edu/~okane/source/MUMPS-MDH/

see also:

http://www.cs.uni.edu/~okane/

and:

http://www.amazon.com/Mumps-II-Programming-Language/dp/143824617X/ref=sr_1_5?ie=UTF8&s=books&qid=1216904848&sr=1-5

This version of Mumps is available as both an interpreter a compiler. The interpreter is a scripting shell while the
compiler translates Mumps to C++ for subsequent compilation.

Mumps has its own b-tree based file system that normally store the trees. However, our new version also permits storage
of the Mumps global (hierarchical) arrays in a PostgreSQL database server.

In this new version, global array data bases built by Mumps programs can also be retrieved, updated and manipulated by
SQL commands. A short example follows:

A small Mumps program to create a tiny data base:

#!/usr/bin/mumps

sql/f

set ^lab(1111,"hct",$zd1,44)=""
set ^lab(2222,"hct",$zd1,45)=""
set ^lab(3333,"hct",$zd1,46)=""
set ^lab(4444,"hct",$zd1,47)=""
set ^lab(5555,"hct",$zd1,4Cool=""

set ^bp(1111,$zd1,128,70)=""
set ^bp(2222,$zd1,127,71)=""
set ^bp(3333,$zd1,126,72)=""
set ^bp(4444,$zd1,125,73)=""
set ^bp(5555,$zd1,124,74)=""

set ^prob(1111,$zd1,"123.45")=""
set ^prob(2222,$zd1,"223.45")=""
set ^prob(3333,$zd1,"323.45")=""
set ^prob(4444,$zd1,"423.45")=""
set ^prob(5555,$zd1,"523.45")=""

The first line (#!/usr/bin/mumps) starts the Mumps interpreter under Linux. The command: sql/f clears the SQL server Mumps
data base. $zd1 is a builtin variable in our system that gives the Linux system time (number of seconds since Jan 1, 1970).
The ^... figures are global arrays (name followed by some number of indices). Each index describes a successive path through a tree.

Because the Mumps globals can reside in relational tables, they are also accessible to SQL queries.

Having run the above, we accessed it using the simple pgsql program which is part of the PostgreSQL distro (note: views can
be created and column names aliased in SQL so the column headings A1, A2, ... can be altered): (I hope this formats okay)

okane at (no spam) emachines:~/mumps/demos$ psql -d mumps

Welcome to psql 8.3.1, the PostgreSQL interactive terminal.

Type: copyright for distribution terms
h for help with SQL commands
? for help with psql commands
g or terminate with semicolon to execute query
q to quit

mumps=# select * from mumps;

gbl | a1 | a2 | a3 | a4 | a5 | a6 | a7 | a8 | a9 | a10
------+------+------------+------------+----+----+----+----+----+----+-----+-----
lab | 1111 | hct | 1213390964 | 44 | | | | | | |
lab | 2222 | hct | 1213390964 | 45 | | | | | | |
lab | 3333 | hct | 1213390964 | 46 | | | | | | |
lab | 4444 | hct | 1213390964 | 47 | | | | | | |
lab | 5555 | hct | 1213390964 | 48 | | | | | | |
bp | 1111 | 1213390964 | 128 | 70 | | | | | | |
bp | 2222 | 1213390964 | 127 | 71 | | | | | | |
bp | 3333 | 1213390964 | 126 | 72 | | | | | | |
bp | 4444 | 1213390964 | 125 | 73 | | | | | | |
bp | 5555 | 1213390964 | 124 | 74 | | | | | | |
prob | 1111 | 1213390964 | 123.45 | | | | | | | |
prob | 2222 | 1213390964 | 223.45 | | | | | | | |
prob | 3333 | 1213390964 | 323.45 | | | | | | | |
prob | 4444 | 1213390964 | 423.45 | | | | | | | |
prob | 5555 | 1213390964 | 523.45 | | | | | | | |
(15 rows)


mumps=# select a1 from mumps where gbl = 'lab' and a2 = 'hct' and a4 > '45';

a1
------
3333
4444
5555
(3 rows)

----------------------------------------------------------------------------------------------------

Overall performance is about 0.005 seconds per global array insert on a four year old desktop PC running the current version
of Ubuntu. The test consisted of the insertion and retrieval of 100,000 Mumps randomly generated Mumps globals.

Mumps can access other relational tables if appropriate views are first constructed.

The Mumps command 'sql' permits any SQL or PostgreSQL command to be passed to and processed by the backend. This command is
similar to our shell and html commands in that Mumps variables and expressions can be embedded into the SQL command.

Full documentation is under development but for the time being, see the file POSTGRESS_README in the distribution.

This package works with Linux and Cygwin and is compatible with the Apache web server for active server pages.

The Mumps interpreter and compiler are written in C/C++. The Mumps compiler translates Mumps to C++.

Comments and suggestions welcome.
 
Page 1 of 1       All times are GMT - 5 Hours
The time now is Mon Dec 01, 2008 12:53 pm