Package org.semanticweb.owlapi.model
Interface OWLDocumentFormat
- All Superinterfaces:
Serializable
- All Known Subinterfaces:
PrefixDocumentFormat
,RDFDocumentFormat
- All Known Implementing Classes:
AbstractRDFNonPrefixDocumentFormat
,AbstractRDFPrefixDocumentFormat
,DLSyntaxDocumentFormat
,DLSyntaxHTMLDocumentFormat
,FunctionalSyntaxDocumentFormat
,KRSS2DocumentFormat
,KRSSDocumentFormat
,LabelFunctionalDocumentFormat
,LatexAxiomsListDocumentFormat
,LatexDocumentFormat
,ManchesterSyntaxDocumentFormat
,OBODocumentFormat
,OWLDocumentFormatImpl
,OWLXMLDocumentFormat
,PrefixDocumentFormatImpl
,RDFXMLDocumentFormat
,TurtleDocumentFormat
Represents the concrete representation format of an ontology. The equality of an ontology format
is defined by the equals and hashCode method (not its identity).
- Since:
- 2.0.0
- Author:
- Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
-
Method Summary
Modifier and TypeMethodDescriptiondefault PrefixDocumentFormat
If this format is an instance ofPrefixDocumentFormat
then this method will obtain it as aPrefixDocumentFormat
.static Collection<IRI>
computeIllegals
(com.google.common.collect.Multimap<IRI, EntityType<?>> punnings) static Collection<IRI>
determineIllegalPunnings
(boolean add, Stream<OWLEntity> signature, Collection<IRI> punnedEntities) getKey()
If this format describes an ontology that was loaded from some ontology document (rather than created programmatically) there may be some meta data about the loading process.<T> T
getParameter
(Serializable key, T defaultValue) boolean
Determines if untyped entities should automatically be typed (declared) during rendering.static boolean
isMissingType
(OWLEntity entity, OWLOntology ontology) Determines if a declaration axiom (type triple) needs to be added to the specified ontology for the given entity.default boolean
Determines if this format is an instance of a format that uses prefixes to shorted IRIs.boolean
Determines whether this format contains textual output, as opposed to binary output.void
setAddMissingTypes
(boolean addMissingTypes) Determines if untyped entities should automatically be typed during rendering.void
setOntologyLoaderMetaData
(OWLOntologyLoaderMetaData loaderMetaData) Sets the meta data for the ontology loader.void
setParameter
(Serializable key, Serializable value) default boolean
Some formats support relative IRIs in output (all parsers must create axioms with absolute IRIs, but some formats allow relative IRIs, with the understanding that in parsing the base IRI will be used to convert them to absolute IRIs).
-
Method Details
-
isMissingType
Determines if a declaration axiom (type triple) needs to be added to the specified ontology for the given entity.- Parameters:
entity
- The entityontology
- The ontology.- Returns:
false
if the entity is built in.false
if the ontology doesn't contain the entity in its signature.false
if the entity is already declared in the imports closure of the ontology.false
if the transitive imports does not contain the ontology but the entity is contained in the signature of one of the imported ontologies,true
if none of the previous conditions are met.
-
determineIllegalPunnings
static Collection<IRI> determineIllegalPunnings(boolean add, Stream<OWLEntity> signature, Collection<IRI> punnedEntities) - Parameters:
signature
- signature for the ontologypunnedEntities
- the set of entities that are known already to be punnedadd
- true if missing declarations should be added. If false, no declarations will be added.- Returns:
- collection of IRIS used in illegal punnings
-
computeIllegals
static Collection<IRI> computeIllegals(com.google.common.collect.Multimap<IRI, EntityType<?>> punnings) - Parameters:
punnings
- input punnings- Returns:
- illegal punnings
-
isAddMissingTypes
boolean isAddMissingTypes()Determines if untyped entities should automatically be typed (declared) during rendering. (This is a hint to an RDF renderer - the reference implementation will respect this).- Returns:
true
if untyped entities should automatically be typed during rendering, otherwisefalse
.
-
setAddMissingTypes
void setAddMissingTypes(boolean addMissingTypes) Determines if untyped entities should automatically be typed during rendering. By default this is true.- Parameters:
addMissingTypes
-true
if untyped entities should automatically be typed during rendering, otherwisefalse
.
-
setParameter
- Parameters:
key
- key for the new entryvalue
- value for the new entry
-
getParameter
- Type Parameters:
T
- type- Parameters:
key
- key for the new entrydefaultValue
- value for the new entry- Returns:
- the value
-
isPrefixOWLDocumentFormat
default boolean isPrefixOWLDocumentFormat()Determines if this format is an instance of a format that uses prefixes to shorted IRIs.- Returns:
true
if this format is an instance ofPrefixDocumentFormat
other wisefalse
.
-
asPrefixOWLDocumentFormat
If this format is an instance ofPrefixDocumentFormat
then this method will obtain it as aPrefixDocumentFormat
.- Returns:
- This format as a more specific
PrefixDocumentFormat
. - Throws:
ClassCastException
- if this format is not an instance ofPrefixDocumentFormat
-
getOntologyLoaderMetaData
Optional<OWLOntologyLoaderMetaData> getOntologyLoaderMetaData()If this format describes an ontology that was loaded from some ontology document (rather than created programmatically) there may be some meta data about the loading process. Subclasses ofOWLDocumentFormat
will provide accessors etc. to details pertaining to the meta data about loading.- Returns:
- An object containing the meta data about loading. .
-
setOntologyLoaderMetaData
Sets the meta data for the ontology loader.- Parameters:
loaderMetaData
- The metadata.- Throws:
NullPointerException
- if the argument isnull
.
-
getKey
String getKey()- Returns:
- A unique key for this format.
-
isTextual
boolean isTextual()Determines whether this format contains textual output, as opposed to binary output.- Returns:
- True if this format represents a textual format, as opposed to a binary format. Defaults to true if not overridden.
-
supportsRelativeIRIs
default boolean supportsRelativeIRIs()Some formats support relative IRIs in output (all parsers must create axioms with absolute IRIs, but some formats allow relative IRIs, with the understanding that in parsing the base IRI will be used to convert them to absolute IRIs). If a format does not support relative IRIs, the renderer needs to know to output absolute IRIs. This defaults to true as this keeps the existing behaviour.- Returns:
- true if relative IRIs are supported.
-