OpO and OpO-Rub both use 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,
For OpO-Rub opo-rub.conf
first in each of the directories noted.
The OpO-Rub configuration file includes additional options not
relevant to the OpO binary.
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
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.
http.port = 6363
Opo supports an HTTP interface. The HTTP interface includes
documentation pages, access helper pages, and REST APIs for
interating with opo using either a JSON model of SPARQL when using
the triple store model.
The port to connect to opo on using an HTTP browser. A value of zero
indicates no HTTP connectivity.
Opo can also be used to serve custom pages. Note that built in URL
paths take precedence over subdirectories in the provided pages
dir. If left blank then no custom pages are served.
log.dir = /var/log
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.
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
log.colorize = true
If true console output is colorized.
log.syslog.udp = true
If the syslog address and port in the format 10.10.0.7:1234 is
provided log messages are also send to syslog on the provided
address. If the UDP option is true the syslog send is done using UDP
instead of TCP.
Not Implemented Yet.
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:
log.cats.error.on = true
log.cats.error.color = red
log.cats.warn.on = true
log.cats.warn.color = yellow
log.cats.run.on = true
log.cats.run.color = purple
If on the run state on start and exit is displayed along with some
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.http_request.on = false
log.cats.http_request.color = dark_green
Logging for http requests is controlled by these options. Note that
HTTP logging is finer grained that others.
log.cats.http_response.on = false
log.cats.http_response.color = dark_green
log.cats.http_debug.on = false
log.cats.http_debug.color = purple
HTTP details including payloads.
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
rdf.default.namespace = http://localhost#
JSON imports are converted to triples but not RDF compliant
triples. In an RDF triple the subject must be either a blank or a
IRI. The predicate must be a IRI. Since imported JSONs do not have
namespaces associated with them a default namespace is used to make
the JSON literals into IRIs using a default namespace.
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#
Handlers are applications that are spawned (forked) to handle HTTP
requests. The configuration entries start with 'handler.' followed
by the name of the handler. Parameters to the handler follow the
name. Multiple handlers can be running at the same time if using
different paths. The view conf.js would have to change to use one
path or the other by setting the wab.pathPrefix value.
#handler.sample.path = /sample/**
The path to match against. Wildcards are '*' to match a single path
element and '**' to match the rest of the path.
#handler.sample.max_out = 10
The maximum number of outstanding requests allowed before blocking.
#handler.sample.cmd = sample.rb hello
The command and arguments to execute.
#handler.sample.timeout = 1.0
The timeout before returning a timeout error if the app does not
#handler.sample.type = stdio
The handler type defaults to stdio which makes use of the 'cmd'
option. Other are available depending on the opo embedded version
When using opo-rub or other opo version with embedded interpreters
the 'embed' options can be used. The handler options are also
extended to support calling the embedded interpreter.
#embed.load_path = lib
The load path is set to include the project lib directory.
#embed.require = ui_controller
The Ruby requires. Generally whatever class in the lib directory
that should be imported.
#embed.setup = puts 'Ruby Started'
Code to run immediately after setup of the embedded Ruby.
#embed.cleanup = puts 'Ruby Finished'
Code to run before shurdown of the embedded Ruby.
embed.type_key = kind
Field to expect the type, class, or kind of record in the stored
embed.path_pos = 1
Position in the URL path that identifies the record type or
kind. The first position is 0.
#embed.alternative_source = WAB.get_export
This sets up the WABuR gem as an alternate source for the wab
gem's export directory is they are not found in the site directory.