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#inSubsetannotations) are subproperties ofoboInOwl#SubsetProperty; - likewise, injecting SubAnnotationPropertyOf axioms to ensure
that IRIs representing synonym types (used as the value of
oboInOwl#hasSynonymTypeannotations) are subproperties ofoboInOwl#SynonymTypeProperty; - merging logically equivalent axioms, that differ only by their annotation sets;
- injecting a
dc:sourceontology annotation derived from the version IRI.
-
Field Summary
Fields inherited from class org.incenp.obofoundry.odk.BasePlugin
ioHelper, optionsFields inherited from interface org.obolibrary.robot.Command
global, missingFileError -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidinjectDeclarations(org.semanticweb.owlapi.model.OWLOntology ontology, Set<String> prefixes, boolean forSubsets, boolean forSynonyms) Inject SubAnnotationPropertyOf axioms for IRIs representing subsets or synonyms.static voidmergeAxioms(org.semanticweb.owlapi.model.OWLOntology ontology) Merges all logically equivalent axioms in the given ontology.voidperformOperation(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
-
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:BasePluginPerforms whatever operation the command is supposed to do.- Specified by:
performOperationin 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 benullto 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.
-