Uploaded image for project: 'Blazegraph (by SYSTAP)'
  1. Blazegraph (by SYSTAP)
  2. BLZG-850

order by expr skips invalid expressions

    XMLWordPrintable

    Details

      Description

      With this 'defect' I am unclear without a detailed read what the correct behavior is, so I won't be surprised if the resolutions of most of the parts of this defect are "invalid". However, I believe that the missing solutions is a real defect
      - it may be that they should be reported as a scope error for the non-aggregate ?label variable, but the current behavior I suspect is incorrect.

      I have a complex query, the part in question boils down to:

      SELECT ?case 
      {
          {  BIND( 1 as ?case )
          } UNION {
            {  SELECT ?case
               { 
                  { BIND ( 2 as ?case )
                    BIND ( 'z' as ?label )
                  } UNION {
                    BIND ( 3 as ?case )
                    BIND ( 'A' as ?label )
                  }
               } 
               GROUP BY ?case
               ORDER BY LCASE(?label)
            }
          }
      }
      

      which gives just case 1 as the answer set, where I was expecting 1, 3, 2 with 3 before 2 but position of 1 undefined.

      The work-around I am using is:

      SELECT ?case 
      {
          {  BIND( 1 as ?case )
          } UNION {
            {  SELECT ?case ?labelLC 
               { 
                  { BIND ( 2 as ?case )
                    BIND ( 'z' as ?label )
                  } UNION {
                    BIND ( 3 as ?case )
                    BIND ( 'A' as ?label )
                  }
                  BIND (LCASE(?label) as ?labelLC)
               } 
               GROUP BY ?case  ?labelLC
               ORDER BY ?labelLC
            }
          }
      }
      

      which gives the answer set 1, 3, 2 (i.e. meeting my needs, because 3 comes before 2)

        Attachments

          Activity

            People

            Assignee:
            jeremycarroll jeremycarroll
            Reporter:
            jeremycarroll jeremycarroll
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: