[ 
https://issues.apache.org/jira/browse/JENA-1863?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

David Ruszkai updated JENA-1863:
--------------------------------
    Description: 
*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}
will create the following query
{code:java}
SELECT  *
WHERE
  { ?subject  a                     ?object}
{code}
Probably caused by:
 
[https://github.com/apache/jena/commit/6570c25be8c6e958a5647a7d2c1e23466498b332]

*Summary*

  was:
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}
will create the following query
{code:java}
SELECT  *
WHERE
  { ?subject  a                     ?object}
{code}
Probably caused by:
 
[https://github.com/apache/jena/commit/6570c25be8c6e958a5647a7d2c1e23466498b332]


> Query builder creates 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}
> will create the following query
> {code:java}
> SELECT  *
> WHERE
>   { ?subject  a                     ?object}
> {code}
> Probably caused by:
>  
> [https://github.com/apache/jena/commit/6570c25be8c6e958a5647a7d2c1e23466498b332]
> *Summary*



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

Reply via email to