org.semanticweb.owlapi.io
Class AbstractOWLParser
java.lang.Object
org.semanticweb.owlapi.io.AbstractOWLParser
- All Implemented Interfaces:
- OWLParser
- Direct Known Subclasses:
- KRSS2OWLParser, KRSSOWLParser, ManchesterOWLSyntaxOntologyParser, OWLFunctionalSyntaxOWLParser, OWLOBOParser, OWLXMLParser, RDFXMLParser, TurtleOntologyParser
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.semanticweb.owlapi.io.OWLParser |
parse |
AbstractOWLParser
protected AbstractOWLParser()
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(IRI documentIRI)
throws java.io.IOException
- 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:
documentIRI
- The URI from which the input stream should be returned
- Returns:
- The input stream obtained from the URI
- Throws:
java.io.IOException
- if there was an IOException
in obtaining the input stream from the URI.
getInputSource
protected org.xml.sax.InputSource getInputSource(OWLOntologyDocumentSource documentSource)
throws java.io.IOException
- Throws:
java.io.IOException
parse
public OWLOntologyFormat parse(IRI documentIRI,
OWLOntology ontology)
throws OWLParserException,
java.io.IOException,
UnloadableImportException
- Description copied from interface:
OWLParser
- Parses the ontology that has a concrete representation which is pointed
to by the specified document IRI. Implementors of this method should
load any imported ontologies with the loadImports method on OWLOntologyManager.
- Specified by:
parse
in interface OWLParser
- Parameters:
documentIRI
- The document IRI where the ontology should be loaded fromontology
- The ontology that the concrete representation should be
parsed into. @return An OWLOntologyFormat
which describes the concrete representation
format which was parsed to obtain the ontology. This will never be null
.
- Returns:
- The format of the ontology
- Throws:
OWLParserException
- if there was a problem parsing the ontology. This indicates an error in the syntax
with this ontology document that the parser reads.
java.io.IOException
- if there was an IOException during parsing
UnloadableImportException
- if loading this ontology prompted the loading of an import and the import
could not be loaded.