The current CLI (v0.3) detects the format of inputs and outputs by file extension. It should be possible to specify the format.
To make this as general as possible, I suggest a -f/--format option that takes the format name as argument (e.g. ntriples), and applies to the next argument. The next argument should be a file: either an input, a context file (with -c), or an output file (with -o). If no output is specified, then the default is STDOUT, in which case the last option can be -f to specify the format for STDOUT.
POSIX command-line options do not usually depend on order, so this might not be a good idea. Unfortunately all the standard alternatives I can think of require a Cartesian product of option flags.
Another non-standard alternative is to append the format to the filename string somehow: foo.txt:ntriples. The problem is then to find a good cross-platform separator.
The current CLI (
v0.3
) detects the format of inputs and outputs by file extension. It should be possible to specify the format.To make this as general as possible, I suggest a
-f
/--format
option that takes the format name as argument (e.g.ntriples
), and applies to the next argument. The next argument should be a file: either an input, a context file (with-c
), or an output file (with-o
). If no output is specified, then the default is STDOUT, in which case the last option can be-f
to specify the format for STDOUT.POSIX command-line options do not usually depend on order, so this might not be a good idea. Unfortunately all the standard alternatives I can think of require a Cartesian product of option flags.
Another non-standard alternative is to append the format to the filename string somehow:
foo.txt:ntriples
. The problem is then to find a good cross-platform separator.