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 ClassesModifier and TypeClassDescriptionstatic enumMode of operation for general class axioms. -
Constructor Summary
ConstructorsConstructorDescriptionSpeciesMerger(org.semanticweb.owlapi.model.OWLOntology ontology, org.semanticweb.owlapi.reasoner.OWLReasoner reasoner) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidmerge(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.voidsetExtendedTranslation(boolean b) Enables or disables the translation of more class expressions.voidSets the behaviour for general class axioms (GCAs) that have one (or more) merged class in their signature.voidsetRemoveDeclarationAxiom(boolean b) Enables or disables removal of declaration axioms for classes that have been replaced by a translated expression.voidvisit(org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom axiom) voidvisit(org.semanticweb.owlapi.model.OWLEquivalentClassesAxiom axiom) voidvisit(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
-
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-trueto enable translating additional expressions.
-
setGCAMode
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.TRANSLATEto translate those axioms, or toSpeciesMerger.GCAMergeMode.DELETEto 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-trueto 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 benull.- Throws:
ReasoningException- If the ontology is not consistent.
-
visit
public void visit(org.semanticweb.owlapi.model.OWLEquivalentClassesAxiom axiom) - Specified by:
visitin interfaceorg.semanticweb.owlapi.model.OWLLogicalAxiomVisitor- Overrides:
visitin classorg.semanticweb.owlapi.util.OWLAxiomVisitorAdapter
-
visit
public void visit(org.semanticweb.owlapi.model.OWLAnnotationAssertionAxiom axiom) - Specified by:
visitin interfaceorg.semanticweb.owlapi.model.OWLAnnotationAxiomVisitor- Overrides:
visitin classorg.semanticweb.owlapi.util.OWLAxiomVisitorAdapter
-
visit
public void visit(org.semanticweb.owlapi.model.OWLSubClassOfAxiom axiom) - Specified by:
visitin interfaceorg.semanticweb.owlapi.model.OWLLogicalAxiomVisitor- Overrides:
visitin classorg.semanticweb.owlapi.util.OWLAxiomVisitorAdapter
-