org.LexGrid.LexBIG.Impl.loaders
Class OWLLoaderImpl

java.lang.Object
  extended by org.LexGrid.LexBIG.Impl.Extensions.AbstractExtendable
      extended by org.LexGrid.LexBIG.Impl.loaders.BaseLoader
          extended by org.LexGrid.LexBIG.Impl.loaders.OWLLoaderImpl
All Implemented Interfaces:
java.io.Serializable, Extendable, Loader, OWL_Loader, StatusReporter

public class OWLLoaderImpl
extends BaseLoader
implements OWL_Loader

Class to load OWL files into the LexBIG API.

Version:
subversion $Revision: $ checked in on $Date: $
Author:
Dan Armbrust, Jesse Erdmann
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class org.LexGrid.LexBIG.Impl.loaders.BaseLoader
BaseLoader.DoConversion
 
Field Summary
 
Fields inherited from class org.LexGrid.LexBIG.Impl.loaders.BaseLoader
ASYNC_OPTION, FAIL_ON_ERROR_OPTION, inUse, LOADER_POST_PROCESSOR_OPTION, LOADER_PREFERENCE_FILE_OPTION, MANIFEST_FILE_OPTION, SUPPLEMENT_OPTION
 
Fields inherited from interface org.LexGrid.LexBIG.Extensions.Load.OWL_Loader
description, name
 
Constructor Summary
OWLLoaderImpl()
           
 
Method Summary
protected  ExtensionDescription buildExtensionDescription()
          Builds the extension description.
protected  OptionHolder declareAllowedOptions(OptionHolder holder)
           
protected  URNVersionPair[] doLoad()
           
 void finalize()
           
 OntologyFormat getOntologyFormat()
          Return the ontology format the loader can handle
 void load(java.net.URI source, java.net.URI codingSchemeManifestURI, int memorySafe, boolean stopOnErrors, boolean async)
          Load content from a candidate resource.
 void setLoaderPreferences(LoaderPreferences prefs)
          Sets the Loader's LoaderPreferences.
 void validate(java.net.URI uri, java.net.URI manifest, int validationLevel)
          Validate content for a candidate resource without performing a load.
 
Methods inherited from class org.LexGrid.LexBIG.Impl.loaders.BaseLoader
addBooleanOptionValue, baseLoad, buildRootNode, clearLog, constructVersionPairsFromCodingSchemes, createCachingMessageDirectorIF, createDefaultInserter, createDefaultInserter, doesOptionExist, doIndex, doPostProcessing, doTransitiveAndIndex, doTransitiveTable, getAbsoluteCodingSchemeVersionReferenceFromOptionString, getCodingSchemeManifest, getCodingSchemeManifestURI, getCodingSchemeReferences, getDescription, getLoaderPreferences, getLog, getLogger, getManifestUtil, getMessageDirector, getName, getOptions, getPostProcessor, getProvider, getResourceUri, getStatus, getStringFromURI, getVersion, isDoApplyPostLoadManifest, isDoComputeTransitiveClosure, isDoIndexing, isDoRegister, isDoRemoveOnFailure, isInUse, load, lock, persistCodingSchemeToDatabase, persistCodingSchemeToDatabase, register, register, setCachingMessageDirectorIF, setCodingSchemeManifest, setCodingSchemeManifestURI, setCodingSchemeReferences, setDoApplyPostLoadManifest, setDoComputeTransitiveClosure, setDoIndexing, setDoRegister, setDoRemoveOnFailure, setInUse, setLoaderPreferences, setManifestUtil, setOptions, setResourceUri, setStatus, unlock, urnVersionPairToAbsoluteCodingSchemeVersionReference
 
Methods inherited from class org.LexGrid.LexBIG.Impl.Extensions.AbstractExtendable
getExtensionDescription
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.LexGrid.LexBIG.Extensions.Load.Loader
clearLog, getCodingSchemeManifest, getCodingSchemeManifestURI, getCodingSchemeReferences, getLoaderPreferences, getLog, getOptions, getStatus, load, setCodingSchemeManifest, setCodingSchemeManifestURI, setLoaderPreferences
 
Methods inherited from interface org.LexGrid.LexBIG.Extensions.Extendable
getDescription, getName, getProvider, getVersion
 

Constructor Detail

OWLLoaderImpl

public OWLLoaderImpl()
Method Detail

buildExtensionDescription

protected ExtensionDescription buildExtensionDescription()
Description copied from class: AbstractExtendable
Builds the extension description.

Specified by:
buildExtensionDescription in class AbstractExtendable
Returns:
the extension description

validate

public void validate(java.net.URI uri,
                     java.net.URI manifest,
                     int validationLevel)
              throws LBParameterException
Description copied from interface: OWL_Loader
Validate content for a candidate resource without performing a load.

Returns without exception if validation succeeds.

Specified by:
validate in interface OWL_Loader
Parameters:
uri - URI corresponding to the OWL file.
manifest - URI corresponding to the XML document containing load coding scheme manifest list; null if not applicable. Must be a valid xml file for schema http://LexGrid.org/schema/LexBIG/2007/01/CodingSchemeManifestList.xsd
validationLevel - Supported levels of validation include: 0 = Verify XML is well formed. 1 = Verify XML is valid.
Throws:
LBParameterException

load

public void load(java.net.URI source,
                 java.net.URI codingSchemeManifestURI,
                 int memorySafe,
                 boolean stopOnErrors,
                 boolean async)
          throws LBException
Description copied from interface: OWL_Loader
Load content from a candidate resource. This will also result in implicit generation of standard indices required by the LexBIG runtime.

An exception is raised if resources cannot be accessed or another load operation is already in progress.

Specified by:
load in interface OWL_Loader
Parameters:
source - URI corresponding to the OWL file.
codingSchemeManifestURI - URI corresponding to the XML document containing load coding scheme manifest list; null if not applicable. Must be a valid xml file for schema http://LexGrid.org/schema/LexBIG/2007/01/CodingSchemeManifestList.xsd
memorySafe - If specified, indicates the profile used to tune memory/performance tradeoffs. Options are: 1 = Faster/more memory (holds OWL in memory) 2 = Slower/less memory (cache OWL to database)
stopOnErrors - True means stop if any load error is detected. False means attempt to load what can be loaded if recoverable errors are encountered.
async - Flag controlling whether load occurs in the calling thread. If true, the load will occur in a separate asynchronous process. If false, this method blocks until the load operation completes or fails. Regardless of setting, the getStatus and getLog calls are used to fetch results.
Throws:
LBException

declareAllowedOptions

protected OptionHolder declareAllowedOptions(OptionHolder holder)
Specified by:
declareAllowedOptions in class BaseLoader

doLoad

protected URNVersionPair[] doLoad()
                           throws CodingSchemeAlreadyLoadedException
Specified by:
doLoad in class BaseLoader
Throws:
CodingSchemeAlreadyLoadedException

finalize

public void finalize()
              throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

setLoaderPreferences

public void setLoaderPreferences(LoaderPreferences prefs)
                          throws LBParameterException
Description copied from class: BaseLoader
Sets the Loader's LoaderPreferences.

Specified by:
setLoaderPreferences in interface Loader
Overrides:
setLoaderPreferences in class BaseLoader
Parameters:
prefs - The LoaderPreference object to be loaded. It is recommended that all subclasses override and check if the LoaderPreferences object is valid for the particular loader.
Throws:
LBParameterException

getOntologyFormat

public OntologyFormat getOntologyFormat()
Description copied from interface: Loader
Return the ontology format the loader can handle

Specified by:
getOntologyFormat in interface Loader
Overrides:
getOntologyFormat in class BaseLoader

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.