[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-05-09 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on JENA-632:
--

Commit 379c4c69317c89eea00562a761e9da13f1ddd889 in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=379c4c6 ]

JENA-1543: Merge commit 'refs/pull/415/head' of https://github.com/apache/jena

Follows from JENA-632.

This closes #415.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
> Fix For: Jena 3.8.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-05-05 Thread Bruno P. Kinoshita (JIRA)

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

Bruno P. Kinoshita commented on JENA-632:
-

Initial documentation created, marking the issue as resolved, with fix version 
set to 3.8.0.

Menu entry added in the ARQ documentation 
(http://jena.staging.apache.org/documentation/query/index.html), under 
extensions.

http://jena.staging.apache.org/documentation/query/generate-json-from-sparql.html



> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
> Fix For: Jena 3.8.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-05-05 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on JENA-632:
--

Commit 1830955 from [~kinow] in branch 'site/trunk'
[ https://svn.apache.org/r1830955 ]

JENA-632: re-word last paragraph, adding a Linux shell example call

> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
> Fix For: Jena 3.8.0
>
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-05-05 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on JENA-632:
--

Commit 1830954 from [~kinow] in branch 'site/trunk'
[ https://svn.apache.org/r1830954 ]

JENA-632: Initial web site documentation for the new JSON ARQ extension, based 
on the docs for CONSTRUCT QUAD

> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
Branch created: 
[JENA-632-before-merge](https://github.com/kinow/jena/tree/JENA-632-before-merge).
 Won't delete it this year, in case we need to revisit.

Followed that by:

```
$ git rebase -i HEAD~18
$   # fixed-up all but the first commit
$ git diff JENA-632-before-merge 
$   # empty response, code is identical even though different commit tree
$ git checkout master
$ git merge JENA-632-2
$ git commit --amend
$   # added This closes #114 message to close this pull request
$ mvn clean test install -Pdev
$ git push git-at-apache master
```



> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user asfgit closed the pull request at:

https://github.com/apache/jena/pull/114


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-27 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on JENA-632:
--

Commit 4bf5e3c0ad18d61542ce9e37804e8ec727283d96 in jena's branch 
refs/heads/master from [~brunodepau...@yahoo.com.br]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=4bf5e3c ]

JENA-632: Generate JSON from SPARQL directly

This closes #114


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on the issue:

https://github.com/apache/jena/pull/114
  
That works for me.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
:tada: should I proceed with the merging? If so, I will squash the 18 
commits into a single one before, as said before, but with a backup branch 
just-in-case. And then start working on the documentation in order to update 
the ticket in JIRA.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r184646447
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/serializer/QuerySerializer.java 
---
@@ -142,7 +144,19 @@ public void visitAskResultForm(Query query)
 out.print("ASK") ;
 out.newline() ;
 }
-
+
+@Override
+public void visitJsonResultForm(Query query) {
+out.print("JSON {");
+List terms = new ArrayList<>();
+for (Map.Entry entry : 
query.getJsonMapping().entrySet()) {
--- End diff --

Oh, got it! Nice! So no more comments from me :smiley: 


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r184644548
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/serializer/QuerySerializer.java 
---
@@ -142,7 +144,19 @@ public void visitAskResultForm(Query query)
 out.print("ASK") ;
 out.newline() ;
 }
-
+
+@Override
+public void visitJsonResultForm(Query query) {
+out.print("JSON {");
+List terms = new ArrayList<>();
+for (Map.Entry entry : 
query.getJsonMapping().entrySet()) {
--- End diff --

For now, Expressions can be done with `BIND` at the end of the `WHERE` 
pattern.

(`sum` is a group-aggregator -- whole different ball game!)


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r184639752
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/serializer/QuerySerializer.java 
---
@@ -142,7 +144,19 @@ public void visitAskResultForm(Query query)
 out.print("ASK") ;
 out.newline() ;
 }
-
+
+@Override
+public void visitJsonResultForm(Query query) {
+out.print("JSON {");
+List terms = new ArrayList<>();
+for (Map.Entry entry : 
query.getJsonMapping().entrySet()) {
--- End diff --

> Just use incIndent twice!

Haha, I like it. Done!

>Is it ready to merge? Any area to look at specially? I've used qparse on 
JSON queries and run a few test queries with all the cases I can think of.

I think so ! Only minor thing on my mind now are some expressions. We have 
not implemented support for queries with expressions like

`JSON { 'F' : sum(1+2)} WHERE { } `

Or other functions. Perhaps that could - if necessary - be implemented 
later?


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r184631546
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/serializer/QuerySerializer.java 
---
@@ -142,7 +144,19 @@ public void visitAskResultForm(Query query)
 out.print("ASK") ;
 out.newline() ;
 }
-
+
+@Override
+public void visitJsonResultForm(Query query) {
+out.print("JSON {");
+List terms = new ArrayList<>();
+for (Map.Entry entry : 
query.getJsonMapping().entrySet()) {
--- End diff --

Is it ready to merge?  Any area to look at specially? I've used `qparse` on 
JSON queries and run a few test queries with all the cases I can think of.




> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r184631233
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/serializer/QuerySerializer.java 
---
@@ -142,7 +144,19 @@ public void visitAskResultForm(Query query)
 out.print("ASK") ;
 out.newline() ;
 }
-
+
+@Override
+public void visitJsonResultForm(Query query) {
+out.print("JSON {");
+List terms = new ArrayList<>();
+for (Map.Entry entry : 
query.getJsonMapping().entrySet()) {
--- End diff --

Sorry about the patch - I couldn't figure how to clone your repo because GH 
did not like the fact I already had a repo called "jena". Yes, a constant is 
better.  I thought that 4 looked nicer than 2 and it does not get indented 
further.  Just use `incIndent` twice!


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-26 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r184510334
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/serializer/QuerySerializer.java 
---
@@ -142,7 +144,19 @@ public void visitAskResultForm(Query query)
 out.print("ASK") ;
 out.newline() ;
 }
-
+
+@Override
+public void visitJsonResultForm(Query query) {
+out.print("JSON {");
+List terms = new ArrayList<>();
+for (Map.Entry entry : 
query.getJsonMapping().entrySet()) {
--- End diff --

Patch applied! Thanks Andy! TIL learned about that Prologue object.

Regarding the indentation, in `QuerySerializer.java`, there are other 2 
occurrences of `incIndent`/`decIndent`, but instead of using `4`, they use the 
class constant

`static final int BLOCK_INDENT = 2 ;`

Should we use that for JSON as well?

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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-26 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r184509707
  
--- Diff: jena-arq/src/main/java/org/apache/jena/query/Query.java ---
@@ -515,6 +519,18 @@ public void addHavingCondition(Expr expr)
 havingExprs.add(expr) ;
 }
 
+// SELECT JSON
+
+private Map jsonMapping = new LinkedHashMap<>();
--- End diff --

Done!


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-26 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r184495709
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/serializer/QuerySerializer.java 
---
@@ -142,7 +144,19 @@ public void visitAskResultForm(Query query)
 out.print("ASK") ;
 out.newline() ;
 }
-
+
+@Override
+public void visitJsonResultForm(Query query) {
+out.print("JSON {");
+List terms = new ArrayList<>();
+for (Map.Entry entry : 
query.getJsonMapping().entrySet()) {
--- End diff --

Some suggestions for formatting output:

- Use format utils to get pretty forms
- Print JSON vertically so that long templates go down not off the 
right-hand side.

I had to catch the prologue for formatting as it is formatted. Adding a 
"JSON formatter" seems like a very heavy way to do it.

Patch from your JENA-632-2 branch:


[jena-632-2-afs.txt](https://github.com/apache/jena/files/1952543/jena-632-2-afs.txt)



> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-26 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r184478479
  
--- Diff: jena-arq/src/main/java/org/apache/jena/query/Query.java ---
@@ -515,6 +519,18 @@ public void addHavingCondition(Expr expr)
 havingExprs.add(expr) ;
 }
 
+// SELECT JSON
+
+private Map jsonMapping = new LinkedHashMap<>();
--- End diff --

This can be types as `` (variables are Nodes)

private Map jsonMapping = new LinkedHashMap<>();

public void addJsonMapping(String key, Node value) {
jsonMapping.put(key, value);
}

public Map getJsonMapping() {
return Collections.unmodifiableMap(jsonMapping);
}



> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
@afs also removed the `Number()` clause as that was not being used any 
more. Ready for review again :+1: 

And big thanks for all the feedback (and patience!) so far.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-25 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r183974343
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2176,6 +2251,19 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+#ifdef ARQ
+Number Number() : { Token t ; Number number ; }
+{
+  (
+t = < INTEGER > { number = integerValue(t.image) ; }
+  | t = < DECIMAL > { number = doubleValue(t.image) ; }
--- End diff --

@afs nice catch in that observation. Reduced code duplication and avoids 
now possible "forgot to apply to the other part of the json clause" issues in 
the future :-)

Change applied. Rebased, ran all tests, tried three queries mentioned in 
this pull request (we have a few already! :smiley: ), got no issues.

Pushing the latest code, rebased onto the maste branch.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r183786125
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2176,6 +2251,19 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+#ifdef ARQ
+Number Number() : { Token t ; Number number ; }
+{
+  (
+t = < INTEGER > { number = integerValue(t.image) ; }
+  | t = < DECIMAL > { number = doubleValue(t.image) ; }
--- End diff --

Couldn't reply to the number point - I think the rebase has moved things 
around - it now looks right.  Tests will tell!


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-24 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r183785846
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2176,6 +2251,19 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+#ifdef ARQ
+Number Number() : { Token t ; Number number ; }
+{
+  (
+t = < INTEGER > { number = integerValue(t.image) ; }
+  | t = < DECIMAL > { number = doubleValue(t.image) ; }
--- End diff --

Observa
tion: The JSON clause can be DRY-ed with `JsonObjectMember() (  
JsonObjectMember()) *` and put lines 342-355 in `JsonObjectMember`.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-18 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r182394976
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2176,6 +2251,19 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+#ifdef ARQ
+Number Number() : { Token t ; Number number ; }
+{
+  (
+t = < INTEGER > { number = integerValue(t.image) ; }
+  | t = < DECIMAL > { number = doubleValue(t.image) ; }
--- End diff --

Oh! It was by accident that it got fixed I think?

I copied parts of the `SelectClause()` to `JsonClause()`. More 
especifically, the Select had:

```
  // Expressions without ()
  ( LOOKAHEAD(2)
expr = BuiltInCall(){ getQuery().addResultVar((Var)null, 
expr) ; }
  | expr = FunctionCall()   { getQuery().addResultVar((Var)null, 
expr) ; }
  | n = RDFLiteral(){ getQuery().addResultVar((Var)null, 
NodeValue.makeNode(n)) ; }
  | n = NumericLiteral(){ getQuery().addResultVar((Var)null, 
NodeValue.makeNode(n)) ; }
  | n = BooleanLiteral(){ getQuery().addResultVar((Var)null, 
NodeValue.makeNode(n)) ; }
```

Which became the following for the JSON counterpart:

```
o = Var() { getQuery().addResultVar((Var)o) ; 
getQuery().addJsonMapping(s, o) ; }
  | o = RDFLiteral() { getQuery().addResultVar(s, NodeValue.makeNode(o)) ; 
getQuery().addJsonMapping(s, o) ; }
  | o = NumericLiteral() { getQuery().addResultVar(s, 
NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ; }
  | o = BooleanLiteral() { getQuery().addResultVar(s, 
NodeValue.makeNode(o)) ; getQuery().addJsonMapping(s, o) ; }
```

More or less the same. But we have the Var (i.e. for cases like `"title" : 
?title`), and then I did not include the expressions (hence the lookahead 
removed).

Does it make sense @afs ? If so, we can actually remove the `Number()` and 
this whole #if ARQ block. And I believe the code is doing more or less what you 
suggested?

Thanks!
Bruno


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-18 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r182392871
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/serializer/QuerySerializer.java 
---
@@ -142,7 +144,19 @@ public void visitAskResultForm(Query query)
 out.print("ASK") ;
 out.newline() ;
 }
-
+
+@Override
+public void visitJsonResultForm(Query query) {
+out.print("JSON {");
--- End diff --

>JSON { "s": "FOO" } becomes JSON { "s": FOO }

Shouldn't it be

```
JSON { "s": "FOO" } becomes JSON { "s": "FOO" } // last FOO still with 
double quotes / a string?
```


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-18 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
Rebase'd against master. Added `TestJsonEval.java`, with a couple more 
tests. Then understood why the projected variables were not working.

Updated the grammar to call the method that populates the `projectedVars` 
collection. Now queries like `JSON { 'F' : 'string' } WHERE { }` resolve to `[ 
{ 'F' : 'string' } ]`.

Still need to work around the other comment about `Double`s.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-04-18 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r182390129
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -326,6 +361,46 @@ void AskQuery() : {}
   SolutionModifier()
 }
 
+#ifdef ARQ
+void JsonQuery() : {}
+{
+  JsonClause()
+  ( DatasetClause() )*
+  WhereClause()
+  SolutionModifier()
+}
+
+void JsonClause() : { Object o ; String s ; Token t; }
+{
+   { getQuery().setQueryJsonType() ; }
+  
+  s = String()
+  // PNAME_NS would eval true before COLON (default namescape) so we make 
sure we got what we were expecting
+  t = < PNAME_NS > {
+if ( ! t.image.equals(":") )
+  throwParseException("Prefix name expression not legal at this point 
: "+t.image, t.beginLine, t.beginColumn) ;
+  }
+  (
+o = Var() { getQuery().addResultVar((Var) o) ; 
getQuery().addJsonMapping(s, o) ; }
+  | o = String() { getQuery().addJsonMapping(s, o) ; }
+  | o = Number() { getQuery().addJsonMapping(s, o) ; }
+  )
+  (
+ s = String()
+t = < PNAME_NS > {
+  if ( ! t.image.equals(":") )
+throwParseException("Prefix name expression not legal at this 
point : "+t.image, t.beginLine, t.beginColumn) ;
+}
+(
+  o = Var() { getQuery().addResultVar((Var) o) ; 
getQuery().addJsonMapping(s, o) ; }
+| o = String() { getQuery().addJsonMapping(s, o) ; }
+| o = Number() { getQuery().addJsonMapping(s, o) ; }
+)
--- End diff --

Good idea! Using your TestJsonEval.java as base, and doing a quick change 
in the master.jj and grammars, to support it.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r176029548
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2176,6 +2251,19 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+#ifdef ARQ
+Number Number() : { Token t ; Number number ; }
+{
+  (
+t = < INTEGER > { number = integerValue(t.image) ; }
+  | t = < DECIMAL > { number = doubleValue(t.image) ; }
--- End diff --

Would this be simpler? 

Generate `Node` from the parser, 
The data  structure is then `Map jsonMapping`.
To use, lookup variables in the binding to get a `Node` and also use the 
`Node`s from `jsonMapping`.

In the grammar, use `NumericLiteral() | BooleanLiteral()`, which return 
`Node`, then the sign of numbers is also handled.  as well as booleans. When 
needing the item for making the JSON, apply `RDFTerm2Json`, as is done when a 
variable is used and turned into a Json value.

There isn't a standard alone string rule returning a `Node`. The `String()` 
returns a string (it is used to make a RDF Literal, optional ^^ and @ parts) - 
to unify handling turn the string into a `Node` with 
`NodeFactory.createLiteral(t.image)`.



> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-21 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175998281
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2176,6 +2251,19 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+#ifdef ARQ
+Number Number() : { Token t ; Number number ; }
+{
+  (
+t = < INTEGER > { number = integerValue(t.image) ; }
+  | t = < DECIMAL > { number = doubleValue(t.image) ; }
--- End diff --

Oh, no reason at all. Just forgot about it I think. Re-reading that method, 
I almost feel like removing the number parameter, and just replacing by `return 
integetValue(t.image);` etc. But will just add the `< DOUBLE >` for now :-)


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on the issue:

https://github.com/apache/jena/pull/114
  
If it does not make the release then - whatever! - there'll be another 
along soon!

I may be able to do some work on it after the release. I think I now 
understand it better and it makes a useful contribution to developing 
applications that want JSON simply.

Have fun in Japan!



> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on the issue:

https://github.com/apache/jena/pull/114
  
Eval tests: https://gist.github.com/afs/9e57b705a0d53889606346f6723238ce

Framework : needs more tests!


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
@afs had a quick look at your gist and it looks good! I won't be able to 
have a proper look at it and to commit for the next ~8 hours. But feel free to 
commit to this branch and update the pull request too if you prefer :-)


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
And only started working again on this because you bumped this PR @ajs6f 
:-) learning a lot working on this ticket, and with JENA-1488, hope to start 
contributing back to Jena more now.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
Will apply some of the changes tonight. But I'm afraid I may not be able to 
fix the serialization issues before this weekend when there might be a new 
release. This weekend I'll be in Japan for some weeks, so may have to complete 
working on the other comments by mid-April  


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on the issue:

https://github.com/apache/jena/pull/114
  
Syntax tests: https://gist.github.com/afs/e069478ec6839267256b9eacd30aa2c4


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175923999
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -99,7 +99,42 @@ import org.apache.jena.sparql.core.Quad ;
 #endif
 
 public class CLASS extends PARSERBASE
-{}
+{
+boolean allowAggregatesInExpressions = false ;
+#ifdef ARQ
--- End diff --

Consider it done. I'll copy it to a GitHub gist in case I need to test 
grammars again (not only in Jena... I believe I actually got it from some 
StackOverflow answer).


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175923748
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/engine/JsonIterator.java ---
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.engine;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+import org.apache.jena.atlas.json.JsonObject;
+import org.apache.jena.atlas.json.JsonValue;
+import org.apache.jena.atlas.lib.Closeable;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.lib.RDFTerm2Json;
+
+/** A JSON iterator for JsonObject's, that wraps a QueryIterator, and a 
list
+ * of result variables.
+ */
+public class JsonIterator implements Iterator
+{
--- End diff --

Okeydokey @afs I noticed new classes are getting the new formatting 
applied, but wasn't sure about changing it in this PR or leaving as it was. 
This change started somewhere in 2015, so lots of old code formatting here.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175923550
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/engine/http/QueryEngineHTTP.java 
---
@@ -532,6 +535,18 @@ else if ( 
actualContentType.equals(WebContent.contentTypeJSON))
 }
 }
 
+@Override
+public JsonArray execJson()
+{
+throw new NotImplementedException("JSON queries not implemented 
for remote calls") ;
--- End diff --

Coincidentally, I noticed this [lang] class here too yesterday, and was 
going to replace by that Atlas class... but first I searched other occurrences, 
and I think somewhere in a sparql module it was being used too. So I thought it 
was OK. Happy to replace this one by the atlas module class. Consider it done 
in some hours.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175922851
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -99,7 +99,42 @@ import org.apache.jena.sparql.core.Quad ;
 #endif
 
 public class CLASS extends PARSERBASE
-{}
+{
+boolean allowAggregatesInExpressions = false ;
--- End diff --

Most likely. Will remove tonight.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175918594
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/engine/JsonIterator.java ---
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.engine;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+import org.apache.jena.atlas.json.JsonObject;
+import org.apache.jena.atlas.json.JsonValue;
+import org.apache.jena.atlas.lib.Closeable;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.lib.RDFTerm2Json;
+
+/** A JSON iterator for JsonObject's, that wraps a QueryIterator, and a 
list
+ * of result variables.
+ */
+public class JsonIterator implements Iterator
+{
--- End diff --

I've been planning to offer a low-interruption plan for some large-scale 
reformatting later this spring, so no harm in leaving this.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175910160
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2176,6 +2251,19 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+#ifdef ARQ
+Number Number() : { Token t ; Number number ; }
+{
+  (
+t = < INTEGER > { number = integerValue(t.image) ; }
+  | t = < DECIMAL > { number = doubleValue(t.image) ; }
--- End diff --

Any reason to exclude doubles?


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175906815
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -99,7 +99,42 @@ import org.apache.jena.sparql.core.Quad ;
 #endif
 
 public class CLASS extends PARSERBASE
-{}
+{
+boolean allowAggregatesInExpressions = false ;
+#ifdef ARQ
--- End diff --

Please remove "main".


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175915508
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/serializer/QuerySerializer.java 
---
@@ -142,7 +144,19 @@ public void visitAskResultForm(Query query)
 out.print("ASK") ;
 out.newline() ;
 }
-
+
+@Override
+public void visitJsonResultForm(Query query) {
+out.print("JSON {");
--- End diff --

More test suggestions: `testParse("JSON { "s": "FOO" , "p" : ?p , "o" : ?o 
} WHERE { }")` to parse to Q, serialize, reparse to Q2 and check Q.equals(Q2).

e.g.a new `org.apache.jena.sparql.syntax.TestJSONParsing`

`JSON { "s": "FOO" }` becomes `JSON { "s": FOO }`


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175909873
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -326,6 +361,46 @@ void AskQuery() : {}
   SolutionModifier()
 }
 
+#ifdef ARQ
+void JsonQuery() : {}
+{
+  JsonClause()
+  ( DatasetClause() )*
+  WhereClause()
+  SolutionModifier()
+}
+
+void JsonClause() : { Object o ; String s ; Token t; }
+{
+   { getQuery().setQueryJsonType() ; }
+  
+  s = String()
+  // PNAME_NS would eval true before COLON (default namescape) so we make 
sure we got what we were expecting
+  t = < PNAME_NS > {
+if ( ! t.image.equals(":") )
+  throwParseException("Prefix name expression not legal at this point 
: "+t.image, t.beginLine, t.beginColumn) ;
+  }
+  (
+o = Var() { getQuery().addResultVar((Var) o) ; 
getQuery().addJsonMapping(s, o) ; }
+  | o = String() { getQuery().addJsonMapping(s, o) ; }
+  | o = Number() { getQuery().addJsonMapping(s, o) ; }
+  )
+  (
+ s = String()
+t = < PNAME_NS > {
+  if ( ! t.image.equals(":") )
+throwParseException("Prefix name expression not legal at this 
point : "+t.image, t.beginLine, t.beginColumn) ;
+}
+(
+  o = Var() { getQuery().addResultVar((Var) o) ; 
getQuery().addJsonMapping(s, o) ; }
+| o = String() { getQuery().addJsonMapping(s, o) ; }
+| o = Number() { getQuery().addJsonMapping(s, o) ; }
+)
--- End diff --

Does not cover URIs, booleans or JSON null.

I tried `JSON { "F": "string" } WHERE {}` but got `[ {} ]` (one element, no 
object fields) - which does not look right to me.

A bunch of tests calling a common function like `test(String query, String 
jsonResult)` would help. e.g.

@Test public void json_query_01() { test("JSON { 'F': 'string' } WHERE 
{}", "{ [ 'F' : 'string ] }" ; }

`JsonValue` supports structural `.equals`.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175911878
  
--- Diff: jena-arq/src/main/java/org/apache/jena/query/Query.java ---
@@ -515,6 +519,14 @@ public void addHavingCondition(Expr expr)
 havingExprs.add(expr) ;
 }
 
+// SELECT JSON
+
+public Map jsonMapping = new LinkedHashMap<>();
--- End diff --

Preference - don't expose data structures which can be modified. Either 
return a copy (if it is not called repeatedly) or with a 
`Collections.unmodifiableMap` wrapper.



> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175913506
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/engine/http/QueryEngineHTTP.java 
---
@@ -532,6 +535,18 @@ else if ( 
actualContentType.equals(WebContent.contentTypeJSON))
 }
 }
 
+@Override
+public JsonArray execJson()
+{
+throw new NotImplementedException("JSON queries not implemented 
for remote calls") ;
--- End diff --

Minor: for better or worse, we have 
`org.apache.jena.atlas.lib.NotImplemented`.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175914165
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/serializer/QuerySerializer.java 
---
@@ -142,7 +144,19 @@ public void visitAskResultForm(Query query)
 out.print("ASK") ;
 out.newline() ;
 }
-
+
+@Override
+public void visitJsonResultForm(Query query) {
+out.print("JSON {");
--- End diff --

The `qparse` tool uses serialization (and it parses the result back again).


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175912074
  
--- Diff: jena-arq/src/main/java/org/apache/jena/query/Query.java ---
@@ -515,6 +519,14 @@ public void addHavingCondition(Expr expr)
 havingExprs.add(expr) ;
 }
 
+// SELECT JSON
+
+public Map jsonMapping = new LinkedHashMap<>();
--- End diff --

I can't find any use of `jsonMapping` except serialization which would 
explain the lack of fields noted above.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175915889
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/syntax/syntaxtransform/QueryTransformOps.java
 ---
@@ -217,6 +217,11 @@ public void visitAskResultForm(Query query) {
 newQuery.setQueryAskType();
--- End diff --

Transforming `JSON { ... }` can be left for another ticket.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175910819
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -99,7 +99,42 @@ import org.apache.jena.sparql.core.Quad ;
 #endif
 
 public class CLASS extends PARSERBASE
-{}
+{
+boolean allowAggregatesInExpressions = false ;
--- End diff --

This is not in master.jj nowadays. Is this from the early forking?


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175912825
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/engine/JsonIterator.java ---
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.engine;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+import org.apache.jena.atlas.json.JsonObject;
+import org.apache.jena.atlas.json.JsonValue;
+import org.apache.jena.atlas.lib.Closeable;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.lib.RDFTerm2Json;
+
+/** A JSON iterator for JsonObject's, that wraps a QueryIterator, and a 
list
+ * of result variables.
+ */
+public class JsonIterator implements Iterator
+{
--- End diff --

Feel free to reformat int same like `{` and no space before `;`.

(yes - a lot of code is not formatted but we seem to be heading that way).

Or leave for now and we can clean up new classes after merging.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
Replied @afs `s last comment, and also rebased the code. Even though it's 
rebased, there's quite a few commits... let me know if I should squash the 
commits or if it's preferable to leave the commit history :-) ready to review, 
take 3?


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175680295
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/query/ResultSetFormatter.java ---
@@ -516,6 +520,41 @@ static public void outputAsJSON(boolean booleanResult)
 static public void outputAsJSON(OutputStream outStream, boolean 
booleanResult)
 { output(outStream, booleanResult, SPARQLResultSetJSON) ; }
 
+/** Output an iterator of JSON values.
+*
+* @param outStream output stream
+* @param jsonItems The JSON values
+*/
+   public static void outputAsJSON(OutputStream outStream, 
Iterator jsonItems)
+   {
+   JSWriter jWriter = new JSWriter(outStream) ;
+   jWriter.startArray() ;
+   jWriter.startOutput() ;
+   while (jsonItems.hasNext()) 
+   {
+   jWriter.startObject() ;
+   JsonObject jsonItem = jsonItems.next() ;
+   for (Entry entry: jsonItem.entrySet()) 
+   {
+   JsonValue value = entry.getValue() ;
+   String val = "";
+   if (value.isString()) {
--- End diff --

>"outputAsJSON" is a bit confusing because the other functions of the same 
name produce SPARQL results in JSON. How about "output"?

Sounds good to me. Done!

>In the code, numbers still come out as strings.

Oh, d'oh me! You raised the issue, I updated the code but not the part that 
writes it back to the user. And even added a test that was testing it was 
getting "123" and "true" in the output. Fixed the test, and thanks heaps for 
the code snippet! Otherwise I'd be scratching my head and thinking how to use 
JSWriter.

Updated, and uploaded the data below

```
@prefix :   .

:s :p 123 .
:s :p "abc" .
:s :p "def"@en .
```

Then queried `JSON { "s": ?s , "p": ?p , "o" : ?o } WHERE { ?s ?p ?o }`. 
Screen shot below with the `123` value - hopefully - correctly displayed! 
:man_dancing: :tada: 


![screenshot_2018-03-20_21-02-30](https://user-images.githubusercontent.com/304786/37642710-116538c6-2c83-11e8-95e4-d14a28e57a5a.png)



> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-19 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175409690
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/query/ResultSetFormatter.java ---
@@ -516,6 +520,41 @@ static public void outputAsJSON(boolean booleanResult)
 static public void outputAsJSON(OutputStream outStream, boolean 
booleanResult)
 { output(outStream, booleanResult, SPARQLResultSetJSON) ; }
 
+/** Output an iterator of JSON values.
+*
+* @param outStream output stream
+* @param jsonItems The JSON values
+*/
+   public static void outputAsJSON(OutputStream outStream, 
Iterator jsonItems)
+   {
+   JSWriter jWriter = new JSWriter(outStream) ;
+   jWriter.startArray() ;
+   jWriter.startOutput() ;
+   while (jsonItems.hasNext()) 
+   {
+   jWriter.startObject() ;
+   JsonObject jsonItem = jsonItems.next() ;
+   for (Entry entry: jsonItem.entrySet()) 
+   {
+   JsonValue value = entry.getValue() ;
+   String val = "";
+   if (value.isString()) {
--- End diff --

"outputAsJSON" is a bit confusing because the other functions of the same 
name produce SPARQL results in JSON.  How about "output"?

In the code, numbers still come out as strings.

JSWriter seems to be only good for its current usage. The code below seems 
to work: it manages the outer array itself and uses `JsonValue.output` to write 
each item.

```
 public static void outputAsJSON(OutputStream outStream, 
Iterator jsonItems)
{
IndentedWriter out = new IndentedWriter(outStream);
out.println("[");
out.incIndent();

while (jsonItems.hasNext()) {
JsonObject jsonItem = jsonItems.next() ;
jsonItem.output(out);
if ( jsonItems.hasNext() )
out.println(" ,");
else
out.println();
}
out.decIndent();
out.println("]");
out.flush();
}
```   


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  

![screenshot_2018-03-17_00-18-10](https://user-images.githubusercontent.com/304786/37518419-ec3b0fb4-2979-11e8-8c70-32666946d00b.png)

![screenshot_2018-03-17_00-17-44](https://user-images.githubusercontent.com/304786/37518420-ec66f156-2979-11e8-8c9a-3da6acaefac8.png)

Screenshots of Fuseki running some JSON queries. Everything seems to be 
working fine :tada: ready for review, take 2 ! 


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175060320
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/engine/JsonIterator.java ---
@@ -0,0 +1,100 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.jena.sparql.engine;
+
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.NoSuchElementException;
+
+import org.apache.jena.atlas.json.JsonObject;
+import org.apache.jena.atlas.json.JsonValue;
+import org.apache.jena.atlas.lib.Closeable;
+
+import org.apache.jena.graph.Node;
+import org.apache.jena.sparql.core.Var;
+import org.apache.jena.sparql.engine.binding.Binding;
+import org.apache.jena.sparql.lib.RDFTerm2Json;
+
+/** A JSON iterator for JsonObject's, that wraps a QueryIterator, and a 
list
+ * of result variables.
+ */
+public class JsonIterator implements Iterator
+{
+
+private final QueryIterator queryIterator ;
+private final List resultVars ;
+
+public JsonIterator(QueryIterator queryIterator, List 
resultVars)
+{
+this.queryIterator = queryIterator ;
+this.resultVars = Collections.unmodifiableList(resultVars) ;
+}
+
+@Override
+public boolean hasNext()
+{
+if (queryIterator == null)
+return false;
+boolean r = queryIterator.hasNext() ;
+if (!r)
+close() ;
+return r ;
+}
+
+@Override
+public JsonObject next()
+{
+if (queryIterator == null)
+throw new NoSuchElementException(this.getClass() + ".next") ;
+try
+{
+Binding binding = queryIterator.next() ;
+JsonObject jsonObject = new JsonObject() ;
+for (String resultVar : resultVars)
+{
+Node n = binding.get(Var.alloc(resultVar)) ;
+JsonValue value = RDFTerm2Json.fromNode(n) ;
--- End diff --

@afs updated the code where I mentioned before...


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175060216
  
--- Diff: jena-arq/src/main/java/org/apache/jena/query/Query.java ---
@@ -707,6 +719,8 @@ public void visit(QueryVisitor visitor)
 visitor.visitDescribeResultForm(this) ;
 if ( this.isAskType() )
 visitor.visitAskResultForm(this) ;
+if ( this.isJsonType() )
--- End diff --

@afs added this one in order to be able to use the `Query` object in some 
tests...


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175061201
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/query/ResultSetFormatter.java ---
@@ -516,6 +520,41 @@ static public void outputAsJSON(boolean booleanResult)
 static public void outputAsJSON(OutputStream outStream, boolean 
booleanResult)
 { output(outStream, booleanResult, SPARQLResultSetJSON) ; }
 
+/** Output an iterator of JSON values.
+*
+* @param outStream output stream
+* @param jsonItems The JSON values
+*/
+   public static void outputAsJSON(OutputStream outStream, 
Iterator jsonItems)
+   {
+   JSWriter jWriter = new JSWriter(outStream) ;
+   jWriter.startArray() ;
+   jWriter.startOutput() ;
+   while (jsonItems.hasNext()) 
+   {
+   jWriter.startObject() ;
+   JsonObject jsonItem = jsonItems.next() ;
+   for (Entry entry: jsonItem.entrySet()) 
+   {
+   JsonValue value = entry.getValue() ;
+   String val = "";
+   if (value.isString()) {
--- End diff --

@afs but here I didn't have a `Node`, only the `JsonValue`, and had to 
convert from `JsonValue` to `String`


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175060362
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/engine/QueryExecutionBase.java ---
@@ -335,7 +340,45 @@ public boolean execAsk() {
 }
 
 @Override
-public void setTimeout(long timeout, TimeUnit timeUnit) {
+public JsonArray execJson()
+{
+checkNotClosed() ;
+if ( ! query.isJsonType() )
+throw new QueryExecException("Attempt to get a JSON result 
from a " + labelForQuery(query)+" query") ;
+
+startQueryIterator() ;
+
+JsonArray jsonArray = new JsonArray() ;
+List resultVars = query.getResultVars() ;
+
+while (queryIterator.hasNext())
+{
+Binding binding = queryIterator.next() ;
+JsonObject jsonObject = new JsonObject() ; 
+for (String resultVar : resultVars) {
+Node n = binding.get(Var.alloc(resultVar)) ;
+JsonValue value = RDFTerm2Json.fromNode(n) ;
--- End diff --

@afs and here


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-16 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r175060592
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/serializer/QuerySerializer.java 
---
@@ -142,7 +144,19 @@ public void visitAskResultForm(Query query)
 out.print("ASK") ;
 out.newline() ;
 }
-
+
+@Override
+public void visitJsonResultForm(Query query) {
+out.print("JSON {");
--- End diff --

This is used only when we create the `Query` manually. Only 
developers/advanced users might be interested in using it. The results via HTTP 
are not serialized this way.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-15 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on the issue:

https://github.com/apache/jena/pull/114
  
Great timing! but as ever, it it makes it, it makes it, and if it doesn't, 
it doesn't.

(I will not be able to build 3.7.0 until next week anyway.)

PR #383 merged.



> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-15 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
Most of the tests are done, just need to add at least basic coverage for 
the SPARQL changes. Then will spend some minutes playing with the queries in 
Fuseki, before updating the PR. Aiming to push the changes Friday night NZ 
time, or this weekend.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

GitHub user afs opened a pull request:

https://github.com/apache/jena/pull/383

JENA-632: Conversion of Nodes to JsonValues.



You can merge this pull request into a Git repository by running:

$ git pull https://github.com/afs/jena node2json

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/jena/pull/383.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #383


commit 2dd4418a2271e980511bbd6382c37f5130aa6e3a
Author: Andy Seaborne 
Date:   2018-03-13T17:01:52Z

Towards JENA-632: Conversion of Nodes to JsonValues.




> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-14 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on JENA-632:
--

Commit 2dd4418a2271e980511bbd6382c37f5130aa6e3a in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=2dd4418 ]

Towards JENA-632: Conversion of Nodes to JsonValues.

> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-14 Thread ASF subversion and git services (JIRA)

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

ASF subversion and git services commented on JENA-632:
--

Commit b1e89b2fd723b74b0f0160fbbf1a1acd44a44f8a in jena's branch 
refs/heads/master from [~andy.seaborne]
[ https://git-wip-us.apache.org/repos/asf?p=jena.git;h=b1e89b2 ]

JENA-632: Merge commit 'refs/pull/383/head' of https://github.com/apache/jena

This closes #383.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user asfgit closed the pull request at:

https://github.com/apache/jena/pull/383


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on the issue:

https://github.com/apache/jena/pull/114
  
PR #383 - we can still change it based on experience.

BTW The grammar accepts the JSON field names in single quotes to make 
embedding in strings easier. It's a STRING1, either one `"` or one `'` 
delimiting (not mixed!).

I doubt it will need many tests.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
FWIW, the output of the second test right now is

```
{ 
  "s" : "s" ,
  "p" : "" ,
  "o" : "def@en"
}
{ 
  "s" : "s" ,
  "p" : "" ,
  "o" : "abc"
}
{ 
  "s" : "s" ,
  "p" : "" ,
  "o" : "123^^http://www.w3.org/2001/XMLSchema#decimal;
}

```

@afs are you planning to send another PR when the draft is ready (it looks 
good to me as-is now :-) ) or would you prefer to include in this PR and 
Jena-632? It does seem to be related with/necessary for JENA-632. Happy to get 
updates to this branch :-)


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-14 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
+1 for the current draft

I would use it 
[here](https://github.com/kinow/jena/blob/a948f300fb40701e49e83db9d03e5d83da8145f6/jena-arq/src/main/java/org/apache/jena/sparql/engine/QueryExecutionBase.java#L358
 and 
[here](https://github.com/kinow/jena/blob/a948f300fb40701e49e83db9d03e5d83da8145f6/jena-arq/src/main/java/org/apache/jena/sparql/engine/JsonIterator.java#L71).

This way instead of looking only at the literals, we'd have the output from 
the table above.

So far I have just two unit tests in my working copy

```java
@Test public void testExecJson() {
// JENA-632
Query query = QueryFactory.create("JSON { \"s\": ?s , \"p\": ?p , 
\"o\" : ?o } "
+ "WHERE { ?s ?p ?o }", Syntax.syntaxARQ);

try ( QueryExecution qexec = QueryExecutionFactory.create(query, m) 
) {
JsonArray jsonArray = qexec.execJson();
assertNotNull( jsonArray );
assertEquals(3, jsonArray.size());
}
}

@Test public void testExecJsonItems() {
// JENA-632
Model model = ModelFactory.createDefaultModel();
{
Resource r = model.createResource(AnonId.create("s"));
Property p = model.getProperty("");
RDFNode node = ResourceFactory.createTypedLiteral("123", 
XSDDatatype.XSDdecimal);
model.add(r, p, node);
r = model.createResource(AnonId.create("s"));
p = model.getProperty("");
node = ResourceFactory.createTypedLiteral("abc", 
XSDDatatype.XSDstring);
model.add(r, p, node);
r = model.createResource(AnonId.create("s"));
p = model.getProperty("");
node = ResourceFactory.createLangLiteral("def", "en");
model.add(r, p, node);
}
Query query = QueryFactory.create("JSON { \"s\": ?s , \"p\": ?p , 
\"o\" : ?o } "
+ "WHERE { ?s ?p ?o }", Syntax.syntaxARQ);

try ( QueryExecution qexec = QueryExecutionFactory.create(query, 
model) ) {
Iterator execJsonItems = qexec.execJsonItems();
while(execJsonItems.hasNext()) {
JsonObject next = execJsonItems.next();
System.out.println(next);
}
}
```

Where the second test is doing - more or less - the same example you 
provided in your previous comment. Once we have the conversion in place, I will 
update it to confirm I get what's expected.

Then after that I was thinking about quickly running with jacoco to see how 
much of this PR is being 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on the issue:

https://github.com/apache/jena/pull/114
  
Conversion code (draft): 2dd4418a22 (on a branch in my GH at the moment).

The code is in `RDFTerm2Json.fromNode`.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-12 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
Going to check how to get the correct values with JSON. Great catch, as I 
was using just Strings. But shouldn't be too hard.

Will also include the initial tests with the next changes, covering both 
previous features, and the conversion from the table you provided :-)

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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-12 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on the issue:

https://github.com/apache/jena/pull/114
  
Tests?


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-09 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
Done, and ready for review again.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-09 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
Rebased!

Tested the `ARQParser` main method (which is added here, but I find very 
handy for quickly testing it, but happy to remove if others prefer). And got 
the following:

```
Enter input: JSON { "name": ?name } WHERE { ?name ?a ?b } LIMIT 3


log4j:WARN No appenders could be found for logger (Jena).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for 
more info.
Parsed query successfully!
---

Enter input: 
```

Then did a `mvn install -DskipTests -Pdev`, and copied 
`apache-jena-fuseki-3.7.0-SNAPSHOT.tar.gz` elsewhere. Unpacked it, and started 
`fuseki-server`.

Used an in-memory dataset in Fuseki2, loading the `books.ttl` example 
shipped with Jena code.

Finally, used the query found in the JIRA ticket to retrieve the JSON 
result:

```
PREFIX purl: 
PREFIX w3:  
PREFIX :  

JSON {
"author": ?author, 
"title": ?title 
}
WHERE 
{
?book purl:creator ?author .
?book purl:title ?title . 
FILTER (?author = 'J.K. Rowling')
}
```
And here's the output:

```
[ { 
  "author" : "J.K. Rowling" ,
  "title" : "Harry Potter and the Deathly Hallows"
}
{ 
  "author" : "J.K. Rowling" ,
  "title" : "Harry Potter and the Philosopher's Stone"
}
{ 
  "author" : "J.K. Rowling" ,
  "title" : "Harry Potter and the Order of the Phoenix"
}
{ 
  "author" : "J.K. Rowling" ,
  "title" : "Harry Potter and the Half-Blood Prince"
}
 ]
```

Going to push-force onto this branch now, so the pull request should be 
rebased onto the latest changes in a couple minutes.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-09 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
Rebasing again, now manually, testing in Eclipse. Previous branch before 
the GitHub rebase archived at https://github.com/kinow/jena/tree/JENA-632-3


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-09 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
Rebased using GitHub's interface :tada:  (never used it before, hope didn't 
make any silly mistakes :-) ).

Good points @afs ! I noticed the existing SPARQL to JSON result writers, so 
adjusted a bit the code to use that.

Now when I try to rebase against the master branch I get a bunch of 
conflicts, but GitHub web interface seems to indicate it's all good. I was 
trying to find a simple way to rebase it, but if I can't fix the conflicts and 
compile & test it, I'll just revert to what was before and then just manually 
rebase :)


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-08 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on the issue:

https://github.com/apache/jena/pull/114
  
The JSON ecosystem moves fast! GraphQL is now significant and how that 
might be used is also very interesting. There are different ways to use GraphQL 
and maybe it is not the solution to all needs anyway - this ticket is more 
about result sets in easy-to-consume JSON than other work in the GraphQL-RDF 
area and more about JSON services.

To move this ticket forward, how about putting the feature in with a big 
label saying "Experimental - subject to change" and _really_ mean it?  By 
getting it out, it generates feedback, requirements and insight. 

You can ask for result sets in JSON but the JSON 
(http://www.w3.org/TR/sparql11-results-json/) or JSON-LD graphs but that isn't 
what general data consumers would consider to be "easy-to-consume".

Is the RDF literal to JSON aligned with:
[RDF-JS 
mapping](http://jena.staging.apache.org/documentation/query/javascript-functions.html#arguments-and-function-results)?
 (which only came along recently).


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-07 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
Hey @ajs6f , I think so. My weak memory seems to tell me that the last time 
I did that... shortly after, there was some work on JSON (JSON-LD? Or maybe 
pure JSON) somewhere else in Jena; and when I saw that happening, I wondered if 
that would perhaps be a replacement for the functionality in this ticket.

I wonder if you or @afs would be able to confirm that there isn't already 
another way to get JSON responses in Jena, and that this feature is still a 
nice to have feature, please?  :)


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2018-03-06 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user ajs6f commented on the issue:

https://github.com/apache/jena/pull/114
  
Hey, @kinow , is this ready for rebase and review? I can try rebasing it 
into a separate PR, or you can if you have time... then (hopefully) we can get 
it in!


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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
(v7.6.3#76005)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2017-05-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user tommals commented on the issue:

https://github.com/apache/jena/pull/114
  
Relevant to this thread [Return nested JSON 
results](https://mail-archives.apache.org/mod_mbox/jena-users/201705.mbox/%3Ctrinity-2c35f052-b0a8-4b53-aa95-9963ff11a7a6-1494243601102%403capp-mailcom-lxa06%3E)


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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.15#6346)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2017-05-13 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user defret5y6u7yhfgtdrfe commented on the issue:

https://github.com/apache/jena/pull/114
  
Relevant to this thread: [Return nested JSON 
results])https://mail-archives.apache.org/mod_mbox/jena-users/201705.mbox/%3Ctrinity-2c35f052-b0a8-4b53-aa95-9963ff11a7a6-1494243601102%403capp-mailcom-lxa06%3E)


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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.15#6346)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2017-03-31 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r109147739
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -100,6 +100,38 @@ import org.apache.jena.sparql.core.Quad ;
 public class CLASS extends PARSERBASE
--- End diff --

Done. First executed jj2tokens, compared the output (digressing: IRIRef 
seems to have been updated I guess) and added the missing JSON token.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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.15#6346)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2017-03-31 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r109143318
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -327,6 +359,35 @@ void AskQuery() : {}
   SolutionModifier()
 }
 
+void JsonQuery() : {}
+{
+  JsonClause()
+  ( DatasetClause() )*
+  WhereClause()
+  SolutionModifier()
+}
+
+void JsonClause() : { Object o ; String s ; }
+{
+   { getQuery().setQueryJsonType() ; }
+  
+  s = String() < PNAME_NS >
+  (
--- End diff --

Replying to my previous comment. The reason why we are not using COLON, is 
that we get this error:

```
[2017-04-01 00:44:24] Fuseki INFO  [1] Query = JSON { "name" : ?name } 
WHERE { ?name ?a ?b } LIMIT 2
[2017-04-01 00:44:24] Fuseki INFO  [1] 400 Parse error: 
JSON { "name" : ?name } WHERE { ?name ?a ?b } LIMIT 2

Encountered "  ": "" at line 1, column 15.
Was expecting:
":" ...
 (27 ms)
```

The PNAME_NS (which is )? ":" >) matches the colon, 
probably for the default namespace declaration. And probably because PNAME_NS 
is declared before COLON.

Maybe moving COLON before PNAME_NS, and using COLON in the PNAME_NS rule 
declaration? Not sure if that could introduce other unwanted bugs.

For the time being going with Andy's suggestion to indicate when we were 
expecting a COLON, and actually have something matching PNAME_NS.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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.15#6346)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2017-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user ajs6f commented on the issue:

https://github.com/apache/jena/pull/114
  
No prob-- good to see you back, @kinow !


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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.15#6346)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2017-03-20 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user kinow commented on the issue:

https://github.com/apache/jena/pull/114
  
@ajs6f sorry for the delay. Checked out the branch, just need to refresh my 
memory. Will need a few more days before pinging you guys to check out this PR 
again. Next month finally will have some time to play with Jena again, then 
plan to have this PR completed, and check if there's any Fuseki or easy tasks 
in JIRA :-)

Cheers
Bruno


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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.15#6346)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2017-02-09 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user ajs6f commented on the issue:

https://github.com/apache/jena/pull/114
  
@kinow is this still live?


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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.15#6346)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2016-01-06 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r48998941
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -100,6 +100,38 @@ import org.apache.jena.sparql.core.Quad ;
 public class CLASS extends PARSERBASE
 {
 boolean allowAggregatesInExpressions = false ;
+
+public static void main(String args[]) {
+while (true) {
--- End diff --

New `CLASS` don't appear very often so this could be in a java source file 
for each language

In fact, it only needs to work for language ARQ which is a superset of 
SPARQL 1.1 

Also - have you seen the command `arq.qparse`? It reads in a query and 
prints it out (and performs internal checks on `.equals`, `.hashcode`, output 
sameas input and the algebra generated.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2016-01-06 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r49002105
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -327,6 +359,35 @@ void AskQuery() : {}
   SolutionModifier()
 }
 
+void JsonQuery() : {}
+{
+  JsonClause()
+  ( DatasetClause() )*
+  WhereClause()
+  SolutionModifier()
+}
+
+void JsonClause() : { Object o ; String s ; }
+{
+   { getQuery().setQueryJsonType() ; }
+  
+  s = String() < PNAME_NS >
+  (
--- End diff --

Yes - javacc will tokenize to PNAME_NS.  These is no COLON and if there 
were, theer would be other problems.

I have a devious idea!

Use the  PNAME_NS and follow with a java fragment that does additional 
checking:
```
   t = 
   { 
   if ( t.image is not exactly a ":" )
  throwParseException("message",  t.beginLine, t.beginColumn)
   }
```
This then restricts the legal token and means you won't to have to play 
complicated games with javacc to switch to a different token set (if that is 
even possible due to lookahead of characters).



> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2016-01-06 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r49003225
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_11/SPARQLParser11Constants.java
 ---
@@ -431,6 +433,7 @@
 "\"select\"",
 "\"distinct\"",
 "\"reduced\"",
+"\"json\"",
--- End diff --

This is a generated file - Put inside a `#ifdef ARQ ... #endif` in 
master.jj.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2016-01-01 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r48680983
  
--- Diff: 
jena-arq/src/main/java/org/apache/jena/sparql/lang/sparql_11/SPARQLParser11Constants.java
 ---
@@ -431,6 +433,7 @@
 "\"select\"",
 "\"distinct\"",
 "\"reduced\"",
+"\"json\"",
--- End diff --

Oh, when updating the branch (it was written when Jena was 2.x) I simply 
applied the same changes to master.jj and sparql_11.jj, and looked at other 
classes that I had patched, and looked for similar classes that looked like had 
to be updated as well.

But maybe I added Should I revert this one line?


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2016-01-01 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r48680972
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -327,6 +359,35 @@ void AskQuery() : {}
   SolutionModifier()
 }
 
+void JsonQuery() : {}
+{
+  JsonClause()
+  ( DatasetClause() )*
+  WhereClause()
+  SolutionModifier()
+}
+
+void JsonClause() : { Object o ; String s ; }
+{
+   { getQuery().setQueryJsonType() ; }
+  
+  s = String() < PNAME_NS >
+  (
--- End diff --

I will need some time to check in Eclipse why I used PNAME_NS. If I 
remember correctly, using COLON, JavaCC would find it ambiguous with some other 
character or rule? 


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2016-01-01 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r48680907
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -100,6 +100,38 @@ import org.apache.jena.sparql.core.Quad ;
 public class CLASS extends PARSERBASE
 {
 boolean allowAggregatesInExpressions = false ;
+
+public static void main(String args[]) {
+while (true) {
--- End diff --

Not sure where else it could go. I copied (shamelessly) from an example I 
found online while re-reading about JavaCC. With this main method, you can run 
the grammar in Eclipse, and in the Eclipse Console it will be waiting for a 
String+LFLF (two break lines IIRC).

Then it will use the grammar to parse the string and will output the 
QueryUnit. I found it useful for reviewing the changes without running some 
extra class with a main method, or Fuseki.

What do you think? I'm OK with removing it, or moving it somewhere else. 
Just don't know where else it could go :-)


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2016-01-01 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r48680948
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -100,6 +100,38 @@ import org.apache.jena.sparql.core.Quad ;
 public class CLASS extends PARSERBASE
--- End diff --

Looking at the Notes file, there is a comment to run "jj2tokens 
sparql_11.jj > tokens.txt" to create an initial tokens.txt file, and then 
manually tidy it up.

Should I re-run jj2tokens, or just manually add the missing entries?

Not sure if that hasn't been used in a while and could generate strange 
behaviour in other grammars later.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2015-12-29 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

Github user afs commented on the pull request:

https://github.com/apache/jena/pull/114#issuecomment-167763543
  
Main comment : the grammar changes haven't been put inside `#ifdef ARQ` so 
they happen in strict SPARQL 1.1 as well as the extended ARQ language.

Keeping the SPARQL 1.1 parser exactly as the SPARQL 1.1 spec is important. 
There should just be some noise changes and no more.  (see for example the 
construct-quad changes).


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2015-12-29 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r48532056
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -100,6 +100,38 @@ import org.apache.jena.sparql.core.Quad ;
 public class CLASS extends PARSERBASE
 {
 boolean allowAggregatesInExpressions = false ;
+
--- End diff --

This looks like debug code - could it go elsewhere?


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2015-12-29 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r48532962
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -100,6 +100,38 @@ import org.apache.jena.sparql.core.Quad ;
 public class CLASS extends PARSERBASE
 {
 boolean allowAggregatesInExpressions = false ;
+
+public static void main(String args[]) {
+while (true) {
--- End diff --

This looks like debug code - could it go elsewhere?


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2015-12-29 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r48532825
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -100,6 +100,38 @@ import org.apache.jena.sparql.core.Quad ;
 public class CLASS extends PARSERBASE
--- End diff --

Please update tokens.txt as well - it is used to generate HTML.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2015-12-29 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

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

https://github.com/apache/jena/pull/114#discussion_r48532742
  
--- Diff: jena-arq/Grammar/master.jj ---
@@ -2166,6 +2227,17 @@ String String() : { Token t ; String lex ; }
 }
 }
 
+Number Number() : { Token t ; Number number ; }
+{
--- End diff --

Number -> JSONNumber

But will rule NumericLiteral work here? Then parse the lexical form to a 
number.

However, generally, working in nodes is probably going to be easier because 
bindings map variables to Nodes.


> 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
>Assignee: Bruno P. Kinoshita
>Priority: Minor
>  Labels: java, javacc
>  Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2015-12-27 Thread ASF GitHub Bot (JIRA)

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

ASF GitHub Bot commented on JENA-632:
-

GitHub user kinow opened a pull request:

https://github.com/apache/jena/pull/114

JENA-632: Generate JSON from SPARQL directly

This pull request contains code for 
[JENA-632](https://issues.apache.org/jira/browse/JENA-632). The original work 
is still in a branch in [my fork of 
Jena](https://github.com/apache/jena/compare/master...kinow:JENA-632). It has 
been updated after the work on Jena 3 (mainly package renaming). And the web 
layer has been implemented in fuseki 2, but not backported to fuseki 1.

Besides reviewing the code, the follow steps can be used to quickly test 
the code.

* Start Fuseki (debug in Eclipse after checking out this branch, for 
example)
* Load the books.ttl from fuseki1/Data directory
* Query with something as

```
PREFIX purl: 
PREFIX w3:  
PREFIX :  

JSON {
"author": ?author, 
"title": ?title 
}
WHERE 
{
?book purl:creator ?author .
?book purl:title ?title . 
FILTER (?author = 'J.K. Rowling')
}
```

Which follows the syntax proposed in the issue in JIRA.

I am still reviewing the code after porting to the new code base, but an 
extra pair of eyes reviewing it is always welcome! :grin: 

ps: the SPARQL editor may need some tweaking to support the new syntax

ps2: tried to change the key name in the JSON query but it didn't work. 
Will try to update the PR if that's really a bug in the code in the next days

You can merge this pull request into a Git repository by running:

$ git pull https://github.com/kinow/jena JENA-632-2

Alternatively you can review and apply these changes as the patch at:

https://github.com/apache/jena/pull/114.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

This closes #114


commit 0049f2abcb757c9a190e0017d9369583f4eebf93
Author: Bruno P. Kinoshita 
Date:   2015-12-27T10:51:24Z

JENA-632: Generate JSON from SPARQL directly




> 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
>Assignee: Bruno P. Kinoshita
>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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2015-02-19 Thread Bruno P. Kinoshita (JIRA)

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

Bruno P. Kinoshita commented on JENA-632:
-

Hi again,

Here's the updated code 
https://github.com/kinow/jena/commit/7b3b10134f4201314d5f6c6103a595181e82f997

I noticed that I have been updating several imports (Eclipse auto-removes the 
space before the {{;}}). I'll try to fix it before preparing the code for a 
merge.

Here's how I used the {{JSWriter}} 
https://github.com/kinow/jena/commit/7b3b10134f4201314d5f6c6103a595181e82f997#diff-c42503247148fd09663639cb9df2e641R693

And here's the new output:

{noformat}
[ { 
  author : J.K. Rowling ,
  title : Harry Potter and the Order of the Phoenix
}
{ 
  author : J.K. Rowling ,
  title : Harry Potter and the Philosopher's Stone
}
{ 
  author : J.K. Rowling ,
  title : Harry Potter and the Half-Blood Prince
}
{ 
  author : J.K. Rowling ,
  title : Harry Potter and the Deathly Hallows
}
 ]
{noformat}


 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)


[jira] [Commented] (JENA-632) Generate JSON from SPARQL directly.

2015-02-18 Thread Bruno P. Kinoshita (JIRA)

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

Bruno P. Kinoshita commented on JENA-632:
-

Hi Andy! Sorry for the delay. Sounds good to me. I should have followed your 
initial suggestion of starting by doing the streaming version first :-) I will 
take a look at {{JSWriter}} and will try to come up with an update in the next 
days.

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)


  1   2   >