Configuration

You need to set the following environment variables for rdfDB.
  1. RDFDB_DIR : rdfDB creates a directory for each database in the directory that is the value of RDFDB_DIR. You need to have right permissions for this directory so that rdfDB can create the subdirectories and files it needs.

    In the directory for each database are three files findex.db, rindex.db and arcindex.db.

  2. RDFDB_PORT : set this to something like 7001 (or whichever port you want the rdfDB service to be available at).
The Win32 port has much more extensive options, every setting can be set through an environment variable (convert the option to uppercase and prepend it with RDFDB_, example: set RDFDB_SETTING=value), a commandline parameter (prepend with -- and put an equal sign between the name of the setting and its value, no whitespace! example: --setting=value) or a configuration file (INI-like format, example: setting=value). The settings available for the Win32 port are:
Variable Description
dir (required) The directory where the RDFDB databases should reside.
port (required) The port RDFDB listens to.
users (required) The file containing the user information RDFDB should use. This file should consist of lines with the following syntax: username:rights:password. Whitespace is ignored in obvious places (at boundaries between fields, beginning and end of line, between keywords in the rights field). The username field can not be empty, the password field CAN. The rights field has the following syntax:
rights = 'all' | 'all except' permissions | permissions
permissions = ('connect' | 'admin' | 'read_db' | 'write_db' | 'read_url' | 'write_url')*
ip_ranges (required) The file containing information about IP ranges that are allowed to connect to RDFDB. This file should consist of lines with the following syntax: IP-range:rights. Where IP-range is either a single IP address, a single IP address (example: 192.168.1.32 with a wildcard (examples: 192.168.1.*, 192.168.*, *) or a range (two IP addresses with a dash (-) between them, example: 192.168.1.34-192.168.1.45). rights is as with the users setting.
namespaces A list of namespace definitions, see the documentation above for the syntax (under Global namespace mappings).
verbosity_mask A mask that determines which kinds of messages RDFDB should show (an integer in hexadecimal notation), the default depends on whether it's a debug build (all messages are shown) or a release build (700, or NOTICE, CRITICAL and INFO). The following values can be ORed (added) for valid values (all hexadecimal): NOTICE (100), CRITICAL (200), INFO (400), FAILURE (800) and DEBUG_INFO (1000). So if you want critical messages to show, as well as any (non-critical) failures, but not any of the other messages, you should set the verbosity_mask setting to A00 (200+800 in hexadecimal). The header RDFDB normally shows when it starts can't be disabled.
config_file The config file RDFDB should use (see the part about how RDFDB looks for settings above).
log_file A log file RDFDB should mirror all output to (the header RDFDB normally shows when it starts isn't written to the log).

You can run rdfDB from the command line like this :

shell>nohup ./rdfdb &
It will print out the version number.

Using rdfDB

At this point, one can only connect to rdfDB by telneting into the port specified by RDFDB_PORT and issuing queries.

There is a perl library to issue queries and get answers which can be downloaded from here. The perl library needs to be made into a DBI driver. I am also planning on providing a C client library.

rdfDB connections are very lightweight and can easily be created and terminated. rdfDB is multi-threaded and each connection gets its own thread. Right now, a new thread is created for each connection, but I plan to switch to a connection pool soon.

Queries are terminated with the string "</>". The response is zero or more lines, followed by the line

#result-code[:machine-readable[:human-readable]]
The result codes are described here. The result code 0 represents successful completion of the request. The last line is the only one which may begin with #.

NOTE: This information is targetted at the Win32 port, the original version used a (slightly) different format.