This document is out of date. OQAFMA now runs on fma.biostr.washington.edu and there are more efficient scripts to convert and build the database (look in /home/oqafma/bin/). The Java code is still in CVS if you need it.
Suppose you were going to reinstall OQAMFA in the SIG lab. What would you need to do?
Get the code from CVS.
All of the code for OQAFMA lives in SIG's CVS repository. There are actually two pieces: the OQAFMA server itself, plus the code that builds OQAFMA's database. If you're running from a Linux shell, I recommend you do this as follows:
cvs checkout -P src/symkb/server/oqafma
cvs checkout -P src/symkb/server/IndexGUI
Compile OQAFMA and IndexGUI.
If this works like it should, it will create some new files for you: OQAFMA.jar in the oqafma dir, and BIB.jar and mysql_2_postgres.class in the IndexGUI dir.
Install OQFAMA in a lab-accessible place.
Copy the following files from your local dirs into /usr/local/share/java/oqafma. You should do this as user 'oqafma'; Chris, Kevin or Peter can give you the password.
Build OQAFMA's database.
OQAFMA doesn't use the Foundational Model's MySQL database directly. Instead, it copies data from the most recent daily dump of the FMA data into a Postgres database on quad and builds indices for that database. OQAFMA actually uses two Postgres DBs ("OQAFMA" and "testOQAFMA") and it will work with the one that's most up-to-date, based on a timestamp in each DB. You can rebuild the older of the two databases by invoking the following:
If you need to rebuild a specific database, you can do so by using one of the following commands:
./BuildDatabase OQAFMA OQAFMA.pprj
./BuildDatabase testOQAFMA testOQAFMA.pprj
Note that user 'oqafma' has a weekly cron job that rebuilds the database every Saturday night. The rebuild takes around 14 hours right now (~2 hours to copy from mysql to postgres, and then ~12 hours to build indices).
Start the OQAFMA server.
Once the DB is built, you need to start the OQAFMA server. The quickest way to do this is via the init script that Chris set up on quad:
By default, this will run on port 4242, but this can be changed with command-line flags. The server will write log messages to /var/log/oqafma/oqafma.log.
Test the server.
Once the server is running, you can check it by connecting directly to it. Here's a sample session:
crown 101% telnet quad 4242 Trying 18.104.22.168... Connected to quad.biostr.washington.edu. Escape character is '^]'. WHERE X->":NAME"->"Aorta", X->"part"->Y, Y->":NAME"->Z CREATE N(Z); <results> <N> <Z>Ascending aorta</Z> </N> <N> <Z>Arch of aorta</Z> </N> <N> <Z>Descending aorta</Z> </N> <N> <Z>Lumen of aorta</Z> </N> <N> <Z>Wall of aorta</Z> </N> </results> Connection closed by foreign host. crown 102%