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

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

That output can be obtained currently using "application/sparq-results+json". 
It's OK but I wouldn't describe it as idiomatic JSON.  My mental use cases are 
slurping results up in a browser-based application, or reading from some 
programme that really does not know much about RDF and different types of RDF 
terms.

For {{QueryExecution.execJsonItems}}, how about making the return type 
{{Iterator<JsonObject>}}? The iterator is one element per row e.g.:

{noformat}
{ 
    "author" : "J.K. Rowling" ,
    "title" : "Harry Potter and the Order of the Phoenix"
  }
{noformat}

and that can be turned into output bytes by printing "\[", each object 
(separated by ","), and a "\]".  In fact, there is a stream write for JSON : 
{{JSWriter}} (it's pretty low level : e.g. startArray/finishArray, with each 
array element being startObject/finishObject). 

How does that sound?

> 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