You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "David Ruszkai (Jira)" <ji...@apache.org> on 2020/03/13 15:58:00 UTC

[jira] [Created] (JENA-1863) Query builder creates query with wrong padding when rdf:type is present

David Ruszkai created JENA-1863:
-----------------------------------

             Summary: 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
    Affects Versions: Jena 3.14.0
            Reporter: David Ruszkai


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]



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