Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
luigi-asprino committed Oct 28, 2024
1 parent 8b0f6a9 commit 1d49e24
Show file tree
Hide file tree
Showing 2 changed files with 68 additions and 64 deletions.
126 changes: 65 additions & 61 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -554,67 +554,71 @@ The jar can be executed as follows:
usage: java -jar sparql.anything-<version> -q query [-f <output format>] [-v
<filepath | name=value> ... ] [-c option=value] [-l path] [-o
filepath]
-q,--query <query> The path to the file storing the
query to execute or the query
itself.
-o,--output <file> OPTIONAL - The path to the output
file. [Default: STDOUT]
-a,--append OPTIONAL - Should output to file be
appended? WARNING: this option does
not ensure that the whole file is
valid -- that is up to the user to
set up the conditions (such as
using NQ serialization and not
using blank nodes)
-e,--explain OPTIONAL - Explain query execution
-l,--load <load> OPTIONAL - The path to one RDF file
or a folder including a set of
files to be loaded. When present,
the data is loaded in memory and
the query executed against it.
-f,--format <string> OPTIONAL - Format of the output
file. Supported values: JSON, XML,
CSV, TEXT, TTL, NT, NQ. [Default:
TEXT or TTL]
-s,--strategy <strategy> OPTIONAL - Strategy for query
evaluation. Possible values: '1' -
triple filtering (default), '0' -
triplify all data. The system
fallbacks to '0' when the strategy
is not implemented yet for the
given resource type.
-p,--output-pattern <outputPattern> OPTIONAL - Output filename pattern,
e.g. 'my-file-?friendName.json'.
Variables should start with '?' and
refer to bindings from the input
file. This option can only be used
in combination with 'input' and is
ignored otherwise. This option
overrides 'output'.
-v,--values <values> OPTIONAL - Values passed as input
parameter to a query template. When
present, the query is pre-processed
by substituting variable names with
the values provided. The argument
can be used in two ways. (1)
Providing a single SPARQL ResultSet
file. In this case, the query is
executed for each set of bindings
in the input result set. Only 1
file is allowed. (2) Named variable
bindings: the argument value must
follow the syntax:
var_name=var_value. The argument
can be passed multiple times and
the query repeated for each set of
values.
-c,--configuration <option=value> OPTIONAL - Configuration to be
passed to the SPARQL Anything
engine (this is equivalent to
define them in the SERVICE IRI).
The argument can be passed multiple
times (one for each option to be
set).
-q,--query <query or URL or filepath> The path or the URL to the file
storing the query to execute or
the query itself.
-o,--output <filepath> OPTIONAL - The path to the output
file. [Default: STDOUT]
-a,--append OPTIONAL - Should output to file
be appended? WARNING: this option
does not ensure that the whole
file is valid -- that is up to
the user to set up the conditions
(such as using NQ serialization
and not using blank nodes)
-e,--explain OPTIONAL - Explain query
execution
-l,--load <load> OPTIONAL - The path to one RDF
file or a folder including a set
of files to be loaded. When
present, the data is loaded in
memory and the query executed
against it.
-f,--format <string> OPTIONAL - Format of the output
file. Supported values: JSON,
XML, CSV, TEXT, TTL, NT, NQ.
[Default: TEXT or TTL]
-s,--strategy <strategy> OPTIONAL - Strategy for query
evaluation. Possible values: '1'
- triple filtering (default), '0'
- triplify all data. The system
fallbacks to '0' when the
strategy is not implemented yet
for the given resource type.
-p,--output-pattern <outputPattern> OPTIONAL - Output filename
pattern, e.g.
'my-file-?friendName.json'.
Variables should start with '?'
and refer to bindings from the
input file. This option can only
be used in combination with
'input' and is ignored otherwise.
This option overrides 'output'.
-v,--values <values> OPTIONAL - Values passed as input
parameter to a query template.
When present, the query is
pre-processed by substituting
variable names with the values
provided. The argument can be
used in two ways. (1) Providing a
single SPARQL ResultSet file. In
this case, the query is executed
for each set of bindings in the
input result set. Only 1 file is
allowed. (2) Named variable
bindings: the argument value must
follow the syntax:
var_name=var_value. The argument
can be passed multiple times and
the query repeated for each set
of values.
-c,--configuration <option=value> OPTIONAL - Configuration to be
passed to the SPARQL Anything
engine (this is equivalent to
define them in the SERVICE IRI).
The argument can be passed
multiple times (one for each
option to be set).
```

Logging can be configured adding the following option (SLF4J).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,11 @@ public String getQuery() throws IOException {
void init(){
this.options = new Options();

options.addOption(Option.builder(QUERY).argName("query").hasArg().required(true)
.desc("The path to the file storing the query to execute or the query itself.").longOpt(QUERY_LONG)
options.addOption(Option.builder(QUERY).argName("query or URL or filepath").hasArg().required(true)
.desc("The path or the URL to the file storing the query to execute or the query itself.").longOpt(QUERY_LONG)
.build());

options.addOption(Option.builder(OUTPUT).argName("file").hasArg()
options.addOption(Option.builder(OUTPUT).argName("filepath").hasArg()
.desc("OPTIONAL - The path to the output file. [Default: STDOUT]").longOpt(OUTPUT_LONG).build());

options.addOption(Option.builder(OUTPUT_APPEND).hasArg(false)
Expand Down

0 comments on commit 1d49e24

Please sign in to comment.