OpO FAST Triple Store, Web Server, and JSON Database
OpO

OpO uses a configuration file to determine what option values are. The location of the configuration file can be given on the command line or if it exists in one of the default locations that will be used. The default locations searched are, in order:

  1. ./opo.conf
  2. ./config/opo.conf
  3. ~/opo/opo.conf
  4. /etc/opo.conf

The configuration files follow the unix 'conf' format. An example file is sample.conf.

The descriptions that follow include all the avaliable options and the default values for those options. All option keys are case insensitive.

dir = /var/opo
The directory to store the opo data.
journal = true
A journal is kept if this option is true. When set to false changes in the data are not persisted until a clean exit or a explicit persist command to the opod.
sync = false
If sync is true then writes are always synced to disk before returning. Performance is far better if sync is set to false.
exit_sync = false
If exit_sync is true then writes are performed on normall shutdown or by ctrl-C unless journalling is already on or sync is true.
format = JSON
Format for import and dump. Valid values are JSON, RDF, or TURTLE, case insensitive. The indent option if for the JSON format only.
threads = 2
One or more threads are created to process requests. Set the threads to the value best suited to the machine opo will be running on.
bind = http://:6363
OpO supports an HTTP interface. The HTTP interface includes documentation pages, access helper pages, static assets, and REST APIs for data access with OpO using either a JSON model of SPARQL when using the triple store model.
Bind URLs idenfity the ports and interfaces the HTTP server should listen on. Multiple binds are supported and can be either IPv4 or IPv6. The low level interface used for direct access are identified by a URL scheme of 'opo'. A blank bind removes all binds.
assets = pages
Opo can also be used to serve custom pages. Note that built in URL paths take precedence over subdirectories in the provided assets directory. If left blank then no custom pages are served.
Log related options are all prefixed with 'log.'. Log files are written to a specified log directory and rotated as they exceed the maximum size. Log files are in JSON format.
log.dir = /var/log
The directory to write log files to.
log.maxFiles = 3
The maximum number of archived log files to keep in addition to the current log file.
log.maxSize = 100000000
Size that when exceeded cause the log files to rotate. Note file may and are usually slightly larger than the maximum size as the the maximum size is a trigger to rotate.
log.console = true
If true log entries are displayed on the console.
log.classic = true
If true console log out is in classic format. If false output is in JSON format.
log.colorize = true
If true console output is colorized.
Logging category or feature based. To log details about specific features turn the category on. Colors can also be set for each category. Supported colors are:
  • black
  • red
  • green
  • yellow
  • blue
  • magenta
  • cyan
  • white
  • gray
  • dark_red
  • dark_green
  • brown
  • dark_blue
  • purple
  • dark_cyan
log.cats.error.on = true log.cats.error.color = red
The error category.
log.cats.warn.on = true log.cats.warn.color = yellow
The warning category.
log.cats.run.on = true log.cats.run.color = green
If on the run state on start and exit is displayed along with some other information.
log.cats.mod.on = false log.cats.mod.color = dark_green
The mod category is used to log changes or modifications to data in the store. Any insert, update, and delete is logged if true.
log.cats.journal.on = false log.cats.journal.color = dark_green
The journal category. A log message is published for ever journal entry. Very verbose.
log.cats.request.on = false log.cats.request.color = cyan
Logging for http requests is controlled by these options. Note that HTTP logging is finer grained that others.
log.cats.response.on = false log.cats.response.color = dark_cyan
HTTP response logging.
log.cats.eval.on = false log.cats.eval.color = blue
Request evaluation.
log.cats.push.on = false log.cats.push.color = dark_cyan
Websocket or SSE push.
log.cats.debug.on = false log.cats.http_debug.color = gray
HTTP details including payloads.
json.indent = 0
When JSON is generated for query responses it will be indented according to this option.
json.detect.iri = true
Opo data types include more types than supported by JSON natively. The JSON detect options control what the JSON parse does when it encounters a value that could be read as a different type.
A value starting with http:// will be treated as a IRI if this option is true.
json.detect.time.string = true
If true a string that has the form that matches RFC3339 will be converted to a date-time. Examples are: 2017-01-05T12:34:56+07:00, 2017-01-05T12:34:56Z and 2017-01-05T12:34:56.999999999-07:00.
time.format = XSD time.zone = 0
Time is stored as UNIX UTC internally. Time zones are not stored. The time format options allow the time format and time zone to be used in the output strings or numbers. Options for time format are:
  • UNIX: seconds from UTC epoch with 9 decimal places for seconds
  • UNIX6: seconds from UTC epoch with 6 decimal places for seconds
  • UNIX3: seconds from UTC epoch with 3 decimal places for seconds
  • UNIX0: seconds from UTC epoch with no decimal places for seconds
  • XSD9: XSD date-time with 9 decimal places for seconds
  • XSD6: XSD date-time with 6 decimal places for seconds
  • XSD3: XSD date-time with 3 decimal places for seconds
  • XSD0: XSD date-time with no decimal places for seconds
  • XSD: XSD date-time with up to 9 decimal places for seconds. Trailing 0 are stripped
  • DATE: XSD date-time with up to 9 decimal places for seconds. Trailing 0 are stripped. If hours, minutes, and seconds are 0 then only the date portion is output.
json.detect.time.number.on = true json.detect.time.number.min = 1400000000 json.detect.time.number.max = 1600000000 json.detect.time.number.decimals = 9
It is common for number to be used for times as well. A few extra control parameters are needed to limit the scope of time detection. The min and max values specify the range for detection. The decimals if non-zero sets up a requirement for that specific number of decimal places that must match.
json.detect.uuid = true
A value that has the format of a UUID (123e4567-e89b-12d3-a456-426655440000) be treated as a UUID if this option is true. Providing a slight performance improvment with UUIDs.
type.prefixes = http://www.w3.org/2001/XMLSchema#,http://www.w3.org/TR/xmlschema11-2/#,http://www.w3.org/TR/xmlschema-2/#
IRI aliases can be registered. These aliases will take precedence over any prefix defined in a TURTLE import. Note that the commented out sample are most likely out of date. Thats one of the problems with including the date in the URL. It is also an advantage is referring to an older specification.

N-Triples and N-Quads literal strings can have a type associated with the string. Opo attempts to convert the strings to native types if possible. To do so it looks for know IRI prefixes followed by the type. The supported types are 'integer', 'double', 'time', and 'datetime'. The listed type.prefixes are used to form the IRIs that trigger the conversion of a string to the respective native type. A comma separated list is expected.
  • ns.dct = http://purl.org/dc/terms/
  • ns.foaf = http://xmlns.com/foaf/0.1/
  • ns.gr = http://purl.org/goodrelations/v1#
  • ns.org = http://www.w3.org/ns/org#
  • ns.owl = http://www.w3.org/2002/07/owl#
  • ns.prov = http://www.w3.org/ns/prov#
  • ns.rdf = http://www.w3.org/1999/02/22-rdf-syntax-ns#
  • ns.rdfs = http://www.w3.org/2000/01/rdf-schema#
  • ns.skos = http://www.w3.org/2004/02/skos/core#
  • ns.time = http://www.w3.org/2006/time#
  • ns.vcard = http://www.w3.org/2006/vcard/ns#
  • ns.xsd = http://www.w3.org/2001/XMLSchema#
type.prefixes = http://www.w3.org/2001/XMLSchema#,http://www.w3.org/TR/xmlschema11-2/#,http://www.w3.org/TR/xmlschema-2/#
N-Triples literal strings can have a type associated with the string. Opo attempts to convert the strings to native types if possible. To do so it looks for know IRI prefixes followed by the type. The supported types are 'integer', 'double', 'time', and 'datetime'. The listed type.prefixes are used to form the IRIs that trigger the conversion of a string to the respective native type. A comma separated list is expected.
  • type.prefix = http://www.w3.org/2001/XMLSchema#
  • type.prefix = http://www.w3.org/TR/xmlschema11-2/#
  • type.prefix = http://www.w3.org/TR/xmlschema-2/#