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

public interface OWLDocumentFormat extends Serializable
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 Details

    • isMissingType

      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.
      Parameters:
      entity - The entity
      ontology - 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 ontology
      punnedEntities - the set of entities that are known already to be punned
      add - 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, otherwise false.
    • 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, otherwise false.
    • setParameter

      void setParameter(Serializable key, Serializable value)
      Parameters:
      key - key for the new entry
      value - value for the new entry
    • getParameter

      <T> T getParameter(Serializable key, T defaultValue)
      Type Parameters:
      T - type
      Parameters:
      key - key for the new entry
      defaultValue - 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 of PrefixDocumentFormat other wise false.
    • asPrefixOWLDocumentFormat

      default PrefixDocumentFormat asPrefixOWLDocumentFormat()
      If this format is an instance of PrefixDocumentFormat then this method will obtain it as a PrefixDocumentFormat.
      Returns:
      This format as a more specific PrefixDocumentFormat.
      Throws:
      ClassCastException - if this format is not an instance of PrefixDocumentFormat
    • 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 of OWLDocumentFormat will provide accessors etc. to details pertaining to the meta data about loading.
      Returns:
      An object containing the meta data about loading. .
    • setOntologyLoaderMetaData

      void setOntologyLoaderMetaData(OWLOntologyLoaderMetaData loaderMetaData)
      Sets the meta data for the ontology loader.
      Parameters:
      loaderMetaData - The metadata.
      Throws:
      NullPointerException - if the argument is null.
    • 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.