[ 
https://issues.apache.org/jira/browse/JENA-959?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14577264#comment-14577264
 ] 

Andy Seaborne edited comment on JENA-959 at 6/8/15 2:42 PM:
------------------------------------------------------------

Currently, it is reasonably orthogonal to the format.

The asymmetries are
# {{riot}} -- output is not named where as input is usually.
# {{RDFDataMgr}} takes I/O streams, not file names.

{{RDFLanguages.filenameToLang}} maps file extension to language symbol and it 
handles {{.gz}}.  {{Lang}} themselves don't register compressions i.e. don't 
have a specific file extension of {{.ttl.gz}}. 

Then when reading, {{IO.openFileEx(String)}} has the similar understanding of 
{{.gz}} and it adds the decompressor.

{{IO.openOutputFileEx(String)}} already has the complementary code to 
{{IO.openFileEx(String)}} to add the compressor.

This then all works from {{RDFDataMgr.(read|load)}} and {{model.read}}. The 
command {{riot}} isn't special for input.

Making syntax names work with compression extensions look interesting.  

If {{\--compress}} then {{\--decompress}} for stream in.

Don't forget {{http://.../....gz}} case and decompression (i.e. when the HTTP 
response does not add the decompression step as you GET the compressed file.


was (Author: andy.seaborne):
Currently, it is reasonably orthogonal to the format.

The asymmetries are
# {{riot}} -- output is not named where as input is usually.
# {{RDFDataMgr}} takes I/O streams, not file names.

{{RDFLanguages.filenameToLang}} maps file extension to language symbol and it 
handles {{.gz}}.  {{Lang}} themselves don't register compressions i.e. don't 
have a specific file extension of {{.ttl.gz}}. 

Then when reading, {{IO.openFileEx(String)}} has the similar understanding of 
{{.gz}} and it adds the decompressor.

{{IO.openOutputFileEx(String)}} already has the complementary code to 
{{IO.openFileEx(String)}} to add the compressor.

This then all works from {{RDFDataMgr.(read|load)}} and {{model.read}}. The 
command {{riot}} isn't special for input.

Making syntax names work with compression extensions look interesting.  

If {{--compress}} then {{--decompress}} for stream in.

Don't forget {{http://.../....gz}} case and decompression (i.e. when the HTTP 
response does not add the decompression step as you GET the compressed file.

> riot: gzip output option
> ------------------------
>
>                 Key: JENA-959
>                 URL: https://issues.apache.org/jira/browse/JENA-959
>             Project: Apache Jena
>          Issue Type: New Feature
>          Components: RIOT
>            Reporter: Stian Soiland-Reyes
>            Priority: Trivial
>
> The riot command line tool supports incoming file formats like *.ttl.gz, but 
> there is no (obvious) way to also output in compressed formats.
> This can of course also be achieved with piping and gzip, but that is easily 
> platform-specific. Writing *.format.gz with the command line is probably as 
> much within remit of someone using riot on the command line as for reading 
> those.
> So my suggestion is to support extension .gz in the various --output options 
> to enabled outputting via a GzipOutputStream -- 
> http://docs.oracle.com/javase/7/docs/api/java/util/zip/GZIPOutputStream.html
> For example:
> {code}
> stain@biggie-utopic:~/Downloads$ riot --output=nquads.gz 
> chembl_20.0_target_targetcmpt_ls.ttl.gz 
> Not recognized as an RDF language : 'nquads.gz'
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to