uk.ac.manchester.cs.owl
Class ParsableOWLOntologyFactory

java.lang.Object
  extended by uk.ac.manchester.cs.owl.AbstractInMemOWLOntologyFactory
      extended by uk.ac.manchester.cs.owl.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 physical URI 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.owl.model.OWLOntologyFactory
OWLOntologyFactory.OWLOntologyCreationHandler
 
Constructor Summary
ParsableOWLOntologyFactory()
          Creates an ontology factory.
 
Method Summary
 boolean canCreateFromPhysicalURI(java.net.URI physicalURI)
          Overriden - We don't create new empty ontologies - this isn't our responsibility
 boolean canLoad(OWLOntologyInputSource inputSource)
          Determines if the factory can load an ontology for the specified physical URI.
 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(OWLOntologyInputSource inputSource, OWLOntologyFactory.OWLOntologyCreationHandler mediator)
          Creates and loads an OWLOntology.
 void setOWLOntologyManager(OWLOntologyManager owlOntologyManager)
           
 
Methods inherited from class uk.ac.manchester.cs.owl.AbstractInMemOWLOntologyFactory
createOWLOntology, getOWLOntologyManager
 
Methods inherited from class java.lang.Object
equals, 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.


canCreateFromPhysicalURI

public boolean canCreateFromPhysicalURI(java.net.URI physicalURI)
Overriden - We don't create new empty ontologies - this isn't our responsibility

Specified by:
canCreateFromPhysicalURI in interface OWLOntologyFactory
Overrides:
canCreateFromPhysicalURI in class AbstractInMemOWLOntologyFactory
Parameters:
physicalURI - The physical URI of the ontology to be created. This may be null.
Returns:
true if the factory can create an ontology given a physical URI, or false if the factory cannot create an ontology.

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(OWLOntologyInputSource inputSource)
Description copied from interface: OWLOntologyFactory
Determines if the factory can load an ontology for the specified physical URI.

Returns:
true if the factory can load from the specified input source.

loadOWLOntology

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

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.