/**
* Configuration parameters for:
* - the server itself
* - the reasoner
* @namespace Config
*/
const path = require('path')
const workSpacePath = path.join(__dirname, './')
const reasoningPath = path.join(__dirname, './reasoning')
/** Path to the eye executable/script that runs the reasoner
* @type {String}
* @memberof Config
*/
const eyePath = '/opt/eye/bin/eye.sh'
/** Port the server will be served on
* @type {String}
* @memberof Config
* @private
*/
const port = '8089'
/** Prefix to be used for the routes eg: '/api/v6'
*
* Either leave empty '' or as '/' when no prefix is needed
* @type {String}
* @memberof Config
* @private
*/
const routesPrefix = '/api/v9'
/**
* Allowed origins used for cross origin access
*/
const allowedOrigins = [
'http://localhost:8080'
]
/**
* @typedef ServerOptions
* @memberof Config
* @property {Object} uriqa - should match the server's base url, it is used to match the prefixes of resources hosted on the server when the server is started
* @property {String} port - port the server is hosted on
* @property {String} routesPrefix - the routespace of the server, eg: /api/v6
* @property {String} workSpacePath - root workspace of the server
* @property {String} reasoningPath - folder which contains all of the files necessary for the reasoning
* @property {String} indexFile - the filename the reasoning implementation will look when routes that require reasoning are called, the contents should contain the reasoning routes and points to query and data sources (for instance reasoning/index.json)
* @property {Boolean} verbose - enables extra console logging
*/
/**
* @typedef EyeOptions - options for the reasoner
* @memberof Config
* @property {Boolean} consoleLogging - enables console logging of the reasoner's output
* @property {String} eyePath - the path to the eye reasoner
* @property {String[]} defaultFlags - extra flags passed to the reasoner, currently passing "--nope" which disables proof explanation
* @property {Object} command_arguments - arguments to be passed to nodeJS's 'exec' function, not to the reasoner itself.
*/
/**
* Global config object
* @type {Object}
* @memberof Config
* @property {Config.ServerOptions} serverOptions - options for the server
* @property {Config.EyeOptions} eyeOptions - options for the reasoner
*/
const config = {
serverOptions: {
uriqa: 'http://fast.ilabt.imec.be' + routesPrefix,
port: port,
routesPrefix: routesPrefix,
workSpacePath: workSpacePath,
reasoningPath: reasoningPath,
verbose: true,
indexFile: 'index.json',
allowedOrigins: allowedOrigins
},
eyeOptions: {
consoleLogging: false,
command_arguments: { maxBuffer: 1024 * 500 },
eyePath: eyePath,
defaultFlags: ['--nope']
},
/**
* @deprecated unused
* @todo figure out what this was for and if it's still usefull
*/
processorOptions: {
showFiles: true,
showDirectories: true,
defaultContentType: 'application/x-json+ld',
hydraOperations: ['POST', 'PUT', 'DELETE']
},
/**
* @deprecated unused
* @todo figure out what this was for and if it's still usefull
*/
defaultContext: {
'@vocab': 'http://example.org#',
fluid: 'http://josd.github.io/fluid#',
hes: 'http://cristianvasquez.github.io/hes#'
}
}
module.exports = config