title: Order SPARQL query results by length of a string?
body: <p>I'm trying to autocomplete what the user writes in an input, with terms in DBpedia, similar to <a href="https://jsfiddle.net/lawlesst/a00x2ess/" rel="noreferrer">this jsFiddle example</a>. Try writing <strong>dog</strong> in the input of that jsFiddle, and you will see the 'Dog' term in the suggestions.</p>
  
  <p>I have the following code, and the problem is that the 10-term list I got as a result does not contains the "Dog" alternative. So, if I could order the list by the length of the (string representation of) <strong>?concept</strong>, then I could get that term.  Is this possible?</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT DISTINCT ?concept
  WHERE {
    ?concept a skos:Concept . 
    FILTER regex(str(?concept), "dog", "i")
  }
  ORDER BY ASC(?concept) LIMIT 10
  </code></pre>