Skip to content

FedX Configuration

Andreas Schwarte edited this page Apr 8, 2019 · 2 revisions

FedX provides various means for configuration. Configuration settings can be defined in a simple property file as key value pairs. The property file can then be used to initialize the FedX config (e.g. via Config.initialize("path/to/fedxConfig.prop")).

Example property file:

# FedX Configuration

boundJoinBlockSize = 15
debugQueryPlan = true
dataConfig = examples/DBpediaSemanticWebDogFood.ttl
prefixDeclarations = examples/prefixDeclarations.prop

Available Properties

Property Description
dataConfig Location of the data configuration, relative to execution directory
prefixDeclarations Path to prefix declarations file, see PREFIX Declarations
cacheLocation Location where the memory cache gets persisted at shutdown, default cache.db
joinWorkerThreads The number of join worker threads for parallelization, default 20
unionWorkerThreads The number of union worker threads for parallelization, default 20
boundJoinBlockSize Block size for bound joins, default 15
enforceMaxQueryTime Max query time in seconds, 0 to disable, default 30
optimizer.enableServiceAsBoundJoin Flag for evaluating a SERVICE expression (contacting non-federation members) using vectored evaluation, default false. For today's endpoints it is more efficient to disable vectored evaluation of SERVICE
baseDir The base directory used for loading repositories, default current working dir
debugQueryPlan Print the optimized query execution plan to stdout, default false
enableMonitoring Flag to enable/disable monitoring features, default false
monitoring.logQueryPlan  Flag to enable/disable query plan logging via Java class QueryPlanLog, default false
monitoring.logQueries  Flag to enable/disable query logging via QueryLog, default false. The QueryLog facility allows to log all queries to a file.

Query timeouts

FedX supports to define the maximum execution time for a query. This can be set on query level Query#setMaxExecutionTimeor globally using the FedX config setting enforceMaxQueryTime.

Note that the query engine attempts to abort any running evaluation of a subquery when the maximum execution time has reached.

If a query timeout occurs, a QueryInterruptedException is thrown.

Prefix declarations

FedX allows to (optionally) define commonly used prefixes (e.g. rdf, foaf, etc.) in a configuration file. These configured prefixes are then automatically inserted into a query, meaning that the user does not have to specify full URIs nor the PREFIX declaration in the query.

The prefixes can be either specified in a configuration file as key-value pairs or directly configured via Java code (see examples below). When using a configuration file, this can be configured via the prefixDeclarations property.

Example: Prefix configuration via configuration file

# this file contains a set of prefix declarations
=http://example.org/
foaf=http://xmlns.com/foaf/0.1/
rdf=http://www.w3.org/1999/02/22-rdf-syntax-ns#
dbpedia=http://dbpedia.org/ontology/

Example: Setting prefixes at runtime

The QueryManager can be used to define additional prefixes at runtime.

QueryManager qm = FederationManager.getInstance().getQueryManager();
qm.addPrefixDeclaration("rdf", "http://www.w3.org/1999/02/22-rdf-syntax-ns#");
qm.addPrefixDeclaration("dbpedia", "http://dbpedia.org/ontology/");