org.semanticweb.owl.io
Interface OWLOntologyInputSource

All Known Implementing Classes:
FileInputSource, PhysicalURIInputSource, ReaderInputSource, StreamInputSource, StringInputSource

public interface OWLOntologyInputSource

Author: Matthew Horridge
The University Of Manchester
Bio-Health Informatics Group
Date: 24-Apr-2007

An input source provides a point for loading an ontology. An input source may provide three forms of obtaining a concrete representation of an ontology 1) From a Reader, 2) From and InputStream 3) From a physical URI. Consumers which use an input source will attempt to obtain a concrete representation of an ontology in the above order. While an ontology input source may appear similar to a SAX input source, an important difference is that the getReader and getInputStream methods return new instances each time the method is called. This allows multiple attempts at loading an ontology.


Method Summary
 java.io.InputStream getInputStream()
          If an input stream can be obtained from this input source then this method creates it.
 java.net.URI getPhysicalURI()
          Gets the physical URI of the ontology.
 java.io.Reader getReader()
          Gets a reader which can be used to read an ontology from.
 boolean isInputStreamAvailable()
          Determines if an input stream is available which an ontology can be parsed from.
 boolean isReaderAvailable()
          Determines if a reader is available which an ontology can be parsed from.
 

Method Detail

isReaderAvailable

boolean isReaderAvailable()
Determines if a reader is available which an ontology can be parsed from.

Returns:
true if a reader can be ontained from this input source, or false if a reader cannot be obtained from this input source.

getReader

java.io.Reader getReader()
Gets a reader which can be used to read an ontology from. This method may be called multiple times. Each invocation will return a new Reader. This method should not be called if the isReaderAvailable method returns false

Returns:
A new Reader which the ontology can be read from.

isInputStreamAvailable

boolean isInputStreamAvailable()
Determines if an input stream is available which an ontology can be parsed from.

Returns:
true if an input stream can be obtained, false if an input stream cannot be obtained from this input source.

getInputStream

java.io.InputStream getInputStream()
If an input stream can be obtained from this input source then this method creates it. This method may be called multiple times. Each invocation will return a new input stream. This method should not be called if the isInputStreamAvailable method returns false.

Returns:
A new input stream which the ontology can be read from.

getPhysicalURI

java.net.URI getPhysicalURI()
Gets the physical URI of the ontology.

Returns:
A URI which represents the physical URI of an ontology - this will never be null.