Class DirectOWLTranslator

java.lang.Object
org.incenp.obofoundry.kgcl.ChangeVisitorBase<List<org.semanticweb.owlapi.model.OWLOntologyChange>>
org.incenp.obofoundry.kgcl.owl.OWLTranslator
org.incenp.obofoundry.kgcl.owl.DirectOWLTranslator
All Implemented Interfaces:
IChangeVisitor<List<org.semanticweb.owlapi.model.OWLOntologyChange>>

public class DirectOWLTranslator extends OWLTranslator
A visitor to convert a list of KGCL Change objects into a list of OWL API OWLOntologyChange objects that, when applied to an ontology, would implement the requested changes.

This class is primarily intended for internal use by OntologyPatcher. It may however be used directly by client code to obtain OWLOntologyChange objects without having them immediately applied to the ontology:

 Change change = ...;
 OWLOntology ontology = ...;
 OWLReasoner reasoner = ...;
 DirectOWLTranslator visitor = new DirectOWLTranslator(ontology, reasoner);
 List<OWLOntologyChange> changeAsOwlChanges = change.accept(visitor);
 

This class may also be derived to modify the way some changes are translated into OWL changes. For example, if you want “definitions” to be represented by another annotation than http://purl.obolibrary.org/obo/IAO_0000115, you could derive this class and override the visit(NewTextDefinition) and similar methods.