You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Elie Roux (Jira)" <ji...@apache.org> on 2021/12/06 10:51:00 UTC

[jira] [Created] (JENA-2205) buggy values replacement in ParameterizedSparqlString

Elie Roux created JENA-2205:
-------------------------------

             Summary: buggy values replacement in ParameterizedSparqlString
                 Key: JENA-2205
                 URL: https://issues.apache.org/jira/browse/JENA-2205
             Project: Apache Jena
          Issue Type: Bug
          Components: ARQ
    Affects Versions: Jena 4.2.0
            Reporter: Elie Roux


When doing the following:

final String pquerys = "select * { VALUES ?l {?lrepl} ?l ?p ?o }";}}
final List<Literal> vlist = new ArrayList<>();
vlist.add(ResourceFactory.createStringLiteral("a"));
vlist.add(ResourceFactory.createStringLiteral("b"));
final ParameterizedSparqlString pquery = new ParameterizedSparqlString(pquerys);
pquery.setValues("lrepl", vlist);
final String res = pquery.toString();
System.out.println(res);


the result is the following syntaxically incorrect query:

select * { VALUES ?l {("a") ("b")} ?l ?p ?o }

which should be

select * { VALUES ?l {"a" "b"} ?l ?p ?o }

I think this can be fixed in a relatively straightforward way by removing the addition of parentheses in

https://github.com/apache/jena/blob/0a96c6fd1ecac9ffd68d33b536b2d1ce7fd334b6/jena-arq/src/main/java/org/apache/jena/query/ParameterizedSparqlString.java#L1977



--
This message was sent by Atlassian Jira
(v8.20.1#820001)