[ https://issues.apache.org/jira/browse/JENA-632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14321742#comment-14321742 ]
Bruno P. Kinoshita commented on JENA-632: ----------------------------------------- Followed the example of execSelect, and used a ResultSet wrapping the QueryIterator. This way, we were able to reuse existing classes. The resulting JSON is as follows: {noformat} { "head": { "vars": [ "author" , "title" ] } , "results": { "bindings": [ { "author": { "type": "literal" , "value": "J.K. Rowling" } , "title": { "type": "literal" , "value": "Harry Potter and the Order of the Phoenix" } } , { "author": { "type": "literal" , "value": "J.K. Rowling" } , "title": { "type": "literal" , "value": "Harry Potter and the Philosopher's Stone" } } , { "author": { "type": "literal" , "value": "J.K. Rowling" } , "title": { "type": "literal" , "value": "Harry Potter and the Half-Blood Prince" } } , { "author": { "type": "literal" , "value": "J.K. Rowling" } , "title": { "type": "literal" , "value": "Harry Potter and the Deathly Hallows" } } ] } } {noformat} Here are some GitHub links to the mentioned code: New result set - https://github.com/kinow/jena/blob/ae7c50f0f313b7dfa1cd8333fb0072f89e5972c5/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/ResultSetJsonStream.java#L37 The new method that gets called by SPARQL and builds a ResultSetJsonStream - https://github.com/kinow/jena/blob/ae7c50f0f313b7dfa1cd8333fb0072f89e5972c5/jena-arq/src/main/java/com/hp/hpl/jena/sparql/engine/QueryExecutionBase.java#L390 I'm waiting until we have settled down on the API details to start writing tests and documentation. Thanks! > 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)