[ 
https://issues.apache.org/jira/browse/JENA-632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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 ; }
    +{
    +  <JSON> { getQuery().setQueryJsonType() ; }
    +  <LBRACE>
    +  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 " <PNAME_NS> ": "" at line 1, column 15.
    Was expecting:
        ":" ...
         (27 ms)
    ```
    
    The PNAME_NS (which is <PNAME_NS: (<PN_PREFIX>)? ":" >) 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)

Reply via email to