|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nih.nlm.umls.io.RichMRFilesConceptInputStream
public class RichMRFilesConceptInputStream
This ConceptInputStream builds Concept objects from a
full set of "Rich Release Format" MR files.
| Field Summary | |
|---|---|
protected String |
add_suffix
|
protected Map |
atom_hm
|
protected String[] |
file_names
|
protected String |
from_rsab
|
protected String |
from_vsab
|
protected Object[] |
install_paths
|
protected PushBackReader |
mrcoc_source
|
protected int |
mrconso_counter
|
protected int |
mrconso_lines
|
protected PushBackReader |
mrconso_source
|
protected PushBackReader |
mrcxt_source
|
protected PushBackReader |
mrdef_source
|
protected PushBackReader |
mrdoc_source
|
protected PushBackReader |
mrhier_source
|
protected PushBackReader |
mrhist_source
|
protected PushBackReader |
mrmap_source
|
protected PushBackReader |
mrrel_source
|
protected PushBackReader |
mrsat_source
|
protected PushBackReader |
mrsty_source
|
protected String |
null_value
|
protected Map |
rel_hm
|
protected Concept |
this_concept
|
protected String |
to_rsab
|
protected String |
to_vsab
|
protected String[] |
tokens
|
protected List |
warnings
|
| Constructor Summary | |
|---|---|
RichMRFilesConceptInputStream()
Instantiates an empty RichMRFilesConceptInputStream; |
|
| Method Summary | |
|---|---|
void |
close()
Close files opened during open(String[]). |
protected Concept |
getAtoms(Concept this_concept,
String current_cui)
Instantiates Atoms from the MRCONSO.RRF file matching the
specified CUI and adds them to the current Concept. |
protected void |
getAttributes(Concept this_concept,
String current_cui)
Gets Attributes from the MRSAT.RRF files with the
given cui and adds them to the current Concept. |
protected void |
getComponentHistories(Concept this_concept,
String current_cui)
Gets ComponentHistorys from the MRHIST.RRF file with the
given cui and adds them to the current Concept. |
int |
getConceptProgress()
Returns the percentage of MRCONSO lines that have been processed. |
protected void |
getContexts(Concept this_concept,
String current_cui)
Gets Contexts from the MRCXT.RRF and
MRHIER.RRF files with the
given cui and adds them to this_concept. |
protected void |
getCoocurrences(Concept this_concept,
String current_cui)
Gets Coocurrences from the MRCOC.RRF file with the
given cui and adds them to the current Concept. |
protected void |
getDefinitions(Concept this_concept,
String current_cui)
Gets Definitions from the MRDEF.RRF file with the
given cui and adds them to the current Concept. |
protected Map |
getLineCounts()
Reads through MRFILES.RRF to determine the size
of MRCONSO.RRF. |
protected void |
getMappings(Concept this_concept,
String current_cui)
Gets Mappings from the MRMAP.RRF file with the
given cui and adds them to the current Concept. |
String |
getNullValue()
Returns the null value. |
protected void |
getRelationships(Concept this_concept,
String current_cui)
Gets Relationships from the MRREL.RRF file with the
given cui and adds them to the current Concept. |
protected void |
getSemanticTypes(Concept this_concept,
String current_cui)
Gets SemanticTypes from the MRSTY.RRF file with the
given cui and adds them to the current Concept. |
String[] |
getWarnings()
Returns a String[] of warnings accumulated during
processing of the input stream. |
boolean |
isEmptyValue(String token)
Indicates whether or not the specified token is null or contains a null value as defined by being either zero length or a value equal to the null value. |
protected Atom |
newInstanceFromMRCONSO(String line)
Instantiates an Atom from a MRCONSO.RRF line. |
protected Context |
newInstanceFromMRHIER(String line)
Instantiates an Context from a MRHIER.RRF line. |
void |
open(String[] paths)
Opens all of the MR Files in preparation for subsetting. |
protected void |
openMRFiles()
Opens the Rich Release Format MR files. |
protected PushBackReader |
openSourceFile(String name,
boolean fileMustExist)
Opens the source file from the most current of the given installation paths in which this source is available. |
Concept |
readConcept()
Returns a Concept containing data from the MR files. |
void |
setAdditionalSuffix(String suffix)
Sets an additional suffix. |
void |
setNullValue(String null_value)
Sets the null value to use. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected PushBackReader mrconso_source
protected PushBackReader mrcxt_source
protected PushBackReader mrsty_source
protected PushBackReader mrdef_source
protected PushBackReader mrrel_source
protected PushBackReader mrcoc_source
protected PushBackReader mrsat_source
protected PushBackReader mrhist_source
protected PushBackReader mrmap_source
protected PushBackReader mrhier_source
protected PushBackReader mrdoc_source
protected Map atom_hm
protected Map rel_hm
protected String[] file_names
protected Object[] install_paths
protected Concept this_concept
protected int mrconso_lines
protected int mrconso_counter
protected String from_rsab
protected String from_vsab
protected String to_rsab
protected String to_vsab
protected String add_suffix
protected final String[] tokens
protected List warnings
protected String null_value
| Constructor Detail |
|---|
public RichMRFilesConceptInputStream()
RichMRFilesConceptInputStream;
| Method Detail |
|---|
public void setNullValue(String null_value)
setNullValue in interface LocalNullValueSupportnull_value - the new null string valuepublic String getNullValue()
getNullValue in interface LocalNullValueSupportpublic boolean isEmptyValue(String token)
isEmptyValue in interface LocalNullValueSupport
public void open(String[] paths)
throws IOException
open in interface ConceptInputStreampaths - the sources containing the files
IOException - if any files can not be opened
protected void openMRFiles()
throws IOException
IOException - if any files cannot be opened
public void close()
throws IOException
open(String[]).
close in interface ConceptInputStreamIOException - if files can not be closed
public Concept readConcept()
throws IOException
Concept containing data from the MR files.
readConcept in interface ConceptInputStreamConcept containing data from the MR files
IOException - if files could not be readpublic int getConceptProgress()
MRCONSO lines that have been processed.
getConceptProgress in interface ConceptInputStreamMRCONSO lines that have been processed
protected PushBackReader openSourceFile(String name,
boolean fileMustExist)
throws IOException
name - the filenamefileMustExist - true if a FileNotFoundException should
be thrown when the file doesn't exist; false otherwise
PushBackReader on the file if it exists. If
fileMustExist is false then a
PushBackReader enclosing a StringReader of an empty
String will be returned.
IOException - if the file could not be opened. If
fileMustExist is true a
FileNotFoundException will be thrown if the specified
file doesn't exist.
protected Map getLineCounts()
throws IOException
MRFILES.RRF to determine the size
of MRCONSO.RRF.
Map of file names to lines in file
IOException - if the file cannot be opened or read
protected Atom newInstanceFromMRCONSO(String line)
throws IOException
Atom from a MRCONSO.RRF line.
line - a line from MRCONSO.RRF
Atom matching the line
IOException - if there is a problem with the file
protected Concept getAtoms(Concept this_concept,
String current_cui)
throws IOException
Atoms from the MRCONSO.RRF file matching the
specified CUI and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
Concept that will contain the Atoms
IOException - if anything goes wrong
protected void getAttributes(Concept this_concept,
String current_cui)
throws IOException
Attributes from the MRSAT.RRF files with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading the file
protected void getContexts(Concept this_concept,
String current_cui)
throws IOException
Contexts from the MRCXT.RRF and
MRHIER.RRF files with the
given cui and adds them to this_concept.
this_concept - Concept that will contain the Contextscurrent_cui - String representation of the cui
IOException - if problem reading from MRCXT.RRF or
MRHIER.RRF
protected Context newInstanceFromMRHIER(String line)
throws IOException
Context from a MRHIER.RRF line.
line - a line from MRHIER.RRF
Context matching the line
IOException - if there is a problem with the file
protected void getCoocurrences(Concept this_concept,
String current_cui)
throws IOException
Coocurrences from the MRCOC.RRF file with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading from MRCOC.RRF
protected void getDefinitions(Concept this_concept,
String current_cui)
throws IOException
Definitions from the MRDEF.RRF file with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading from MRDEF.RRF
protected void getSemanticTypes(Concept this_concept,
String current_cui)
throws IOException
SemanticTypes from the MRSTY.RRF file with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading from MRSTY.RRF
protected void getRelationships(Concept this_concept,
String current_cui)
throws IOException
Relationships from the MRREL.RRF file with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading from MRREL.RRF
protected void getComponentHistories(Concept this_concept,
String current_cui)
throws IOException
ComponentHistorys from the MRHIST.RRF file with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading from MRHIST.RRF
protected void getMappings(Concept this_concept,
String current_cui)
throws IOException
Mappings from the MRMAP.RRF file with the
given cui and adds them to the current Concept.
this_concept - the current Conceptcurrent_cui - the current CUI
IOException - if problem reading from MRMAP.RRFpublic void setAdditionalSuffix(String suffix)
suffix - to be added to the .RRF suffixpublic String[] getWarnings()
String[] of warnings accumulated during
processing of the input stream.
getWarnings in interface ConceptInputStreamString[] of warnings
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||