[
https://issues.apache.org/jira/browse/JENA-2205?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17453969#comment-17453969
]
Elie Roux commented on JENA-2205:
---------------------------------
thanks a lot! I didn't think of this syntax, now I can continue coding
> 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)