org.semanticweb.owlapi.io
Interface OWLParser

All Known Implementing Classes:
AbstractOWLParser, KRSS2OWLParser, KRSSOWLParser, ManchesterOWLSyntaxOntologyParser, OWLFunctionalSyntaxOWLParser, OWLOBOParser, OWLXMLParser, RDFXMLParser, TurtleOntologyParser

public interface OWLParser

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

An OWLParser parses an ontology document into an OWL API object representation of an ontology.


Method Summary
 OWLOntologyFormat parse(IRI documentIRI, OWLOntology ontology)
          Parses the ontology that has a concrete representation which is pointed to by the specified document IRI.
 OWLOntologyFormat parse(OWLOntologyDocumentSource documentSource, OWLOntology ontology)
          Parses the ontology that has a concrete representation which is pointed to by the specified input source.
 void setOWLOntologyManager(OWLOntologyManager owlOntologyManager)
          Sets the OWLOntologyManager which should be used to load imports etc.
 

Method Detail

setOWLOntologyManager

void setOWLOntologyManager(OWLOntologyManager owlOntologyManager)
Sets the OWLOntologyManager which should be used to load imports etc.

Parameters:
owlOntologyManager -

parse

OWLOntologyFormat parse(IRI documentIRI,
                        OWLOntology ontology)
                        throws OWLParserException,
                               java.io.IOException,
                               OWLOntologyChangeException,
                               UnloadableImportException
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.

Parameters:
documentIRI - The document IRI where the ontology should be loaded from
ontology - 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
OWLOntologyChangeException - if there was a problem updating the specified ontology from information that was parsed.
UnloadableImportException - if loading this ontology prompted the loading of an import and the import could not be loaded.

parse

OWLOntologyFormat parse(OWLOntologyDocumentSource documentSource,
                        OWLOntology ontology)
                        throws OWLParserException,
                               java.io.IOException,
                               OWLOntologyChangeException,
                               UnloadableImportException
Parses the ontology that has a concrete representation which is pointed to by the specified input source. Implementors of this method should load any imported ontologies with the makeImportsLoadRequest method on OWLOntologyManager.

Parameters:
documentSource - The input source which points the concrete representation. If the input source can provider a Reader then the ontology is parsed from the Reader. If the input source cannot provide a reader then it is parsed from the InputStream. If the input source cannot provide an InputStream then it is parsed from the ontology document IRI.
ontology - The ontology which the representation will be parsed into
Returns:
An OWLOntologyFormat which describes the concrete representation format which was parsed to obtain 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
OWLOntologyChangeException - if there was a problem updating the specified ontology from information that was parsed.
UnloadableImportException - if loading this ontology prompted the loading of an import and the import could not be loaded.