Class RemoveCommand

  • All Implemented Interfaces:
    Command

    public class RemoveCommand
    extends Object
    implements Command
    Remove axioms from an ontology based on a series of inputs.
    Author:
    Becky Tauber
    • Constructor Detail

      • RemoveCommand

        public RemoveCommand()
        Initialze the command.
    • Method Detail

      • getName

        public String getName()
        Name of the command.
        Specified by:
        getName in interface Command
        Returns:
        name
      • getDescription

        public String getDescription()
        Brief description of the command.
        Specified by:
        getDescription in interface Command
        Returns:
        description
      • getUsage

        public String getUsage()
        Command-line usage for the command.
        Specified by:
        getUsage in interface Command
        Returns:
        usage
      • getOptions

        public org.apache.commons.cli.Options getOptions()
        Command-line options for the command.
        Specified by:
        getOptions in interface Command
        Returns:
        options
      • main

        public void main​(String[] args)
        Handle the command-line and file operations.
        Specified by:
        main in interface Command
        Parameters:
        args - strings to use as arguments
      • execute

        public CommandState execute​(CommandState state,
                                    String[] args)
                             throws Exception
        Given an input state and command line arguments, create a new ontology with removed axioms and return a new state. The input ontology is not changed.
        Specified by:
        execute in interface Command
        Parameters:
        state - the state from the previous command, or null
        args - the command-line arguments
        Returns:
        a new state with the new ontology
        Throws:
        Exception - on any problem
      • getObjects

        protected static Set<org.semanticweb.owlapi.model.OWLObject> getObjects​(org.apache.commons.cli.CommandLine line,
                                                                                IOHelper ioHelper,
                                                                                org.semanticweb.owlapi.model.OWLOntology ontology,
                                                                                List<List<String>> selectGroups)
                                                                         throws Exception
        Given a command line, an IOHelper, an ontology, and a list of select groups, return the objects from the ontology based on the select groups.
        Parameters:
        line - CommandLine to get options from
        ioHelper - IOHelper to get IRIs
        ontology - OWLOntology to get objects from
        selectGroups - List of select groups (lists of select options)
        Returns:
        set of selected objects from the ontology
        Throws:
        Exception - on issue getting terms or processing selects