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, visitequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitvisit, visitvisit, visit, visit, visitvisit, 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, visitpublic void processChanges(@Nonnull List<? extends OWLOntologyChange> changes)
changes - changes to processpublic void visit(AddAxiom change)
OWLOntologyChangeVisitorvisit in interface OWLOntologyChangeVisitorchange - change to visitpublic void visit(RemoveAxiom change)
OWLOntologyChangeVisitorvisit in interface OWLOntologyChangeVisitorchange - change to visitpublic void visit(SetOntologyID change)
OWLOntologyChangeVisitorvisit in interface OWLOntologyChangeVisitorchange - change to visitpublic void visit(AddImport change)
OWLOntologyChangeVisitorvisit in interface OWLOntologyChangeVisitorchange - change to visitpublic void visit(RemoveImport change)
OWLOntologyChangeVisitorvisit in interface OWLOntologyChangeVisitorchange - change to visitpublic void visit(AddOntologyAnnotation change)
OWLOntologyChangeVisitorvisit in interface OWLOntologyChangeVisitorchange - change to visitpublic void visit(RemoveOntologyAnnotation change)
OWLOntologyChangeVisitorvisit in interface OWLOntologyChangeVisitorchange - change to visitCopyright © 2016 The University of Manchester. All Rights Reserved.