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:
- An installed RRF Metathesaurus subset.
- MetamorphoSys installation (like an unpacked mmsys.zip file).
- 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: 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:
- add_unicode_bom: Use true to prepend MRCXT.RRF with a Unicode byte order mark (BOM), false otherwise.
- build_sibs: Use true to build SIB entries, false otherwise.
- build_children: Use true to build CHD entries, false otherwise.
- compute_xc: Use true to compute the MRCXT.XC flag, false otherwise.
- max_contexts: Use true to restrict the number of tree positions per atom, false otherwise.
- max_contexts_count: If max_contexts is true, the maximum number of tree positions per atom. After this number is encountered, all others in MRHIER.RRF are ignored.
- source_list: Use a semi-colon separated list of RSAB or VSAB values to indicate which sources to build contexts for.
- versioned_sabs: Use true to used versioned SAB values for MRCXT.SAB, false otherwise.
- write_mrcxt_file_statistics: Use true to update MRCOLS.RRF and MRFILES.RRF to accurately reflect the compute d MRCXT.RRF file, false otherwise.
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\jpf-boot.jar
REM
REM Specify JAVA_HOME
REM
set JAVA_HOME="%MMSYS_HOME%\jre\windows"
REM
REM Run from MMSYS_HOME to avoid release.dat errors
REM
cd %MMSYS_HOME%
%JAVA_HOME%\bin\javaw -Djava.awt.headless=true -Xms300M -Xmx1000M -Djpf.boot.config=%MMSYS_HOME%/etc/cxt.boot.properties -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% org.java.plugin.boot.Boot
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 -Xms300M -Xmx1000M \
-Djpf.boot.config=$MMSYS_HOME/etc/cxt.boot.properties -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 org.java.plugin.boot.Boot
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: July 29, 2016