jena
jena copied to clipboard
arq: multiple input files without repeating --data
Version
4.8.0
Feature
When executing queries with arq
it is possible to provide multiple input files by repeating the --data
option
This is a not shell-friendly, where I would like to glob a path to load multiple sources in one go
arq --query test.rq --data data/*.ttl
To make that work, it would be necessary to allow multiple values of --data
arq --query test.rq --data data/1.ttl data/2.ttl data/3.ttl
Can this be implemented?
Are you interested in contributing a solution yourself?
None
A plain argument is a query string.
arq --query test.rq --data data/1.ttl --data data/2.ttl "SELECT (Count(*) AS ?C) { ?s ?p ?o }"
I see. Some CLI tools allow variadic arguments and if they are not last, they would be delimited by a double dash
-arq --data data/1.ttl --data data/2.ttl "SELECT (Count(*) AS ?C) { ?s ?p ?o }"
+arq --data data/*.ttl -- "SELECT (Count(*) AS ?C) { ?s ?p ?o }"
For example commander lets one author CLIs in that fashion
you could also simply do this with your shell :
datafiles=(data/*.ttl)
arq "${datafiles[@]/#/--data=}" --query etc...