Uploaded image for project: 'Apache Jena'
  1. Apache Jena
  2. JENA-2150

Graph name wrongly in-scope in BIND expression.

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 4.1.0
    • Jena 4.2.0
    • ARQ
    • None

    Description

      If

      SELECT * WHERE
        { GRAPH ?g
            { ?s  ?p  ?o
              BIND(str(?g) AS ?g1)
            }
        }
      

      algebra:

      (graph ?g
        (extend ((?g1 (str ?g)))
          (bgp (triple ?s ?p ?o))))
      

      generates quad form:

      (extend ((?g1 (str ?g)))
        (quadpattern (quad ?g ?s ?p ?o)))
      

      Note quadpattern sets ?g.

      but if a FILTER is present, a correct expression is generated:

      SELECT * WHERE
        { GRAPH ?g
            { ?s  ?p  ?o
              FILTER ( ?g != 123 )
              BIND(?g AS ?g1)
            }
        }
      

      algebra:

      (graph ?g
        (filter (!= ?g 123)
          (extend ((?g1 (str ?g)))
            (bgp (triple ?s ?p ?o)))))
      

      generates quad form:

      (assign ((?g ?*g0))
        (filter (!= ?g 123)
          (extend ((?g1 (str ?g)))
            (quadpattern (quad ?*g0 ?s ?p ?o)))))
      

      Delayed setting of ?g.

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

      Attachments

        Issue Links

          Activity

            People

              andy Andy Seaborne
              andy Andy Seaborne
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: