Hi Frans,
There isn't a way for BASE. Models don't carry BASE around with them
like they do for a prefix mapping so while the writer do provide base
support, the data doesn't flow-end-to-end.
There are problems with BASE anyway - it's really for when there are
relative URIs and teh base comes from outside (i.e the place the data is
read from.)
The usual approach is to define prefix ":" to be the URI for the data
for the file.
Andy
On 08/09/16 12:59, Frans Knibbe wrote:
Hi Andy,
Thanks for the help. I have made a file with only prefixes and a command
like the one below works nice:
riot -formatted=ttl prefixes.ttl in.nt > out.ttl
It is a big improvement. Is there perhaps a way to use @base too? If I put
@base in the prefixes.ttl file it seems to be ignored, just like a
specification of the base URI as a command line parameter.
Greetings,
Frans
On 6 September 2016 at 12:01, Andy Seaborne <[email protected]> wrote:
Hi Frans,
See "riot --help" for your version.
https://jena.apache.org/documentation/io/#command-line-tools
Currently:
--output=FMT
Output in the given format, streaming if possible.
--formatted=FMT
Output, using pretty printing (consumes memory)
--stream=FMT
Output, using a streaming format
and make FMT "TTL"
Note that --formatted (the prettiest) has to read all input into memory
before printing begins which can be an issue at large scale, the other
forms don't need this.
To set particular prefixes when the data does provide them, add your own
Turtle file with just prefixes in it.
riot --formatted=TTL myprefixes.ttl data...data 2>/dev/null
Andy
On 06/09/16 10:38, Frans Knibbe wrote:
Hello,
I use riot to convert RDF files to different formats on the command line.
It works well, but I wonder if there is an option to have @base and
@prefix
definitions in the output in turtle format. In many cases that would
result
in more compact files that are easier to read for humans.
I can image riot could identify repeating URI prefixes itself, or perhaps
a
file with @prefix definitions could be supplied as a parameter...
As for @base, I see that there is a parameter --base=URI for riot. But
using it does not seem to give an @base in turtle output.
Greetings,
Frans