public class OWLOntologyChangeFilter extends Object 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(RemoveAxiom change)
visit RemoveAxiom type
|
equals, 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, visitvisitdoDefault, getDefaultReturnValue, handleDefaultpublic void processChanges(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 visitCopyright © 2019 The University of Manchester. All rights reserved.