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

JoinClassifer is too cautious with EXISTS variables.

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Jena 3.1.1
    • Fix Version/s: Jena 3.2.0
    • Component/s: ARQ
    • Labels:
      None

      Description

      This query

      SELECT * {
         :s :p ?g      # ?g
         GRAPH ?g {    # ?g
            :s1 :p1 ?x
            FILTER EXISTS { ?s ?p ?o }
         }
      }
      

      is not executed as a (sequence) because there are variables in the FILTER that appear to be not bound: ?s etc in EXISTS. If it were a function, this would be correct but EXISTS is different.

      Variables only in an EXISTS BGP patterns should not contribute to the unsafe variables of a FILTER.

      This query:

      SELECT * {
         ?s :p ?g      # :s -> ?s
         GRAPH ?g {
            :s1 :p1 ?x
            FILTER EXISTS { ?s ?p ?o }
         }
      }
      

      is not safe to allow ?s to substitute. This is correctly detected in Jena 3.1.0.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                andy.seaborne Andy Seaborne
                Reporter:
                andy.seaborne Andy Seaborne
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: