[ 
https://issues.apache.org/jira/browse/JENA-2150?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Seaborne updated JENA-2150:
--------------------------------
    Description: 
If
{noformat}
SELECT * WHERE
  { GRAPH ?g
      { ?s  ?p  ?o
        BIND(str(?g) AS ?g1)
      }
  }
{noformat}
algebra:
{noformat}
(graph ?g
  (extend ((?g1 (str ?g)))
    (bgp (triple ?s ?p ?o))))
{noformat}
generates quad form:
{noformat}
(extend ((?g1 (str ?g)))
  (quadpattern (quad ?g ?s ?p ?o)))
{noformat}
Note quadpattern sets {{?g}}.

but if a FILTER is present, a correct expression is generated:
{noformat}
SELECT * WHERE
  { GRAPH ?g
      { ?s  ?p  ?o
        FILTER ( ?g != 123 )
        BIND(?g AS ?g1)
      }
  }
{noformat}
algebra:
{noformat}
(graph ?g
  (filter (!= ?g 123)
    (extend ((?g1 (str ?g)))
      (bgp (triple ?s ?p ?o)))))
{noformat}
generates quad form:
{noformat}
(assign ((?g ?*g0))
  (filter (!= ?g 123)
    (extend ((?g1 (str ?g)))
      (quadpattern (quad ?*g0 ?s ?p ?o)))))
{noformat}
Delayed setting of {{?g}}.

The problem is in {{OpVars.OpVarsMentioned}} not processing BIND expressions.

> Graph name wrongly in-scope in BIND expression.
> -----------------------------------------------
>
>                 Key: JENA-2150
>                 URL: https://issues.apache.org/jira/browse/JENA-2150
>             Project: Apache Jena
>          Issue Type: Bug
>          Components: ARQ
>    Affects Versions: Jena 4.1.0
>            Reporter: Andy Seaborne
>            Assignee: Andy Seaborne
>            Priority: Major
>             Fix For: Jena 4.2.0
>
>
> If
> {noformat}
> SELECT * WHERE
>   { GRAPH ?g
>       { ?s  ?p  ?o
>         BIND(str(?g) AS ?g1)
>       }
>   }
> {noformat}
> algebra:
> {noformat}
> (graph ?g
>   (extend ((?g1 (str ?g)))
>     (bgp (triple ?s ?p ?o))))
> {noformat}
> generates quad form:
> {noformat}
> (extend ((?g1 (str ?g)))
>   (quadpattern (quad ?g ?s ?p ?o)))
> {noformat}
> Note quadpattern sets {{?g}}.
> but if a FILTER is present, a correct expression is generated:
> {noformat}
> SELECT * WHERE
>   { GRAPH ?g
>       { ?s  ?p  ?o
>         FILTER ( ?g != 123 )
>         BIND(?g AS ?g1)
>       }
>   }
> {noformat}
> algebra:
> {noformat}
> (graph ?g
>   (filter (!= ?g 123)
>     (extend ((?g1 (str ?g)))
>       (bgp (triple ?s ?p ?o)))))
> {noformat}
> generates quad form:
> {noformat}
> (assign ((?g ?*g0))
>   (filter (!= ?g 123)
>     (extend ((?g1 (str ?g)))
>       (quadpattern (quad ?*g0 ?s ?p ?o)))))
> {noformat}
> Delayed setting of {{?g}}.
> The problem is in {{OpVars.OpVarsMentioned}} not processing BIND expressions.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to