Package org.phyloref.jphyloref.commands
Class WebserverCommand
java.lang.Object
org.phyloref.jphyloref.commands.WebserverCommand
- All Implemented Interfaces:
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCommandLineOptions(org.apache.commons.cli.Options opts)Add command-line options specific to this command.intexecute(org.apache.commons.cli.CommandLine cmdLine)Set up a webserver to listen on the provided hostname and port (or their defaults).A description of the Webserver command.getName()This command is named "webserver".
-
Constructor Details
-
WebserverCommand
public WebserverCommand()
-
-
Method Details
-
getName
This command is named "webserver". It should be invoked as "java -jar jphyloref.jar webserver ..." -
getDescription
A description of the Webserver command.- Specified by:
getDescriptionin interfaceCommand- 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:
addCommandLineOptionsin interfaceCommand- Parameters:
opts- The command-line options to modify for this command.
-
execute
Set up a webserver to listen on the provided hostname and port (or their defaults).- Specified by:
executein interfaceCommand- Parameters:
cmdLine- The command line options provided to this command.- Throws:
RuntimeException
-