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

Andy Seaborne commented on JENA-632:
------------------------------------

Maybe have two operations: {{QueryExecution.execJson()}} => one {{JsonArray}} 
and also {{QueryExecution.execJsonItems()}} => {{Iterator<JsonValue>}}, one 
iteration per json object generated (one per row of matches to the graph 
pattern).

Both the as JsonArray and as iterator forms have usefulness.

Add to choice to {{SPARQLResult}} (small).

Implement {{QueryExecutionBase.execJson()}}

c.f {{QueryExecution.execConstruct}}, {{QueryExecutionexecConstructTriples}}.

{{JsonWriter}} is the streaming output.  A JsonArray would mean collecting into 
memory then writing the entire JSON structure which is non-streaming.    That 
said, I have found that building the non-streaming version first, get 
everything working ()easier to debug) and going back and replacing with a 
stream writer when all the machinery is working and tested.


> Generate JSON from SPARQL directly.
> -----------------------------------
>
>                 Key: JENA-632
>                 URL: https://issues.apache.org/jira/browse/JENA-632
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: ARQ, Fuseki
>            Reporter: Andy Seaborne
>            Priority: Minor
>              Labels: java, javacc
>
> The capability to generate JSON directly from a SPARQL (or extended SPARQL) 
> query would enable the creation of JSON data API over published linked data.
> This project would cover:
> # Design and publication of a design.
> # Refinement of design based on community feed
> # Implementation, including testing.
> # Refinement of implementation based on community feed
> Skills required: Java, some parser work, design and discussion with the user 
> community, basic understanding of HTTP and content negotiation.



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

Reply via email to