Aklakan opened a new issue, #1369:
URL: https://github.com/apache/jena/issues/1369
Something is wrong in OpAsQuery that causes expressions to get lost:
```java
Query before = QueryFactory.create("SELECT ?z { BIND('x' AS ?y) BIND(?y AS
?z) }");
Op op = Algebra.compile(before);
Query after = OpAsQuery.asQuery(op);
System.out.println(after);
```
Expected result:
```sparql
SELECT ('x' AS ?y) (?y AS ?z)
WHERE
{ }
```
Actual result:
```sparql
SELECT (?y AS ?z) // Missing ('x' AS ?y)
WHERE
{ }
```
It may be related to some magic with unit tables - but I'm not sure.
If possible, I'd prefer OpAsQuery to not try to optimize 'unused' binds
(isn't that something the optimizer should take care of?).
For example, if 'the constant x' was replaced with the variable `?x` as in
```java
Query before = QueryFactory.create("SELECT ?z { BIND(?x AS ?y) BIND(?y AS
?z) }");
```
then IMO the expected result should nonetheless be:
```sparql
SELECT (?x AS ?y) (?y AS ?z)
WHERE
{ }
```
--
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]