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

QueryBuilder does not allow order direction to be specified

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • Jena 3.1.0
    • Jena 3.1.0
    • QueryBuilder
    • None

    Description

      Order direction cannot be specified when using the QueryBuilder. Consider the following:

      (new SelectBuilder()).addWhere("?a", "?b", "?c").addOrderBy("DESC(?a)").buildString()
      

      Actual:

      SELECT  *
      WHERE
        { ?a  ?b  ?c }
      ORDER BY ?DESC(?a)
      

      Expected:

      SELECT  *
      WHERE
        { ?a  ?b  ?c }
      ORDER BY DESC(?a)
      

      It seems the QueryBuilder assumes that only a field name will ever be passed and tried to be 'helpful' by prepending a '?' if it is omitted.

      Attachments

        Activity

          People

            claude Claude Warren
            mglubb Matthew Glubb
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: