[
https://issues.apache.org/jira/browse/JENA-2205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17453961#comment-17453961
]
Rob Vesse commented on JENA-2205:
---------------------------------
So it's not as simple as that. This only produces a syntactically invalid
query when the simplified single variable {{VALUES}} form is used.
If you use the full syntax i.e.
{noformat}
select * { VALUES (?l) {?lrepl} ?l ?p ?o }
{noformat}
Then the resulting query is valid. So this would need a broader fix to detect
that the special case single {{VALUES}} form is being used
> 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
> Priority: Major
>
> When doing the following:
> {noformat}
> 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);
> {noformat}
> the result is the following syntaxically incorrect query:
> {noformat}
> select * { VALUES ?l {("a") ("b")} ?l ?p ?o }
> {noformat}
> which should be
> {noformat}
> select * { VALUES ?l {"a" "b"} ?l ?p ?o }
> {noformat}
> 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)