[ 
https://issues.apache.org/jira/browse/JENA-632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=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: <http://purl.org/dc/elements/1.1/>
    PREFIX w3: <http://www.w3.org/2001/vcard-rdf/3.0#> 
    PREFIX : <http://example.org/book/> 
    
    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)

Reply via email to