Interface OWLParser

All Superinterfaces:
Serializable
All Known Implementing Classes:
AbstractOWLParser, DLSyntaxOWLParser, KRSS2OWLParser, KRSSOWLParser, ManchesterOWLSyntaxOntologyParser, OBOFormatOWLAPIParser, OWLFunctionalSyntaxOWLParser, OWLXMLParser, RDFXMLParser, TurtleOntologyParser

public interface OWLParser extends Serializable
An OWLParser parses an ontology document and adds the axioms of the parsed ontology to the OWLOntology object passed to the parse methods.
OWLParser implementations are supposed to be stateless, and therefore immutable. By default, implementation factories are injected in OWLOntologyManager instances at creation. This is not mandatory, and a specific manager can have different implementations injected at any time after creation.
OWLParsers are typically used by OWLOntologyManager to populate empty OWLOntology, but can be used to add axioms to an OWLOntology that already contains axioms.
One such case is parsing owl:imports which point to documents that are not ontologies. In this case, any axioms parsed from the imported document are added to the existing ontology, which already contains axioms parsed from a different document.
Since:
2.0.0
Author:
Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
  • Method Details

    • parse

      default OWLDocumentFormat parse(IRI documentIRI, OWLOntology ontology)
      Parses the ontology with a concrete representation available at documentIRI and adds its axioms to ontology. Implementors of this method should load imported ontologies through makeLoadImportRequest().
      Parameters:
      documentIRI - the IRI of the document to parse
      ontology - the ontology to which the parsed axioms are added
      Returns:
      the format of the parsed ontology
      Throws:
      OWLParserException - if there was a parsing problem parsing the ontology.
      OWLOntologyChangeException - if there was a problem updating ontology. Typically this depends on the document being parsed containing an ontology with an ontology IRI clashing with one already loaded.
      UnloadableImportException - if one or more imports could not be loaded.
    • parse

      Parses the ontology with a concrete representation in documentSource and adds its axioms to ontology. Implementors of this method should load imported ontologies through makeLoadImportRequest().
      Parameters:
      documentSource - the source of a concrete representation of the document to parse
      ontology - the ontology to which the parsed axioms are added
      configuration - parsing options for the parser
      Returns:
      the format of the parsed ontology
      Throws:
      OWLParserException - if there was a parsing problem parsing the ontology. @throws OWLOntologyChangeException if there was a problem updating ontology. Typically this depends on the document being parsed containing an ontology with an ontology IRI clashing with one already loaded.
      UnloadableImportException - if one or more imports could not be loaded.
    • getName

      default String getName()
      Returns:
      a unique name for the parser, typically the simple class name
    • getSupportedFormat

      OWLDocumentFormatFactory getSupportedFormat()
      Returns:
      The supported format for this parser.