You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "ASF subversion and git services (Jira)" <ji...@apache.org> on 2020/04/10 13:03:00 UTC

[jira] [Commented] (JENA-1863) ARQ formats query with wrong padding when rdf:type is present

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

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

Commit 53b9e3060ce52fb854a869ab6108cab7c544a766 in jena's branch refs/heads/master from Andy Seaborne
[ https://gitbox.apache.org/repos/asf?p=jena.git;h=53b9e30 ]

Merge pull request #723 from afs/jena1863-format-bgp

JENA-1863: Correctly indent when using "a"

> ARQ formats query with wrong padding when rdf:type is present
> -------------------------------------------------------------
>
>                 Key: JENA-1863
>                 URL: https://issues.apache.org/jira/browse/JENA-1863
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>    Affects Versions: Jena 3.14.0
>            Reporter: David Ruszkai
>            Assignee: Andy Seaborne
>            Priority: Trivial
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> *Description*
>  Creating a query with any QueryBuilder (SelectBuilder, AskBuilder etc.) when an RDF.type predicate is present will result in a query that contains the character 'a' followed by 19 spaces instead of a single 'a' (shortcut to the RDF.type predicate) or "<[http://www.w3.org/1999/02/22-rdf-syntax-ns#type]>" (the URI of the RDF.type predicate).
> Example:
> {code:java}
> new SelectBuilder().addWhere(createVariable("subject"), org.apache.jena.vocabulary.RDF.type, createVariable("object")).buildString()
> {code}
> OR
> {code:java}
> new SelectBuilder().addWhere(createVariable("subject"), createURI("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), createVariable("object")).buildString()
> {code}
> OR
> {code:java}
> new SelectBuilder().addWhere(createVariable("subject"), "a", createVariable("object")).buildString()
> {code}
> will create the following query
> {code:java}
> SELECT  *
> WHERE
>   { ?subject  a                     ?object}
> {code}
> Probably caused by:
>  [https://github.com/apache/jena/commit/6570c25be8c6e958a5647a7d2c1e23466498b332]
> *Summary*
> The formatting of the query is invalid when the rdf:type predicate is present.
> *Steps to reproduce*
> Check the result of
> {code:java}
> new SelectBuilder().addWhere(createVariable("subject"), "a", createVariable("object")).buildString()
> {code}
> *Expected results*
> {code:java}
> SELECT  *
> WHERE
>   { ?subject  a  ?object}
> {code}
> *Actual results*
> {code:java}
> SELECT  *
> WHERE
>   { ?subject  a                     ?object}
> {code}



--
This message was sent by Atlassian Jira
(v8.3.4#803005)