org.semanticweb.owlapi.io
Interface OWLOntologyDocumentSource

All Known Implementing Classes:
FileDocumentSource, IRIDocumentSource, ReaderDocumentSource, StreamDocumentSource, StringDocumentSource

public interface OWLOntologyDocumentSource

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

A document source provides a point for loading an ontology. A document source may provide three ways of obtaining an ontology document:

  1. From a Reader
  2. From an InputStream
  3. From an ontology document IRI
Consumers that use a document source will attempt to obtain a concrete representation of an ontology in the above order.

Note that while an ontology document 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
 IRI getDocumentIRI()
          Gets the IRI of the ontology document.
 java.io.InputStream getInputStream()
          If an input stream can be obtained from this document source then this method creates it.
 java.io.Reader getReader()
          Gets a reader which an ontology document can be read from.
 boolean isInputStreamAvailable()
          Determines if an input stream is available which an ontology document can be parsed from.
 boolean isReaderAvailable()
          Determines if a reader is available which an ontology document can be parsed from.
 

Method Detail

isReaderAvailable

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

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

getReader

java.io.Reader getReader()
Gets a reader which an ontology document can be read 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. A Runtime execption will be thrown if this happens.

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

isInputStreamAvailable

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

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

getInputStream

java.io.InputStream getInputStream()
If an input stream can be obtained from this document 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.

getDocumentIRI

IRI getDocumentIRI()
Gets the IRI of the ontology document.

Returns:
An IRI which represents the ontology document IRI - this will never be null.