Getting Started with the Anzo CLI

This section provides instructions for opening and configuring the Anzo Command Line Interface (CLI).

In Unix environments, the Anzo CLI utility, anzo, is in the Client directory in the Anzo installation directory (for example, /opt/Anzo/Client). In Windows environments, you can access the Anzo CLI shortcut from the Anzo Server program in the Start menu. The Anzo CLI is typically installed in c:\Program Files\Anzo\Client.

Tip: You can configure the operating system's PATH environment variable to include the Client directory so that you can type anzo from anywhere to open the Anzo CLI.

Applying Common Configuration Settings

You can include a settings file to specify the default Anzo CLI configuration values for parameters such as host, port, and user. Specifying these details in the settings file eliminates the need to include those options in subsequent commands.

To create and populate the settings file, settings.trig, in your home directory, run the following command:

anzo setup options

Where options include the following choices:

-beep , --beep                   beep when command is completed
-ds , --datasource <datasource>  URI of the datasource to query, if other than primary datasource.
                                 Option not available for dataset queries.
-h , --host <hostname>           anzo server hostname
-http , --http                   Use http connection to server.
-p , --port <int>                anzo server port
-pause , --pause-exit            Wait for a user key entry before an abnormal exit.
-ssl , --use-ssl                 Use SSL for connection.
-t , --timeout <timeout>         override the default 30 second timeout for operations
-timer , --timer                 Print out the total operation time
-trace , --show-trace            Show stack trace for errors.
-trust , --trust-all             Trust all certificates including invalid ones
-u , --user <string>             username to connect with
-w , --password <string>         user's password
-x , --exclude-prefixes          Do not use prefixes defined in user settings to expand options,
                                 arguments, or to write RDF.
-z , --settings <file>           override the default settings file location

For example:

anzo setup -h localhost -p 61616 -u sysadmin -w @nz0

Anzo creates the settings.trig file in the /<user>/.anzo directory in Unix environments or C:\Users\<user>\.anzo in Windows environments. You can edit the file as needed.

The Anzo CLI installation also includes a sample settings file, settings_example.trig, in the /Anzo/Client directory. You can view the sample file for reference. For example:

### standard prefixes
@prefix foaf      : <http://xmlns.com/foaf/0.1/> .
@prefix rdfs      : <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dc        : <http://purl.org/dc/elements/1.1/> .
@prefix xsd       : <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf       : <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
#### anzo prefixes:
@prefix cli : <http://openanzo.org/cli/> .
@prefix system : <http://openanzo.org/ontologies/2008/07/System#> .
@prefix anzo : <http://openanzo.org/ontologies/2008/07/Anzo#> .
@prefix ld : <http://cambridgesemantics.com/ontologies/2009/05/LinkedData#> .
@prefix anzowt : <http://cambridgesemantics.com/ontologies/2009/05/AnzoWebToolkit#> .
@prefix reg : <http://cambridgesemantics.com/registries/> .
@prefix ontserv : <http://cambridgesemantics.com/semanticServices/OntologyService#> .
@prefix ldserv : <http://cambridgesemantics.com/semanticServices/LinkedData#> .
cli:config {
  cli:config
#       system:user "" ;
#       system:password "" ;
  system:timeout  "0";
  system:useSsl "false";
  system:port "61616";
  system:keystoreFile "${ANZO_CLI_HOME}/../Common/ssl/client.ks";
  system:keystoreType "JCEKS";
  system:keystorePassword "p@ssw0rd";
  system:truststoreFile "${ANZO_CLI_HOME}/../Common/ssl/client.ts";
  system:truststoreType "JCEKS";
  system:truststorePassword "p@ssw0rd";
  .
}