Package org.semanticweb.owlapi.model
Class OWLOntologyChange
java.lang.Object
org.semanticweb.owlapi.model.OWLOntologyChange
- All Implemented Interfaces:
Serializable
,HasSignature
- Direct Known Subclasses:
AnnotationChange
,ImportChange
,OWLAxiomChange
,SetOntologyID
- Since:
- 2.0.0
- Author:
- Matthew Horridge, The University Of Manchester, Bio-Health Informatics Group
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract void
accept
(OWLOntologyChangeVisitor visitor) Accepts a visitor.abstract <O> O
accept
(OWLOntologyChangeVisitorEx<O> visitor) Accepts a visitor.getAxiom()
If the change is an axiom change (i.e.abstract OWLOntologyChangeData
Gets the data (independent of the ontology) associated with this specific change.Gets aOWLOntologyChangeRecord
that is derived from thisOWLOntologyChange
'sOWLOntologyID
and it'sOWLOntologyChangeData
.Gets the ontology that the change is/was applied to.boolean
Determines if the change will add an axiom to an ontology.boolean
Determines if the change will cause the addition or removal of an axiom from an ontology.boolean
isAxiomChange
(AxiomType<?> type) boolean
Determines if this change is an import change and hence causes a change to the imports closure of an ontology.boolean
Determines if the change will remove an axiom from an ontology.abstract OWLOntologyChange
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.semanticweb.owlapi.model.HasSignature
getSignature, signature, unsortedSignature
-
Constructor Details
-
OWLOntologyChange
- Parameters:
ont
- the ontology to which the change is to be applied
-
-
Method Details
-
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
- Returns:
- for add axiom changes, the axiom added; empty optional otherwise
-
getRemovedAxiom
- Returns:
- for remove axiom changes, the axiom removed; empty optional otherwise
-
isAxiomChange
- 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 anOWLAddAxiomChange
orOWLRemoveAxiomChange
otherwisefalse
.
-
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
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 theisAxiomChange
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, otherwisefalse
.
-
getOntology
Gets the ontology that the change is/was applied to.- Returns:
- The ontology that the change is applicable to
-
getChangeData
Gets the data (independent of the ontology) associated with this specific change.- Returns:
- The
OWLOntologyChangeData
associated with thisOWLOntologyChange
.
-
getChangeRecord
Gets aOWLOntologyChangeRecord
that is derived from thisOWLOntologyChange
'sOWLOntologyID
and it'sOWLOntologyChangeData
.- Returns:
- An
OWLOntologyChangeRecord
containing anOWLOntologyID
equal to theOWLOntologyID
of thisOWLOntologyChange
'sOWLOntology
. Notnull
.
-
accept
Accepts a visitor.- Parameters:
visitor
- The visitor
-
accept
Accepts a visitor.- Type Parameters:
O
- visitor return type- Parameters:
visitor
- The visitor- Returns:
- visitor value
-
reverseChange
- Returns:
- the reverse of this change; can be used to create undo changes.
-