Package org.semanticweb.owlapi.io
Class OWLOntologyDocumentSourceBase
java.lang.Object
org.semanticweb.owlapi.io.OWLOntologyDocumentSourceBase
- All Implemented Interfaces:
OWLOntologyDocumentSource
- Direct Known Subclasses:
FileDocumentSource
,GZipFileDocumentSource
,GZipStreamDocumentSource
,IRIDocumentSource
,StreamDocumentSourceBase
,StringDocumentSource
,XZFileDocumentSource
,XZStreamDocumentSource
public abstract class OWLOntologyDocumentSourceBase
extends Object
implements OWLOntologyDocumentSource
Base class for OWLOntologyDocumentSource.
- Since:
- 4.0.0
- Author:
- ignazio
-
Constructor Summary
ConstructorsConstructorDescriptionOWLOntologyDocumentSourceBase
(String iriPrefix, OWLDocumentFormat format, String mime) Constructs an ontology input source using the specified file.OWLOntologyDocumentSourceBase
(IRI iri, OWLDocumentFormat format, String mime) Constructs an ontology input source using the specified file. -
Method Summary
Modifier and TypeMethodDescriptionfinal IRI
Gets the IRI of the ontology document.boolean
boolean
void
setAcceptHeaders
(String headers) void
setIRIResolutionFailed
(boolean value) IRI resolution does not happen inside this class.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.semanticweb.owlapi.io.OWLOntologyDocumentSource
getInputStream, getReader
-
Constructor Details
-
OWLOntologyDocumentSourceBase
public OWLOntologyDocumentSourceBase(IRI iri, @Nullable OWLDocumentFormat format, @Nullable String mime) Constructs an ontology input source using the specified file.- Parameters:
iri
- document IRIformat
- ontology format. If null, it is considered unspecifiedmime
- mime type. If null or empty, it is considered unspecified.
-
OWLOntologyDocumentSourceBase
public OWLOntologyDocumentSourceBase(String iriPrefix, @Nullable OWLDocumentFormat format, @Nullable String mime) Constructs an ontology input source using the specified file.- Parameters:
iriPrefix
- document IRI prefix - used to generate a new IRIformat
- ontology format. If null, it is considered unspecifiedmime
- mime type. If null or empty, it is considered unspecified.
-
-
Method Details
-
getAcceptHeaders
- Specified by:
getAcceptHeaders
in interfaceOWLOntologyDocumentSource
- Returns:
- currently set accept headers
-
setAcceptHeaders
- Specified by:
setAcceptHeaders
in interfaceOWLOntologyDocumentSource
- Parameters:
headers
- accept headers; if not set, the mime type will be used; if that is also missing, the available parsers will contribute the headers
-
getDocumentIRI
Description copied from interface:OWLOntologyDocumentSource
Gets the IRI of the ontology document.- Specified by:
getDocumentIRI
in interfaceOWLOntologyDocumentSource
- Returns:
- An IRI which represents the ontology document IRI
-
hasAlredyFailedOnStreams
public boolean hasAlredyFailedOnStreams()- Specified by:
hasAlredyFailedOnStreams
in interfaceOWLOntologyDocumentSource
- Returns:
- true if there is no reader or input stream available for this source, or reading from them has already been attempted in a previous call and has failed. This leaves attempting to resolve the document IRI as input. No attempt is made to verify that the document IRI is resolvable.
-
hasAlredyFailedOnIRIResolution
public boolean hasAlredyFailedOnIRIResolution()- Specified by:
hasAlredyFailedOnIRIResolution
in interfaceOWLOntologyDocumentSource
- Returns:
- true if resolving the document IRI has been attempted by a previous call and has failed, false if resolution has not been attempted yet or it has happened successfully.
-
setIRIResolutionFailed
public void setIRIResolutionFailed(boolean value) Description copied from interface:OWLOntologyDocumentSource
IRI resolution does not happen inside this class. This method allows the resolver to mark the document IRI as unresolvable, so that the information is tracked with the source.- Specified by:
setIRIResolutionFailed
in interfaceOWLOntologyDocumentSource
- Parameters:
value
- new value for the flag
-
getFormat
- Specified by:
getFormat
in interfaceOWLOntologyDocumentSource
- Returns:
- format for the ontology. If none is known, return Optional.absent.
-
getMIMEType
- Specified by:
getMIMEType
in interfaceOWLOntologyDocumentSource
- Returns:
- MIME type for this source, if one is specified. If none is known, return Optional.absent.
-