Previous topic  Top  Next topic  Print this Topic
 

Use the OntoBroker Server from commandline

 

OntoBroker can be started from commandline by either using the script start-ontobroker.cmd (on Windows) or start-ontobroker.sh (on Linux). On Windows platforms you may also use OntoBroker32/64.exe. This executable does the same as the start-ontobroker.cmd: it automatically reads all JAR files within the lib directory and executes the inference server. Using OntoBroker.exe makes it easy to integrate OntoBroker in your own scripts.

The following command is used to launch the server:

start-ontobroker.cmd [options] [filenames]

start-ontobroker.sh [options] [filenames]

 

-configFile <configFile>

The configuration file to be used (default: OntoConfig.prp).

-project <projectFile>

Use project file for advanced load configuration.

-webservice

Enables OntoBroker web service. Alternatively use the parameter WebServices = on

-ajp

Enables OntoBroker web service for load balancing. Alternatively use the parameter AJP = on

-webconsole

Enables OntoBroker web console. Alternatively use the parameter WebConsole = on

-collabserver

Enables OntoBroker collaboration server (implicitly sets Indexer = on); alternatively use the parameter CollaborationServer = on

-collabserverNoIndexer

Enables OntoBroker collaboration server (leaves Indexer settings unchanged)

-remoteAPI

This has nearly the same effect as the option -collabserver. The OntoBroker is tuned for query performance and some special functionalities needed for OntoStudio are not switched on. This means that an OntoStudio cannot use this instance as a collaboration server. If OntoBroker is started with -remoteAPI it behaves as a stand alone server, i.e. the inferencing mode is turned off. Alternatively use the parameter RemoteAPI = on

-fenc <encoding>

File encoding used for reading files. (e.g. chinese codes are "big5", "csBig5" and "iso_ir-58"). This is necessary when the file encoding of a concrete file differs from the default of your operating system.

-m

Materialize the following file or directory

-m:update

Materialize the following file or directory (updatable)

-commitDuringImport

Executed multiple commits while loading a file

-silent

Turns off logging

-rdf,-rdfs,-obl,-owl,-nt,

-nt3 <directory or filename>

Explicitly specifies the data format for reading

-help,-h

Prints usage text and exits

-diagnostics

Writes information to the log which could help to analyze bugs.

 

NOTE: If a parameter has been specified both in the OntoConfig and on the command line, the command line option overrules the OntoConfig settings.

Example:

start-ontobroker.cmd -webservice -collabserver -configFile OntoConfig.prp -m -flo examples/flo/Unternehmen_US.obl -obl example/flo/Process_US.obl.

If the environment variable ONTOBROKER_HOME is set, it is possible to run OntoBroker from any directory. As OntoBroker looks in the working directory for OntoConfig.prp, log4j.properties and for various files in the conf subdirectory by default, you have to change these defaults explicitly or copy these files in your working directory.

Changing location of OntoConfig.prp: use the command line option -configFile <configFile>
Changing location of log4j.properties: set the Java system environment -Dlog4j.configuration=file:<filename>
Changing location of the conf directory: Explicitly set the dir.conf parameter in the OntoConfig.prp

 
A query is sent to the server using the command line client:

query.cmd [-h <hostname>] [-p <portno>] [-l <user>:<pwd>] <query>

query.sh [-h <hostname>] [-p <portno>] [-l <user>:<pwd>] <query>

 

A command is sent to the server using the command line client:

command.cmd [-h <hostname>] [-p <portno>] [-l <user>:<pwd>] <command>

command.sh [-h <hostname>] [-p <portno>] [-l <user>:<pwd>] <command>

The optional arguments <hostname> and <portno> allow accessing the server on a different host on the specified port. If no <hostname> is given the local host is used. If no port number is given the standard port 2267 is used. When login is required credentials can be given with the optional arguments <user> and <pwd>.