Class EquivalenceSetMerger

java.lang.Object
org.incenp.obofoundry.uberon.util.EquivalenceSetMerger

public class EquivalenceSetMerger extends Object
A helper class to merge classes that are inferred to be equivalent. This is a port of Chris Mungall's implementation in OWLTools.
  • Constructor Details

    • EquivalenceSetMerger

      public EquivalenceSetMerger()
  • Method Details

    • setPrefixScore

      public void setPrefixScore(String prefix, Double score)
      Set the priority score for a given prefix. When two (or more) classes are merged, the merged class will use the IRI coming from the ontology associated with the highest score.
      Parameters:
      prefix - An ontology prefix.
      score - The associated score. The higher the score, the more likely it is that IRIs with the specified prefix will be chosen.
    • setPropertyPrefixScore

      public void setPropertyPrefixScore(org.semanticweb.owlapi.model.OWLAnnotationProperty p, String prefix, Double score)
      Set a property-specific score for a given prefix. When two (or more) classes are merged, the merged class will keep the annotation property value that came from the ontology associated with the highest score.
      Parameters:
      p - An annotation property.
      prefix - An ontology prefix.
      score - The associated score.
    • addPreservedPrefix

      public void addPreservedPrefix(String prefix)
      Add a preserved prefix. Classes coming from an ontology with a preserved prefix will not be merged.
      Parameters:
      prefix - The prefix to preserve.
    • setAddEquivalenceAxioms

      public void setAddEquivalenceAxioms(boolean b)
      Enable or disable the generation of cross-reference annotations. If this option is enabled (it is by default), when two (or more) classes are merged, the resulting merged class will be annotated with cross-reference axioms (oboInOwl:hasDbXref) pointing to each of the original merged classes.
      Parameters:
      b - true to enable the generation of cross-references axioms.
    • merge

      public void merge(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasoner reasoner) throws ReasoningException
      Merge inferred equivalent classes in an ontology.
      Parameters:
      ontology - The ontology whose equivalent classes should be merged.
      reasoner - The reasoner to use to infer equivalences.
      Throws:
      ReasoningException - If the ontology is inconsistent.