Package org.phyloref.jphyloref.commands
Class WebserverCommand
java.lang.Object
org.phyloref.jphyloref.commands.WebserverCommand
- All Implemented Interfaces:
Command
public class WebserverCommand extends java.lang.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 Summary
Constructors Constructor Description WebserverCommand() -
Method Summary
Modifier and Type Method Description voidaddCommandLineOptions(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).java.lang.StringgetDescription()A description of the Webserver command.java.lang.StringgetName()This command is named "webserver".Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
WebserverCommand
public WebserverCommand()
-
-
Method Details
-
getName
public java.lang.String getName()This command is named "webserver". It should be invoked as "java -jar jphyloref.jar webserver ..." -
getDescription
public java.lang.String 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
public int execute(org.apache.commons.cli.CommandLine cmdLine) throws java.lang.RuntimeExceptionSet up a webserver to listen on the provided hostname and port (or their defaults).
-