uk.ac.manchester.cs.owl.owlapi
Class ParsableOWLOntologyFactory

java.lang.Object
  extended by uk.ac.manchester.cs.owl.owlapi.AbstractInMemOWLOntologyFactory
      extended by uk.ac.manchester.cs.owl.owlapi.ParsableOWLOntologyFactory
All Implemented Interfaces:
OWLOntologyFactory

public class ParsableOWLOntologyFactory
extends AbstractInMemOWLOntologyFactory

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

An ontology factory that creates ontologies by parsing documents containing concrete representations of ontologies. This ontology factory will claim that it is suitable for creating an ontology if the document IRI can be opened for reading. This factory will not create empty ontologies. Parsers are instantiated by using a list of OWLParserFactory objects that are obtained from the OWLParserFactoryRegistry.


Nested Class Summary
 
Nested classes/interfaces inherited from interface org.semanticweb.owlapi.model.OWLOntologyFactory
OWLOntologyFactory.OWLOntologyCreationHandler
 
Constructor Summary
ParsableOWLOntologyFactory()
          Creates an ontology factory.
 
Method Summary
 boolean canCreateFromDocumentIRI(IRI documentIRI)
          Overriden - We don't create new empty ontologies - this isn't our responsibility
 boolean canLoad(OWLOntologyDocumentSource documentSource)
          Determines if the factory can load an ontology for the specified input souce
 OWLOntology createOWLOntology(java.net.URI ontologyURI, java.net.URI physicalURI)
          Overriden - This method will throw an OWLException which wraps an UnsupportedOperationException.
 java.util.List<OWLParser> getParsers()
          Gets a list of parsers that this factory uses when it tries to create an ontology from a concrete representation.
 OWLOntology loadOWLOntology(OWLOntologyDocumentSource documentSource, OWLOntologyFactory.OWLOntologyCreationHandler mediator)
          Creates and loads an OWLOntology.
 void setOWLOntologyManager(OWLOntologyManager owlOntologyManager)
           
 
Methods inherited from class uk.ac.manchester.cs.owl.owlapi.AbstractInMemOWLOntologyFactory
createOWLOntology, getOWLOntologyManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ParsableOWLOntologyFactory

public ParsableOWLOntologyFactory()
Creates an ontology factory.

Method Detail

setOWLOntologyManager

public void setOWLOntologyManager(OWLOntologyManager owlOntologyManager)
Specified by:
setOWLOntologyManager in interface OWLOntologyFactory
Overrides:
setOWLOntologyManager in class AbstractInMemOWLOntologyFactory

getParsers

public java.util.List<OWLParser> getParsers()
Gets a list of parsers that this factory uses when it tries to create an ontology from a concrete representation.


canCreateFromDocumentIRI

public boolean canCreateFromDocumentIRI(IRI documentIRI)
Overriden - We don't create new empty ontologies - this isn't our responsibility

Specified by:
canCreateFromDocumentIRI in interface OWLOntologyFactory
Overrides:
canCreateFromDocumentIRI in class AbstractInMemOWLOntologyFactory
Parameters:
documentIRI -
Returns:
true if the factory can create an ontology given the specified document IRI, or false if the factory cannot create an ontology given the specified document IRI.

createOWLOntology

public OWLOntology createOWLOntology(java.net.URI ontologyURI,
                                     java.net.URI physicalURI)
Overriden - This method will throw an OWLException which wraps an UnsupportedOperationException.


canLoad

public boolean canLoad(OWLOntologyDocumentSource documentSource)
Description copied from interface: OWLOntologyFactory
Determines if the factory can load an ontology for the specified input souce

Parameters:
documentSource - The input source from which to load the ontology
Returns:
true if the factory can load from the specified input source.

loadOWLOntology

public OWLOntology loadOWLOntology(OWLOntologyDocumentSource documentSource,
                                   OWLOntologyFactory.OWLOntologyCreationHandler mediator)
                            throws OWLOntologyCreationException
Description copied from interface: OWLOntologyFactory
Creates and loads an OWLOntology. be loaded into the ontology.

Parameters:
documentSource - The input source
mediator - A pointer to an OWLOntologyCreationHandler which will be notified immediately after an emtpty ontology has been created, but before the source data is read and the ontology is loaded with axioms.
Returns:
The newly created and loaded ontology
Throws:
OWLOntologyCreationException - if the ontology could not be created.