Package org.incenp.obofoundry.odk
Class NormalizeCommand
java.lang.Object
org.incenp.obofoundry.odk.BasePlugin
org.incenp.obofoundry.odk.NormalizeCommand
- All Implemented Interfaces:
org.obolibrary.robot.Command
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 ofoboInOwl#SubsetProperty
; - likewise, injecting SubAnnotationPropertyOf axioms to ensure
that IRIs representing synonym types (used as the value of
oboInOwl#hasSynonymType
annotations) are subproperties ofoboInOwl#SynonymTypeProperty
; - merging logically equivalent axioms, that differ only by their annotation sets;
- injecting a
dc:source
ontology annotation derived from the version IRI.
-
Field Summary
Fields inherited from class org.incenp.obofoundry.odk.BasePlugin
ioHelper, options
Fields inherited from interface org.obolibrary.robot.Command
global, missingFileError
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
injectDeclarations
(org.semanticweb.owlapi.model.OWLOntology ontology, Set<String> prefixes, boolean forSubsets, boolean forSynonyms) Inject SubAnnotationPropertyOf axioms for IRIs representing subsets or synonyms.static void
mergeAxioms
(org.semanticweb.owlapi.model.OWLOntology ontology) Merges all logically equivalent axioms in the given ontology.void
performOperation
(org.obolibrary.robot.CommandState state, org.apache.commons.cli.CommandLine line) Performs whatever operation the command is supposed to do.Methods inherited from class org.incenp.obofoundry.odk.BasePlugin
execute, getDescription, getIRI, getName, getOptions, getUsage, main, readFile, readFileAsIRIs
-
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 classBasePlugin
- 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 benull
to force injecting axioms for all IRIs regardless of their namespace.forSubsets
- Iftrue
, inject axioms to declare subset properties.forSynonyms
- Iftrue
, inject axioms to declare synonym type properties.
-