Class SpeciesMerger

java.lang.Object
org.semanticweb.owlapi.util.OWLAxiomVisitorAdapter
org.incenp.obofoundry.uberon.util.SpeciesMerger
All Implemented Interfaces:
org.semanticweb.owlapi.model.OWLAnnotationAxiomVisitor, org.semanticweb.owlapi.model.OWLAxiomVisitor, org.semanticweb.owlapi.model.OWLLogicalAxiomVisitor

public class SpeciesMerger extends org.semanticweb.owlapi.util.OWLAxiomVisitorAdapter
This class may be used to create multi-species ontologies following the "composite/merger" strategy described in Uberon's wiki. It is heavily based on Chris Mungall's implementation of that strategy in OWLTools.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static enum 
    Mode of operation for general class axioms.
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpeciesMerger(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasoner reasoner)
    Creates a new instance.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    merge(org.semanticweb.owlapi.model.IRI taxon, org.semanticweb.owlapi.model.IRI property, String suffix, List<org.semanticweb.owlapi.model.IRI> includedProperties)
    Unfold classes for the specified taxon over the specified linking property.
    void
    Enables or disables the translation of more class expressions.
    void
    Sets the behaviour for general class axioms (GCAs) that have one (or more) merged class in their signature.
    void
    Enables or disables removal of declaration axioms for classes that have been replaced by a translated expression.
    void
    visit(org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom axiom)
     
    void
    visit(org.semanticweb.owlapi.model.OWLEquivalentClassesAxiom axiom)
     
    void
    visit(org.semanticweb.owlapi.model.OWLSubClassOfAxiom axiom)
     

    Methods inherited from class org.semanticweb.owlapi.util.OWLAxiomVisitorAdapter

    handleDefault, 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

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpeciesMerger

      public SpeciesMerger(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasoner reasoner)
      Creates a new instance.
      Parameters:
      ontology - The ontology to operate on.
      reasoner - The reasoner to use.
  • Method Details

    • setExtendedTranslation

      public void setExtendedTranslation(boolean b)
      Enables or disables the translation of more class expressions.

      The default behaviour, for compatibility with Chris Mungall's original implementation, is to translate only ObjectSomeValuesFrom expressions. This option enables the additional translation of some other types of expression.

      Parameters:
      b - true to enable translating additional expressions.
    • setGCAMode

      public void setGCAMode(SpeciesMerger.GCAMergeMode mode)
      Sets the behaviour for general class axioms (GCAs) that have one (or more) merged class in their signature.

      The default behaviour, for compatibility with Chris Mungall's original implementation, is to keep such axioms as they are (referring to now merged classes). Set to SpeciesMerger.GCAMergeMode.TRANSLATE to translate those axioms, or to SpeciesMerger.GCAMergeMode.DELETE to remove them entirely.

      Parameters:
      mode - A value indicating how general class axioms should be processed.
    • setRemoveDeclarationAxiom

      public void setRemoveDeclarationAxiom(boolean b)
      Enables or disables removal of declaration axioms for classes that have been replaced by a translated expression. This avoids a lot of dangling and unused classes in the resulting ontology. This is disabled by default for compatibility with Chris Mungall's original implementation.
      Parameters:
      b - true to enable removal of declaration axioms.
    • merge

      public void merge(org.semanticweb.owlapi.model.IRI taxon, org.semanticweb.owlapi.model.IRI property, String suffix, List<org.semanticweb.owlapi.model.IRI> includedProperties) throws ReasoningException
      Unfold classes for the specified taxon over the specified linking property.
      Parameters:
      taxon - The taxon to unfold for.
      property - The property linking taxon-specific classes to their taxon-neutral counterparts.
      suffix - The suffix to append to the label of unfolded subclasses.
      includedProperties - The properties to preserve (may be null.
      Throws:
      ReasoningException - If the ontology is not consistent.
    • visit

      public void visit(org.semanticweb.owlapi.model.OWLEquivalentClassesAxiom axiom)
      Specified by:
      visit in interface org.semanticweb.owlapi.model.OWLLogicalAxiomVisitor
      Overrides:
      visit in class org.semanticweb.owlapi.util.OWLAxiomVisitorAdapter
    • visit

      public void visit(org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom axiom)
      Specified by:
      visit in interface org.semanticweb.owlapi.model.OWLAnnotationAxiomVisitor
      Overrides:
      visit in class org.semanticweb.owlapi.util.OWLAxiomVisitorAdapter
    • visit

      public void visit(org.semanticweb.owlapi.model.OWLSubClassOfAxiom axiom)
      Specified by:
      visit in interface org.semanticweb.owlapi.model.OWLLogicalAxiomVisitor
      Overrides:
      visit in class org.semanticweb.owlapi.util.OWLAxiomVisitorAdapter