Skip to content

FedX CLI

Andreas Schwarte edited this page Apr 8, 2019 · 1 revision

FedX brings a comprehensive CLI to evaluate queries on a set of specified data sources.

Usage:
> FedX [Configuration] [Federation Setup] [Output] [Queries]
> FedX -{help|version}

WHERE
[Configuration] (optional)
Optionally specify the configuration to be used
        -c path/to/fedxConfig
        -p path/to/prefixDeclarations

[Federation Setup] (optional)
Specify one or more federation members
        -s urlToSparqlEndpoint
        -l path/to/NativeStore
        -d path/to/dataconfig.ttl

[Output] (optional)
Specify the output options, default stdout. Files are created per query to 
results/%outputFolder%/q_%id%.{json|xml}, where the outputFolder is the 
current timestamp, if not specified otherwise.
        -f {STDOUT,JSON,XML}
        -folder outputFolder

[Queries]
Specify one or more queries, in file: separation of queries by empty line
        -q sparqlquery
        @q path/to/queryfile

Notes:
The federation members can be specified explicitely (-s,-l,-d) or implicitely 
as 'dataConfig' via the fedx configuration (-f)

If no PREFIX declarations are specified in the configurations, the CLI provides
some common PREFIXES, currently rdf, rdfs and foaf. 

In the examples folder we provide many sample use cases. Below is a list of sample commands:

Evaluate query 1 at DBpedia and SemanticWebDogFood 
> cli -d examples\DBpediaSemanticWebDogFood.ttl @q examples\q1.txt

Evaluate query 1 at DBpedia and SemanticWebDogFood using JSON as output format
> cli -d examples\DBpediaSemanticWebDogFood.ttl -f JSON @q examples\q1.txt

Evaluate query 1 at DBpedia and SemanticWebDogFood using XML as output format, with folder "test"
> cli -d examples\DBpediaSemanticWebDogFood.ttl -f JSON -folder test @q examples\q1.txt

Evaluate query 3 at DBpedia and Drugbank
> cli -s http://dbpedia.org/sparql -s http://www4.wiwiss.fu-berlin.de/drugbank/sparql @q examples\q2.txt

Evaluate a set of queries at DBpedia and SemanticWebDogFood
> cli -d examples\DBpediaNYTimesLinkedMDB.ttl @q examples\queries.txt

Evaluate the specified query at DBpedia
> cli -s http://dbpedia.org/sparql -q "SELECT ?President WHERE {?President <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/class/yago/PresidentsOfTheUnitedStates> . }"

Evaluate query 1 at DBpedia and SemanticWebDogFood, and apply the specified FedX configuration (prints query plan)
> cli -c examples\fedxConfig.prop -d examples\DBpediaSemanticWebDogFood.ttl @q examples\q1.txt

Evaluate query 1 at DBpedia and SemanticWebDogFood. Data sources specified implicitly using dataConfig setting in FedX configuration and apply the specified fedx configuration (prints query plan)
> cli -c examples\fedxConfig-dataCfg.prop @q examples\q1.txt

Evaluate query 5 at the specified local Sesame NativeStores of DBpedia and NYTimes
> cli -c examples\fedxConfig.prop -d examples\DBpediaNYTimes-local.ttl @q examples\q5.txt
Clone this wiki locally