public class OWLOntologyChangeFilter extends OWLAxiomVisitorAdapter implements OWLAxiomVisitor, OWLOntologyChangeVisitor
OWLOntologyChangeFilter
and override the appropriate visit methods corresponding to the types of axioms that are of
interest. Each visit corresponds to a single change and the isAdd
or isRemove
methods can be used to determine if the axiom corresponding to the change is being added or
removed from an ontology - the ontology can be obtained via the getOntology
method.ontChanges
, from an ontology change listener. We can use the
OWLOntologyChangeFilter
to filter out the changes that alter the domain of an object
property in the following way:OWLOntologyChangeFilter filter = new OWLOntologyChangeFilter() {
// Override the object property domain visit method public void visit(OWLObjectPropertyDomainAxiom axiom) { // Determine if the axiom is being added or removed if(isAdd()) { // Get hold of the ontology that the change applied to OWLOntology ont = getOntology(); // Do something here } } } // Process the list of changes filter.processChanges(ontChanges);
Constructor and Description |
---|
OWLOntologyChangeFilter() |
Modifier and Type | Method and Description |
---|---|
void |
processChanges(List<? extends OWLOntologyChange> changes) |
void |
visit(AddAxiom change)
visit AddAxiom type
|
void |
visit(AddImport change)
visit AddImport type
|
void |
visit(AddOntologyAnnotation change)
visit AddOntologyAnnotation type
|
void |
visit(RemoveAxiom change)
visit RemoveAxiom type
|
void |
visit(RemoveImport change)
visit RemoveImport type
|
void |
visit(RemoveOntologyAnnotation change)
visit RemoveOntologyAnnotation type
|
void |
visit(SetOntologyID change)
visit SetOntologyID type
|
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
visit, visit
visit, visit, visit, visit
visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit, visit
public void processChanges(@Nonnull List<? extends OWLOntologyChange> changes)
changes
- changes to processpublic void visit(AddAxiom change)
OWLOntologyChangeVisitor
visit
in interface OWLOntologyChangeVisitor
change
- change to visitpublic void visit(RemoveAxiom change)
OWLOntologyChangeVisitor
visit
in interface OWLOntologyChangeVisitor
change
- change to visitpublic void visit(SetOntologyID change)
OWLOntologyChangeVisitor
visit
in interface OWLOntologyChangeVisitor
change
- change to visitpublic void visit(AddImport change)
OWLOntologyChangeVisitor
visit
in interface OWLOntologyChangeVisitor
change
- change to visitpublic void visit(RemoveImport change)
OWLOntologyChangeVisitor
visit
in interface OWLOntologyChangeVisitor
change
- change to visitpublic void visit(AddOntologyAnnotation change)
OWLOntologyChangeVisitor
visit
in interface OWLOntologyChangeVisitor
change
- change to visitpublic void visit(RemoveOntologyAnnotation change)
OWLOntologyChangeVisitor
visit
in interface OWLOntologyChangeVisitor
change
- change to visitCopyright © 2020 The University of Manchester. All rights reserved.