edu.mayo.informatics.lexgrid.convert.directConversions
Class TextToSQL

java.lang.Object
  extended by edu.mayo.informatics.lexgrid.convert.directConversions.TextToSQL

public class TextToSQL
extends java.lang.Object

Converstion tool for loading a delimited text format into SQL.

Version:
subversion $Revision: 8756 $ checked in on $Date: 2007-08-30 17:13:22 +0000 (Thu, 30 Aug 2007) $
Author:
Dan Armbrust

Constructor Summary
TextToSQL()
           
 
Method Summary
 CodingScheme getCodingScheme()
           
 java.lang.String getCodingSchemeName()
           
 java.lang.String getVersion()
           
 CodingScheme load(java.net.URI fileLocation, java.lang.String token, LoaderPreferences loaderPrefs, LgMessageDirectorIF messageDirector, boolean forceFormatB)
          Text to SQL Converter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TextToSQL

public TextToSQL()
Method Detail

getCodingSchemeName

public java.lang.String getCodingSchemeName()
Returns:
the codingSchemeName

getVersion

public java.lang.String getVersion()
Returns:
the representsVersion

load

public CodingScheme load(java.net.URI fileLocation,
                         java.lang.String token,
                         LoaderPreferences loaderPrefs,
                         LgMessageDirectorIF messageDirector,
                         boolean forceFormatB)
                  throws CodingSchemeAlreadyLoadedException
Text to SQL Converter. Format of the text files is as follows: Format a: (ignore the *'s) (this does not display properly in HTML - please see the readme file)
 
    <codingSchemeName>\t<codingSchemeId>\t<defaultLanguage>\t<formalName>[\t<version>][\t<source>][\t<description>][\t<copyright>]
    <name1>[\t <description>] 
    \t <name2>[\t <description>] 
    \t\t <name3>[\t <description>]
    \t\t <name4>[\t <description>]
 
Where the leading tabs represent hierarchical hasSubtype relationship nesting (name1 hasSubtype name2 and name2 hasSubtype name3,) The line that starts with keyword Relation is used to setup the association information. Lines starting with "#" are view comments - they are completely ignored. Rules - if doesn't already exist in the database, assign it a unique numeric concept code. Name becomes the entity description and preferred presentation. If description is supplied, it becomes the definition. - if already exists in the database, use the pre-assigned code. If is supplied (a) if one doesn't exist, already, use the supplied one (b) if one exists already and it doesn't match - issue a warning. Format b:
 <code>
   \t<name>[\t<description>]
 
Same as (a) except that the concept codes are part of the input. If the same code occurs twice, the names must match. Description rules same as above

Parameters:
fileLocation - location of the tab delimited file
token - parsing token, if null default is "/t"
sqlLiteServer - location of the SQLLite server
sqlLiteDriver - driver class
sqlLiteUsername - username for server authentification
sqlLitePassword - password for server authenification
loaderPrefs - Loader Preferences
messageDirector - log message output
forceFormatB - Force reading of a format A file as Format B
Throws:
java.lang.Exception
CodingSchemeAlreadyLoadedException

getCodingScheme

public CodingScheme getCodingScheme()

Copyright: (c) 2004-2006 Mayo Foundation for Medical Education and Research (MFMER). All rights reserved. MAYO, MAYO CLINIC, and the triple-shield Mayo logo are trademarks and service marks of MFMER.