Interface OWLAxiom

All Superinterfaces:
Comparable<OWLObject>, HasAnnotationPropertiesInSignature, HasAnnotations, HasAnonymousIndividuals, HasClassesInSignature, HasComponents, HasContainsEntityInSignature, HasDataPropertiesInSignature, HasDatatypesInSignature, HasHashIndex, HasIndex, HasIndividualsInSignature, HasObjectPropertiesInSignature, HasSignature, IsAnonymous, OWLObject, Serializable
All Known Subinterfaces:
OWLAnnotationAssertionAxiom, OWLAnnotationAxiom, OWLAnnotationPropertyDomainAxiom, OWLAnnotationPropertyRangeAxiom, OWLAsymmetricObjectPropertyAxiom, OWLClassAssertionAxiom, OWLClassAxiom, OWLDataPropertyAssertionAxiom, OWLDataPropertyAxiom, OWLDataPropertyCharacteristicAxiom, OWLDataPropertyDomainAxiom, OWLDataPropertyRangeAxiom, OWLDatatypeDefinitionAxiom, OWLDeclarationAxiom, OWLDifferentIndividualsAxiom, OWLDisjointClassesAxiom, OWLDisjointDataPropertiesAxiom, OWLDisjointObjectPropertiesAxiom, OWLDisjointUnionAxiom, OWLEquivalentClassesAxiom, OWLEquivalentDataPropertiesAxiom, OWLEquivalentObjectPropertiesAxiom, OWLFunctionalDataPropertyAxiom, OWLFunctionalObjectPropertyAxiom, OWLHasKeyAxiom, OWLIndividualAxiom, OWLInverseFunctionalObjectPropertyAxiom, OWLInverseObjectPropertiesAxiom, OWLIrreflexiveObjectPropertyAxiom, OWLLogicalAxiom, OWLNaryAxiom<C>, OWLNaryClassAxiom, OWLNaryIndividualAxiom, OWLNaryPropertyAxiom<P>, OWLNegativeDataPropertyAssertionAxiom, OWLNegativeObjectPropertyAssertionAxiom, OWLObjectPropertyAssertionAxiom, OWLObjectPropertyAxiom, OWLObjectPropertyCharacteristicAxiom, OWLObjectPropertyDomainAxiom, OWLObjectPropertyRangeAxiom, OWLPropertyAssertionAxiom<P,O>, OWLPropertyAxiom, OWLPropertyDomainAxiom<P>, OWLPropertyRangeAxiom<P,R>, OWLReflexiveObjectPropertyAxiom, OWLSameIndividualAxiom, OWLSubAnnotationPropertyOfAxiom, OWLSubClassOfAxiom, OWLSubDataPropertyOfAxiom, OWLSubObjectPropertyOfAxiom, OWLSubPropertyAxiom<P>, OWLSubPropertyChainOfAxiom, OWLSymmetricObjectPropertyAxiom, OWLTransitiveObjectPropertyAxiom, OWLUnaryPropertyAxiom<P>, SWRLRule

public interface OWLAxiom extends OWLObject, HasAnnotations
Represents Axioms in the OWL 2 Specification.
An OWL ontology contains a set of axioms. These axioms can be annotation axioms, declaration axioms, imports axioms or logical axioms
Since:
2.0.0
Author:
Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
  • Method Details

    • getAxiomWithoutAnnotations

      static <T extends OWLAxiom> T getAxiomWithoutAnnotations(T axiom)
      Gets an axiom that is structurally equivalent to the input axiom without annotations. This essentially returns a version of the axiom stripped of any annotations.
      Type Parameters:
      T - type
      Parameters:
      axiom - axiom to divest of annotations
      Returns:
      The axiom without annotations
    • getAnnotatedAxiom

      static <T extends OWLAxiom> T getAnnotatedAxiom(Stream<OWLAnnotation> annotations, T axiom)
      Gets a copy of the input axiom that is annotated with the specified annotations. If the axiom has any annotations on it they will be merged with the specified set of annotations. Note that the input axiom will not be modified (or removed from any ontologies).
      Type Parameters:
      T - type of axiom returned
      Parameters:
      axiom - axiom to be copied
      annotations - The annotations that will be added to existing annotations to annotate the copy of this axiom
      Returns:
      A copy of this axiom that has the specified annotations plus any existing annotations returned by the OWLAxiom#getAnnotations() method.
    • getAnnotatedAxiom

      static <T extends OWLAxiom> T getAnnotatedAxiom(Collection<OWLAnnotation> annotations, T axiom)
      Gets a copy of the input axiom that is annotated with the specified annotations. If the axiom has any annotations on it they will be merged with the specified set of annotations. Note that the input axiom will not be modified (or removed from any ontologies).
      Type Parameters:
      T - type of axiom returned
      Parameters:
      axiom - axiom to be copied
      annotations - The annotations that will be added to existing annotations to annotate the copy of this axiom
      Returns:
      A copy of this axiom that has the specified annotations plus any existing annotations returned by the OWLAxiom#getAnnotations() method.
    • typeIndex

      default int typeIndex()
      Specified by:
      typeIndex in interface HasIndex
      Returns:
      index for this type. This is not a hashcode for instances, rather a sorting index for the types.
    • isIndividual

      default boolean isIndividual()
      Specified by:
      isIndividual in interface OWLObject
      Returns:
      true if this object is an individual.
    • isAxiom

      default boolean isAxiom()
      Specified by:
      isAxiom in interface OWLObject
      Returns:
      true if this object is an axiom.
    • accept

      void accept(OWLAxiomVisitor visitor)
      Parameters:
      visitor - visitor to accept
    • accept

      <O> O accept(OWLAxiomVisitorEx<O> visitor)
      Type Parameters:
      O - visitor return type
      Parameters:
      visitor - visitor to accept
      Returns:
      visitor value
    • getAxiomWithoutAnnotations

      <T extends OWLAxiom> T getAxiomWithoutAnnotations()
      Gets an axiom that is structurally equivalent to this axiom without annotations. This essentially returns a version of this axiom stripped of any annotations.
      Type Parameters:
      T - type
      Returns:
      The axiom without annotations
    • getAxiomWithoutAnnotations

      default <T extends OWLAxiom> T getAxiomWithoutAnnotations(Class<T> witness)
      Gets an axiom that is structurally equivalent to this axiom without annotations. This essentially returns a version of this axiom stripped of any annotations.

      Calling axiom.getAxiomWithoutAnnotations(axiom.getClass()) is equivalent to axiom.getAxiomWithoutAnnotations(), but it provides compile time type safety - there will be no attempt to cast to an incompatible type.
      Type Parameters:
      T - type
      Parameters:
      witness - Variable to ground the generic return type
      Returns:
      The axiom without annotations
    • getAnnotatedAxiom

      default <T extends OWLAxiom> T getAnnotatedAxiom(Class<T> witness, Stream<OWLAnnotation> annotations)
      Gets a copy of this axiom that is annotated with the specified annotations. If this axiom has any annotations on it they will be merged with the specified set of annotations. Note that this axiom will not be modified (or removed from any ontologies).

      Calling axiom.getAnnotatedAxiom(axiom.getClass(), annotations) is equivalent to axiom.getAnnotatedAxiom(annotations), but it provides compile time type safety - there will be no attempt to cast to an incompatible type.
      Type Parameters:
      T - type
      Parameters:
      witness - Variable to ground the generic return type
      annotations - The annotations that will be added to existing annotations to annotate the copy of this axiom
      Returns:
      A copy of this axiom that has the specified annotations plus any existing annotations returned by the OWLAxiom#getAnnotations() method.
    • getAnnotatedAxiom

      <T extends OWLAxiom> T getAnnotatedAxiom(Stream<OWLAnnotation> annotations)
      Gets a copy of this axiom that is annotated with the specified annotations. If this axiom has any annotations on it they will be merged with the specified set of annotations. Note that this axiom will not be modified (or removed from any ontologies).
      Type Parameters:
      T - type
      Parameters:
      annotations - The annotations that will be added to existing annotations to annotate the copy of this axiom
      Returns:
      A copy of this axiom that has the specified annotations plus any existing annotations returned by the OWLAxiom#getAnnotations() method.
    • getAnnotatedAxiom

      default <T extends OWLAxiom> T getAnnotatedAxiom(Collection<OWLAnnotation> annotations)
      Gets a copy of this axiom that is annotated with the specified annotations. If this axiom has any annotations on it they will be merged with the specified set of annotations. Note that this axiom will not be modified (or removed from any ontologies).
      Type Parameters:
      T - type
      Parameters:
      annotations - The annotations that will be added to existing annotations to annotate the copy of this axiom
      Returns:
      A copy of this axiom that has the specified annotations plus any existing annotations returned by the OWLAxiom#getAnnotations() method.
    • equalsIgnoreAnnotations

      default boolean equalsIgnoreAnnotations(@Nullable OWLAxiom axiom)
      Determines if another axiom is equal to this axiom not taking into consideration the annotations on the axiom
      Parameters:
      axiom - The axiom to test if equal
      Returns:
      true if axiom without annotations is equal to this axiom without annotations otherwise false.
    • isLogicalAxiom

      default boolean isLogicalAxiom()
      Determines if this axiom is a logical axiom. Logical axioms are defined to be axioms other than both declaration axioms (including imports declarations) and annotation axioms.
      Returns:
      true if the axiom is a logical axiom, false if the axiom is not a logical axiom.
    • isAnnotationAxiom

      default boolean isAnnotationAxiom()
      Determines if this axioms in an annotation axiom (an instance of OWLAnnotationAxiom)
      Returns:
      true if this axiom is an instance of OWLAnnotationAxiom, otherwise false.
      Since:
      3.2
    • isAnnotated

      boolean isAnnotated()
      Determines if this axiom has any annotations on it
      Returns:
      true if this axiom has annotations on it, otherwise false
    • getAxiomType

      AxiomType<?> getAxiomType()
      Gets the axiom type for this axiom.
      Returns:
      The axiom type that corresponds to the type of this axiom.
    • isOfType

      default boolean isOfType(AxiomType<?>... axiomTypes)
      Determines if this axiom is one of the specified types
      Parameters:
      axiomTypes - The axiom types to check for
      Returns:
      true if this axiom is one of the specified types, otherwise false
      Since:
      3.0
    • isOfType

      default boolean isOfType(Collection<AxiomType<?>> types)
      Determines if this axiom is one of the specified types
      Parameters:
      types - The axiom types to check for
      Returns:
      true if this axioms is one of the specified types, otherwise false
      Since:
      3.0
    • isOfType

      default boolean isOfType(Stream<AxiomType<?>> types)
      Determines if this axiom is one of the specified types
      Parameters:
      types - The axiom types to check for
      Returns:
      true if this axioms is one of the specified types, otherwise false
      Since:
      3.0
    • getNNF

      OWLAxiom getNNF()
      Gets this axioms in negation normal form. i.e. any class expressions involved in this axiom are converted into negation normal form.
      Returns:
      The axiom in negation normal form.