[
https://issues.apache.org/jira/browse/JENA-1863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Claude Warren updated JENA-1863:
--------------------------------
Summary: ARQ formats query with wrong padding when rdf:type is present
(was: Query builder creates query with wrong padding when rdf:type is present)
> 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
> Priority: Trivial
>
> *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)