You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Rob Vesse (JIRA)" <ji...@apache.org> on 2015/06/04 13:28:38 UTC

[jira] [Created] (JENA-954) OpAsQuery can move sub-query modifiers onto outer query

Rob Vesse created JENA-954:
------------------------------

             Summary: OpAsQuery can move sub-query modifiers onto outer query
                 Key: JENA-954
                 URL: https://issues.apache.org/jira/browse/JENA-954
             Project: Apache Jena
          Issue Type: Bug
          Components: ARQ
    Affects Versions: Jena 2.13.0
            Reporter: Rob Vesse
            Assignee: Rob Vesse
            Priority: Minor
             Fix For: Jena 3.0.0


Reported on the mailing list:

http://s.apache.org/jena-algebra-roundtripping-bug

Some queries roundtrip incorrectly through the {{Algebra.compile()}} to {{OpAsQuery.asQuery()}} flow e.g.

{noformat}
SELECT (COUNT(*) as ?count) {
  SELECT DISTINCT ?uri ?graph WHERE {
    GRAPH ?graph {
      ?uri ?p ?o .
      }
    } LIMIT 1
}
{noformat}

Produces algebra:

{noformat}
project (?tripod_count_var)
  (extend ((?tripod_count_var ?.0))
    (group () ((?.0 (count)))
      (distinct
        (project (?uri ?graph)
          (graph ?graph
            (bgp (triple ?uri ?p ?o))))))))
{noformat}

Which round trips back to:

{noformat}
SELECT DISTINCT  (count(*) AS ?tripod_count_var)
WHERE
  { { SELECT  ?uri ?graph
      WHERE
        { GRAPH ?graph
            { ?uri ?p ?o}
        }
    }
  }
{noformat}

Note that the {{DISTINCT}} was incorrectly moved to the outer query

The problem is that the conversion does not correct cope with the case of being within a {{project}} and needs to spawn a sub-converter to cope as {{OpProject}} already does



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)