Skip to Content

MetamorphoSys MRCXT Builder batch/shell scripts

Performing Batch MRCXT Builder Runs

This document is a guide to running the MetamorphoSys MRCXT Builder in a programmatic way rather than through the standard GUI interface.

Getting Started

To perform an scripted run of the MetamorphoSys MRCXT Builder you will need three things:

  1. An installed RRF Metathesaurus subset.
  2. MetamorphoSys installation (like the MMSYS/ directory on the DVD, or an unpacked mmsys.zip file).
  3. JRE matching the version of the MetamorphoSys distribution.  An unpacked mmsys.zip file will contain a JRE directory you can use.

The easiest way to obtain all five pieces is to start with a UMLS distribution: either the DVD or downloaded files from the Knowledge Sources Server.   Run MetamorphoSys to generate an RRF subset of the data for which a MRCXT is to be built.

This process generates a MRCXT.RRF file from the existing MRCONSO.RRF and MRHIER.RRF files.  There are a number of configuration options you can use to change the result:


Configuring and Running a Script

In the sections below, you can follow a sample series of steps for putting together the pieces above into a script and actually generating a subset.

Windows

Consider the following script:

@echo off

REM
REM Specify RRF Directory
REM
set source_dir=C:\UMLS\METASUBSET

REM
REM Set Parameter properties
REM
set build_sibs=true
set build_children=true
set compute_xc=true
set versioned_sabs=true
set add_unicode_bom=true
set write_mrcxt_file_statistics=true
set max_contexts=true
set max_contexts_count=10


REM
REM Specify source list restriction (if desired) - in this case do not
REM
REM set source_list_prop="-Dselected.source.list=%source_list%"

REM
REM Specify MetamorphoSys directory
REM
set MMSYS_HOME=C:\UMLS\MMSYS

REM
REM Specify CLASSPATH
REM
set CLASSPATH=%MMSYS_HOME%;%MMSYS_HOME%/lib/mms.jar;%MMSYS_HOME%/lib/objects.jar

REM
REM Specify JAVA_HOME
REM
set JAVA_HOME="C:\Program Files\Java\jre1.5.0_11"

REM
REM Run from MMSYS_HOME to avoid release.dat errors
REM
cd %MMSYS_HOME%
%JAVA_HOME%\bin\javaw -Djava.awt.headless=true -Xms200M -Xmx800M -Dbuild.sibs=%build_sibs%  -Dbuild.children=%build_children% -Dcompute.xc=%compute_xc% -Dversioned.sabs=%versioned_sabs% -Dadd.unicode.bom=%add_unicode_bom% -Dwrite.mrcxt.file.statistics=%write_mrcxt_file_statistics% \
 -Dmax.contexts=%max_contexts% -Dmax.contexts.count=%max_contexts_count% -Dsource.dir=%source_dir% %source_list_prop% gov.nih.nlm.mms.cxt.BatchMRCXTBuilder

The script sets the various configuration options, paths, and environment variables.  It then invokes a Java call from the MMSYS_HOME directory.  This will produce a MRCXT.RRF file in the specified directory.  A log of the progress will also be generated as it runs.


Linux, Macintosh, or Solaris

Consider the following script:

#!/bin/sh -f
#
# Set Parameter properties
#
build_sibs=true
build_children=true
compute_xc=true
versioned_sabs=true
add_unicode_bom=true
write_mrcxt_file_statistics=true
max_contexts=true
max_contexts_count=10
source_dir=/d1/UMLS/METASUBSET

#
# Set source list restriction (if desired) - do not in this case
#
# set source_list_prop=-Dselected.source.list=

#
# Specify MetamorphoSys directory
#
MMSYS_HOME=/d1/UMLS/MMSYS

#
# Specify CLASSPATH
#
CLASSPATH="${MMSYS_HOME}:$MMSYS_HOME/lib/mms.jar:$MMSYS_HOME/lib/objects.jar"

#
# Specify JAVA_HOME
#
JAVA_HOME=$MMSYS_HOME/jre/linux

#
# Run from MMSYS_HOME to avoid release.dat errors
#
export MMSYS_HOME
export CLASSPATH
export JAVA_HOME
cd $MMSYS_HOME

$JAVA_HOME/bin/java -Djava.awt.headless=true -Xms200M -Xmx800M \
 -Dbuild.sibs=$build_sibs \
 -Dbuild.children=$build_children \
 -Dcompute.xc=$compute_xc \
 -Dversioned.sabs=$versioned_sabs \
 -Dadd.unicode.bom=$add_unicode_bom \
 -Dwrite.mrcxt.file.statistics=$write_mrcxt_file_statistics \
 -Dmax.contexts=$max_contexts \
 -Dmax.contexts.count=$max_contexts_count \
 -Dsource.dir=$source_dir \
 $source_list_prop gov.nih.nlm.mms.cxt.BatchMRCXTBuilder

The script sets the various configuration options, paths, and environment variables.  It then invokes a java call from the MMSYS_HOME directory. This will produce a MRCXT.RRF file in the specified directory.  A log of the progress will also be generated as it runs.


Last reviewed: 17 December 2007
Last updated: 17 December 2007
First published: 17 December 2007
Metadata| Permanence level: Permanence Not Guaranteed