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

TransformExtendCombine breaks BINDs inside SERVICE

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 2.12.1
    • Jena 2.13.0
    • ARQ
    • None

    Description

      Optimization breaks BIND expressions in some situations since TransformExtendCombine was enabled in commit 4e5fe9a20d1531430ab96cb2ab9694aed9a9538b (culprit found using git bisect). I don't know exactly when or why this happens, but I hit upon this while using SERVICE. I've been able to create the following minimal example.

      For the query:

      SELECT * {
       SERVICE <> {
          BIND(1 AS ?foo)
          BIND(2 AS ?bar)
       }
      }
      

      qparse --explain for 2.12.0 returns:

      (service <file:///home/jiemakel/qf>
        (extend ((?foo 1) (?bar 2))
          (table unit)))
      

      which works fine, while for 2.12.1 it returns:

      (service <file:///home/jiemakel/qf>
        (extend ((?bar 2))
          (extend ((?foo 1) (?bar 2))
            (table unit))))
      

      which binds ?bar twice, and fails with BIND: Variable used when already in-scope: ?bar in BIND(2 AS ?bar)

      Attachments

        Activity

          People

            andy Andy Seaborne
            jiemakel Eetu Mäkelä
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: