org.semanticweb.owl.io
Class AbstractOWLParser

java.lang.Object
  extended by org.semanticweb.owl.io.AbstractOWLParser
All Implemented Interfaces:
OWLParser

public abstract class AbstractOWLParser
extends java.lang.Object
implements OWLParser

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 14-Nov-2006

A convenience base class for parsers, which provides a mechanism to manage the setting and getting of the OWLOntologyManager that should be associated with the parser


Constructor Summary
protected AbstractOWLParser()
           
 
Method Summary
protected  org.xml.sax.InputSource getInputSource(OWLOntologyInputSource inputSource)
           
protected  java.io.InputStream getInputStream(java.net.URI uri)
          A convenience method that obtains an input stream from a URI.
 OWLOntologyManager getOWLOntologyManager()
           
protected  java.lang.String getRequestTypes()
           
 OWLOntologyFormat parse(java.net.URI physicalURI, OWLOntology ontology)
          Parses the ontology that has a concrete representation which is pointed to by the specified physical URI.
 void setOWLOntologyManager(OWLOntologyManager owlOntologyManager)
          Sets the OWLOntologyManager which should be used to load imports etc.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.semanticweb.owl.io.OWLParser
parse
 

Constructor Detail

AbstractOWLParser

protected AbstractOWLParser()
Method Detail

setOWLOntologyManager

public void setOWLOntologyManager(OWLOntologyManager owlOntologyManager)
Description copied from interface: OWLParser
Sets the OWLOntologyManager which should be used to load imports etc.

Specified by:
setOWLOntologyManager in interface OWLParser

getOWLOntologyManager

public OWLOntologyManager getOWLOntologyManager()

getRequestTypes

protected java.lang.String getRequestTypes()

getInputStream

protected java.io.InputStream getInputStream(java.net.URI uri)
                                      throws OWLParserException
A convenience method that obtains an input stream from a URI. This method sets up the correct request type and wraps the input stream within a buffered input stream

Parameters:
uri -
Returns:
Throws:
OWLParserException

getInputSource

protected org.xml.sax.InputSource getInputSource(OWLOntologyInputSource inputSource)
                                          throws OWLParserException
Throws:
OWLParserException

parse

public OWLOntologyFormat parse(java.net.URI physicalURI,
                               OWLOntology ontology)
                        throws OWLOntologyCreationException
Description copied from interface: OWLParser
Parses the ontology that has a concrete representation which is pointed to by the specified physical URI. Implementors of this method should load any imported ontologies with the loadImports method on OWLOntologyManager.

Specified by:
parse in interface OWLParser
ontology - The ontology that the concrete representation should be parsed into.
Returns:
An OWLOntologyFormat which describes the concrete representation format which was parsed to obtain the ontology. This will never be null.
Throws:
OWLParserException - if there was a problem parsing the ontology.
OWLOntologyCreationException