<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:10pt">Hi,<br><br>I am having a hard time trying to use the special variable $score with a LuceneModel.  Hopefully someone can help me.<br><br>Originally, I had a SPARQL request like this: <br><br>PREFIX dct: <http://purl.org/dc/terms/><br>PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#><br>PREFIX stuff: <http://mystuff.com/reference#><br>PREFIX server: <#><br><br>select DISTINCT ?s<br>where {<br>    ?s rdf:type <stuff:LearningObject> .<br>    {<br>        graph server:mylucene {<br>            ?s dct:title "myKeyword"<br>        }<br>    }<br>    UNION<br>   
 {<br>        graph server:mylucene {<br>            ?s dct:description "myKeyword"<br>        }<br>    }<br>}<br><br>This works fine AFAIK.<br><br>Now, I would like to do the same request but sort the results according to Lucene's ranking.  To achieve this, the documentation mentions the $score special variable.  Unless I have overlooked it, the documentation doesn't explain how to use it.<br><br>I found an example that works here though:<br><br>http://lists.mulgara.org/pipermail/mulgara-general/2010-August/001139.html<br><br>According to this exchange on the mailing-list, if I understand well, I must use TQL instead of SPARQL to use $score so I started to convert my previous SPARQL query to TQL like follow:<br><br>select $s $score from <rmi://localhost/comete#main><br>where $s
 <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://mystuff.com/reference#LearningObject> in <rmi://localhost/comete#main><br>and $s <http://mulgara.org/mulgara#search> $q in <rmi://localhost/comete#mylucene> <br>and $q <http://purl.org/dc/terms/description> 'myKeyword' in <rmi://localhost/comete#mylucene><br>and $q <http://mulgara.org/mulgara#score> $score in <rmi://localhost/comete#mylucene><br><br>This works fine.<br><br>Now, I would like to add another test on another predicate (like in my original SPARQL query in the first UNION clause).<br><br>I tried a few things and got the following error:<br><br>Error executing command. Reason: org.mulgara.query.QueryException: Query failed: Only one predicate supported per search: pred1=http://purl.org/dc/terms/title, pred2=http://purl.org/dc/terms/description<br><br>Is it possible to use $score with a test involving more than one predicate on the
 LuceneModel?  How can I do that using TQL?<br><br>Frederic Bergeron<br><br></div></body></html>