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

Variables used in a filter and then defined are not handled properly by the join strategy.

    Details

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

      Description

      Query: Q.rq
           1	PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
           2	PREFIX ex:  <http://example.com/>
           3	SELECT ?label {
           4	    {
           5	        FILTER (bound(?arg1))
           6	    }
           7	    ?arg1 rdfs:label ?label
           8	}
           9	VALUES ?arg1 { ex:a  UNDEF }
      Data: D.ttl
           1	@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
           2	@prefix ex: <http://example.com/>.
           3	
           4	ex:a rdfs:label "A".
           5	ex:b rdfs:label "B".
      Execute: qparse --print=op --print=opt --query Q.rq
      (prefix ((rdfs: <http://www.w3.org/2000/01/rdf-schema#>)
               (ex: <http://example.com/>))
        (project (?label)
          (join
            (join
              (filter (bound ?arg1)
                (table unit))
              (bgp (triple ?arg1 rdfs:label ?label)))
            (table (vars ?arg1)
              (row [?arg1 ex:a])
              (row)
            ))))
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      (prefix ((rdfs: <http://www.w3.org/2000/01/rdf-schema#>)
               (ex: <http://example.com/>))
        (project (?label)
          (sequence
            (table (vars ?arg1)
              (row [?arg1 ex:a])
              (row)
            )
            (sequence
              (filter (bound ?arg1)
                (table unit))
              (bgp (triple ?arg1 rdfs:label ?label))))))
      Execute: sparql --engine=ref --query Q.rq --data D.ttl
      ---------
      | label |
      =========
      ---------
      Execute: sparql --query Q.rq --data D.ttl
      ---------
      | label |
      =========
      | "A"   |
      ---------
      

        Attachments

        1. Q.rq
          0.2 kB
          Andy Seaborne
        2. dwim
          0.3 kB
          Andy Seaborne
        3. D.ttl
          0.1 kB
          Andy Seaborne

          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: