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

Algebra.toQuadForm() does not transform Expressions in Optional clauses

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 2.11.0
    • Jena 2.11.1
    • ARQ
    • None

    Description

      Our internal testing has flagged up a failure in 2.11.0 in Algebra.toQuadForm() when applied to expressions within an OPTIONAL clause.

      The query in question is as follows:

      SELECT  *
          WHERE
            { ?s ?p ?o
                OPTIONAL
                  { 
                    FILTER NOT EXISTS {?s ?p ?o }
                  }
            }
      

      The algebra before calling Algebra.toQuadForm() is as follows:

      (leftjoin
        (bgp (triple ?s ?p ?o))
        (table unit)
        (notexists (bgp (triple ?s ?p ?o))))
      

      The expected algebra is as follows:

      (leftjoin
        (quadpattern (quad <urn:x-arq:DefaultGraphNode> ?s ?p ?o))
        (table unit)
        (notexists (quadpattern (quad <urn:x-arq:DefaultGraphNode> ?s ?p ?o))))
      

      The resulting algebra is as follows:

      (leftjoin
        (quadpattern (quad <urn:x-arq:DefaultGraphNode> ?s ?p ?o))
        (table unit)
        (notexists (bgp (triple ?s ?p ?o))))
      

      It appears that the Transform Walkers visit the left and right Ops of the OpLeftJoin but not the ExprList that contains the E_NotExists.

      Attachments

        Activity

          People

            andy Andy Seaborne
            tracyh Tracy Hartford
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: