You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Joshua Taylor (JIRA)" <ji...@apache.org> on 2016/07/01 17:16:11 UTC

[jira] [Created] (JENA-1203) projecting non grouped variable in subquery is incorrectly allowed

Joshua Taylor created JENA-1203:
-----------------------------------

             Summary: projecting non grouped variable in subquery is incorrectly allowed
                 Key: JENA-1203
                 URL: https://issues.apache.org/jira/browse/JENA-1203
             Project: Apache Jena
          Issue Type: Bug
         Environment: sparql.org's validator
            Reporter: Joshua Taylor
            Priority: Minor


Described in this Stack Overflow answer, http://stackoverflow.com/a/38104783/1281433 :

{code}
SELECT ?sub ?pred ?obj (count(?obj) as ?count)
    WHERE { ?sub ?pred ?obj .
        } GROUP BY ?sub
{code}

is illegal, because there are non-grouped variables in the projection (?pred, ?obj).  However, when this query appears as a subquery, no syntax error is reported, as in:

{code}
DELETE { ?sub ?pred ?obj . } 
WHERE {  
    {SELECT ?sub ?pred ?obj (count(?obj) as ?count)
    WHERE { ?sub ?pred ?obj .
        } GROUP BY ?sub
    } FILTER(?count < 14)
}
{code}





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