Class NormalizeCommand

java.lang.Object
org.incenp.obofoundry.odk.BasePlugin
org.incenp.obofoundry.odk.NormalizeCommand
All Implemented Interfaces:
org.obolibrary.robot.Command

public class NormalizeCommand extends BasePlugin
A command to perform various “normalisation” operations on an ontology.

Available normalization operations currently include:

  • injecting SubAnnotationPropertyOf axioms to ensure that IRIs representing subsets (used as the value of oboInOwl#inSubset annotations) are subproperties of oboInOwl#SubsetProperty;
  • likewise, injecting SubAnnotationPropertyOf axioms to ensure that IRIs representing synonym types (used as the value of oboInOwl#hasSynonymType annotations) are subproperties of oboInOwl#SynonymTypeProperty;
  • merging logically equivalent axioms, that differ only by their annotation sets;
  • injecting a dc:source ontology annotation derived from the version IRI.
  • Constructor Details

    • NormalizeCommand

      public NormalizeCommand()
  • Method Details

    • performOperation

      public void performOperation(org.obolibrary.robot.CommandState state, org.apache.commons.cli.CommandLine line) throws Exception
      Description copied from class: BasePlugin
      Performs whatever operation the command is supposed to do.
      Specified by:
      performOperation in class BasePlugin
      Parameters:
      state - The internal state of ROBOT.
      line - The command line used to invoke the command.
      Throws:
      Exception - If any error occurs when attempting to execute the operation.
    • mergeAxioms

      public static void mergeAxioms(org.semanticweb.owlapi.model.OWLOntology ontology)
      Merges all logically equivalent axioms in the given ontology. Logically equivalent axioms, in the context of this command, refers to axioms that differ only by their annotations.
      Parameters:
      ontology - The ontology whose logically equivalent axioms are to be merged. Axioms from the imports closure are not processed.
    • injectDeclarations

      public static void injectDeclarations(org.semanticweb.owlapi.model.OWLOntology ontology, Set<String> prefixes, boolean forSubsets, boolean forSynonyms)
      Inject SubAnnotationPropertyOf axioms for IRIs representing subsets or synonyms.
      Parameters:
      ontology - The ontology in which axioms should be injected. When collecting the IRIs used as subsets or synonym types, annotation axioms from the imports closure are not taken into account.
      prefixes - A set of IRI prefixes; axioms will only be injected for IRIs that start with one of the given prefixes. May be null to force injecting axioms for all IRIs regardless of their namespace.
      forSubsets - If true, inject axioms to declare subset properties.
      forSynonyms - If true, inject axioms to declare synonym type properties.