afs commented on issue #2153:
URL: https://github.com/apache/jena/issues/2153#issuecomment-1878561357
There are two sub-issues here:
* The algebra generator does not cope with the non-parser AST generated by
querybuilder (PR #2155)
* What should the querybuilder create?
```java
public static void querybuilderOutput() {
SelectBuilder selectBuilder = new SelectBuilder();
selectBuilder.addFilter(selectBuilder.makeExpr("true"));
Query query = selectBuilder.build();
System.out.println(query);
Query query2 = QueryFactory.create(query.toString());
System.out.println(query2);
System.out.println("Parsed builder output equals input?
"+query.equals(query2));
}
```
Output:
```
SELECT *
WHERE
{ FILTER ( true )}
SELECT *
WHERE
{ FILTER ( true ) }
Parsed builder output equals input? false
```
Note the slight difference in the query strings due to the presence of the
ElementGroup in the second, parsed case, which isn't in querybuilder form.
The query patterns are:
- querybuilder : `ElementFilter(true)`
- parser : `ElementGroup( ElementFilter(true) )`.
A querybuilder change in `BuildElementVisitor` (#2152) covers the
`ElementFilter` case.
Generalizing that to not treat group-of-one in a special way, gives ~50
querybuilder test case failures because the test cases manually build an AST
that won't be generated by the parser.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]