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

ASF GitHub Bot commented on RYA-466:
------------------------------------

Github user ejwhite922 commented on a diff in the pull request:

    https://github.com/apache/incubator-rya/pull/275#discussion_r170336478
  
    --- Diff: 
extras/rya.streams/client/src/main/java/org/apache/rya/streams/client/command/StreamResultsCommand.java
 ---
    @@ -167,17 +182,38 @@ public void run() {
                 throw new ExecutionException("Could not parse the SPARQL for 
the query: " + sparql, e);
             }
     
    -        // Iterate through the results and print them to the console until 
the program or the stream ends.
    -        try (final QueryResultStream<?> stream = 
getQueryResultStream.fromStart(queryId)) {
    -            while(!finished.get()) {
    -                for(final Object result : stream.poll(1000)) {
    -                    System.out.println(result);
    +        // Iterate through the results and print them to the configured 
output mechanism.
    +        try (final QueryResultStream<?> resultsStream = 
getQueryResultStream.fromStart(queryId)) {
    +            final TupleExpr tupleExpr = new 
SPARQLParser().parseQuery(sparql, null).getTupleExpr();
    +            if(params.outputPath != null) {
    +                final Path file = Paths.get(params.outputPath);
    +                try(OutputStream out = Files.newOutputStream(file)) {
    --- End diff --
    
    try(final OutputStream out ...


> Rya Streams Client - Stream results to file.
> --------------------------------------------
>
>                 Key: RYA-466
>                 URL: https://issues.apache.org/jira/browse/RYA-466
>             Project: Rya
>          Issue Type: Improvement
>            Reporter: Kevin Chilton
>            Assignee: Kevin Chilton
>            Priority: Major
>
> The Rya Streams Client's stream results command needs to be updated to allow 
> a user to stream Statement results to an NTriples file and Binding Sets to 
> the standard JSON representation.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to