gov.nih.nci.caarray.util.owlparser
Class SqlOntologyOwlParser

java.lang.Object
  extended by gov.nih.nci.caarray.util.owlparser.AbstractOntologyOwlParser
      extended by gov.nih.nci.caarray.util.owlparser.SqlOntologyOwlParser

public class SqlOntologyOwlParser
extends AbstractOntologyOwlParser

OWL Parser that writes out sql statements createing the term source, categories and terms from the OWL data.

Author:
dkokotov

Constructor Summary
SqlOntologyOwlParser(java.lang.String name, java.lang.String url, java.io.File sqlFile)
          Create a new parser that will write out to the given file.
 
Method Summary
protected  void finishProcessing()
          Called to indicate the end of processing the OWL doc.
protected  void processCategory(gov.nih.nci.caarray.domain.vocabulary.Category category)
          Process acategory parsed from the OWL.
protected  void processCategorySubclass(gov.nih.nci.caarray.domain.vocabulary.Category category, gov.nih.nci.caarray.domain.vocabulary.Category parentCategory)
          Process a child-parent relationships between the two given categories.
protected  void processTerm(gov.nih.nci.caarray.domain.vocabulary.Term t)
          Process a term parsed from the OWL.
protected  void processTermSource(gov.nih.nci.caarray.domain.vocabulary.TermSource ts)
          Process the term source parsed from the OWL.
protected  void startProcessing()
          Called to indicate the start of processing the OWL doc.
 
Methods inherited from class gov.nih.nci.caarray.util.owlparser.AbstractOntologyOwlParser
getCategoryCache, getTermCache, getTermSource, parse, parse
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlOntologyOwlParser

public SqlOntologyOwlParser(java.lang.String name,
                            java.lang.String url,
                            java.io.File sqlFile)
Create a new parser that will write out to the given file.

Parameters:
name - an explicit name for the term source whose ontology is being parsed
url - an explicit url for the term source whose ontology is being parsed
sqlFile - file to write out to
Method Detail

startProcessing

protected void startProcessing()
                        throws ParseException
Called to indicate the start of processing the OWL doc.

Specified by:
startProcessing in class AbstractOntologyOwlParser
Throws:
ParseException - on error

finishProcessing

protected void finishProcessing()
Called to indicate the end of processing the OWL doc. Subclasses should release any resources acquired during processing. This method will be called even if an error had occurred during the parsing process.

Specified by:
finishProcessing in class AbstractOntologyOwlParser

processCategory

protected void processCategory(gov.nih.nci.caarray.domain.vocabulary.Category category)
                        throws ParseException
Process acategory parsed from the OWL. The category child-parent linkages have not. yet been established at this point

Specified by:
processCategory in class AbstractOntologyOwlParser
Parameters:
category - the parsed category
Throws:
ParseException - on error

processCategorySubclass

protected void processCategorySubclass(gov.nih.nci.caarray.domain.vocabulary.Category category,
                                       gov.nih.nci.caarray.domain.vocabulary.Category parentCategory)
                                throws ParseException
Process a child-parent relationships between the two given categories.

Specified by:
processCategorySubclass in class AbstractOntologyOwlParser
Parameters:
category - the child category
parentCategory - the parent category
Throws:
ParseException - on error

processTerm

protected void processTerm(gov.nih.nci.caarray.domain.vocabulary.Term t)
                    throws ParseException
Process a term parsed from the OWL. The term includes linkages to all categories it belongs to.

Specified by:
processTerm in class AbstractOntologyOwlParser
Parameters:
t - the parsed term.
Throws:
ParseException - on error

processTermSource

protected void processTermSource(gov.nih.nci.caarray.domain.vocabulary.TermSource ts)
                          throws ParseException
Process the term source parsed from the OWL. This term source corresponds to the ontology being parsed.

Specified by:
processTermSource in class AbstractOntologyOwlParser
Parameters:
ts - the parsed term source
Throws:
ParseException - on error