Class WebserverCommand

java.lang.Object
org.phyloref.jphyloref.commands.WebserverCommand
All Implemented Interfaces:
Command

public class WebserverCommand extends Object implements Command
Sets up a webserver that allows reasoning over phyloreferences over HTTP.

At the moment, we implement a simple API, in which: /version: returns a JSON object with information on the version of JPhyloRef and the reasoner being used. /reason: expects a form upload with a 'jsonld' element containing a file upload of a JSON-LD file representing an ontology to test. This command will reason over the ontology and return a JSON dictionary, in which the keys are the IRIs for each phyloreference, and the values are lists of the IRIs of each node matched by that phyloreference.

Author:
Gaurav Vaidya
  • Constructor Details

    • WebserverCommand

      public WebserverCommand()
  • Method Details

    • getName

      public String getName()
      This command is named "webserver". It should be invoked as "java -jar jphyloref.jar webserver ..."
      Specified by:
      getName in interface Command
      Returns:
      The name of this command.
    • getDescription

      public String getDescription()
      A description of the Webserver command.
      Specified by:
      getDescription in interface Command
      Returns:
      A description of this command.
    • addCommandLineOptions

      public void addCommandLineOptions(org.apache.commons.cli.Options opts)
      Add command-line options specific to this command.
      Specified by:
      addCommandLineOptions in interface Command
      Parameters:
      opts - The command-line options to modify for this command.
    • execute

      public int execute(org.apache.commons.cli.CommandLine cmdLine) throws RuntimeException
      Set up a webserver to listen on the provided hostname and port (or their defaults).
      Specified by:
      execute in interface Command
      Parameters:
      cmdLine - The command line options provided to this command.
      Throws:
      RuntimeException