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

projecting non grouped variable in subquery is incorrectly allowed

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • None
    • Jena 3.1.1
    • None
    • None
    • sparql.org's validator

    Description

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

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

      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:

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

      Attachments

        Activity

          People

            andy Andy Seaborne
            taylorj Joshua Taylor
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: