Class OWLOntologyChange

java.lang.Object
org.semanticweb.owlapi.model.OWLOntologyChange
All Implemented Interfaces:
Serializable, HasSignature
Direct Known Subclasses:
AnnotationChange, ImportChange, OWLAxiomChange, SetOntologyID

public abstract class OWLOntologyChange extends Object implements HasSignature, Serializable
Since:
2.0.0
Author:
Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
See Also:
  • Constructor Details

    • OWLOntologyChange

      public OWLOntologyChange(OWLOntology ont)
      Parameters:
      ont - the ontology to which the change is to be applied
  • Method Details

    • getAddedOrRemovedAxiom

      public Optional<OWLAxiom> getAddedOrRemovedAxiom()
      Returns:
      for axiom changes, the axiom added or removed; empty optional otherwise. Same as getAxiom(), but it never throws an exception or returns null.
    • getAddedAxiom

      public Optional<OWLAxiom> getAddedAxiom()
      Returns:
      for add axiom changes, the axiom added; empty optional otherwise
    • getRemovedAxiom

      public Optional<OWLAxiom> getRemovedAxiom()
      Returns:
      for remove axiom changes, the axiom removed; empty optional otherwise
    • isAxiomChange

      public boolean isAxiomChange(AxiomType<?> type)
      Parameters:
      type - axiom type to check
      Returns:
      true if this is an axiom change and the axiom type is the specified type
    • isAxiomChange

      public boolean isAxiomChange()
      Determines if the change will cause the addition or removal of an axiom from an ontology.
      Returns:
      true if the change is an OWLAddAxiomChange or OWLRemoveAxiomChange otherwise false.
    • isAddAxiom

      public boolean isAddAxiom()
      Determines if the change will add an axiom to an ontology.
      Returns:
      true if the change is an AddAxiom change and it will add an axiom to an ontology, false otherwise.
    • isRemoveAxiom

      public boolean isRemoveAxiom()
      Determines if the change will remove an axiom from an ontology.
      Returns:
      true if the change is a RemoveAxiom change and it will remove an axiom from an ontology, false otherwise.
    • getAxiom

      public OWLAxiom getAxiom()
      If the change is an axiom change (i.e. AddAxiom or RemoveAxiom) this method obtains the axiom.
      Returns:
      The Axiom if this change is an axiom change
      Throws:
      IllegalStateException - if the change has no axiom; UnsupportedOperationException If the change is not an axiom change (check with the isAxiomChange method first).
    • isImportChange

      public boolean isImportChange()
      Determines if this change is an import change and hence causes a change to the imports closure of an ontology.
      Returns:
      true if this change is an import change, otherwise false.
    • getOntology

      public OWLOntology getOntology()
      Gets the ontology that the change is/was applied to.
      Returns:
      The ontology that the change is applicable to
    • getChangeData

      public abstract OWLOntologyChangeData getChangeData()
      Gets the data (independent of the ontology) associated with this specific change.
      Returns:
      The OWLOntologyChangeData associated with this OWLOntologyChange.
    • getChangeRecord

      public OWLOntologyChangeRecord getChangeRecord()
      Gets a OWLOntologyChangeRecord that is derived from this OWLOntologyChange's OWLOntologyID and it's OWLOntologyChangeData.
      Returns:
      An OWLOntologyChangeRecord containing an OWLOntologyID equal to the OWLOntologyID of this OWLOntologyChange's OWLOntology. Not null .
    • accept

      public abstract void accept(OWLOntologyChangeVisitor visitor)
      Accepts a visitor.
      Parameters:
      visitor - The visitor
    • accept

      public abstract <O> O accept(OWLOntologyChangeVisitorEx<O> visitor)
      Accepts a visitor.
      Type Parameters:
      O - visitor return type
      Parameters:
      visitor - The visitor
      Returns:
      visitor value
    • reverseChange

      public abstract OWLOntologyChange reverseChange()
      Returns:
      the reverse of this change; can be used to create undo changes.