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

Variables in EXISTS must be considered for the join strategy

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: Jena 3.7.0
    • Fix Version/s: Jena 3.8.0
    • Component/s: ARQ
    • Labels:
      None

      Description

      This query has a join between the GRAPH and the pattern before it.

      SELECT  *
      WHERE
        { ?s  ?p  ?V0
          GRAPH ?g 
            { ?sx  ?p  ?ox
              FILTER EXISTS { _:b0  ?p  ?V0 }
            }
        }
      

      The fact ?V0 occurs in the LHS of the join in ?s ?p ?V0 and in the FILTER but not in the rest of the RHS means the "sequence" transform can not be used.

      Contrast to:

      SELECT  *
      WHERE
        { ?s  ?p  ?V1
          GRAPH ?g 
            { ?sx  ?p  ?ox
              FILTER EXISTS { _:b0  ?p  ?V2 }
            }
        }
      

      Now ?V2 is only in the FILTER so it is safe to transform the join.

      Note that ?p appears in LHS so making it defined in the EXISTS and the sequence transfrom is possible.

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: