Le 29/08/11 16:56, Andy Seaborne a écrit :
Paolo answered this question on 18th August.
Sorry - i did not received any answer - just a mail telling that the mailing-list has moved...
Could you follow me this answer please?


Resending unchanged isn't going to get another answer especially as you haven't given details of the query string or the data.

Data is an RDF graph (stored on a joseki server) where nodes are plain-text documents. The aim is to make larq queries from an html form to a remote joseki server and display results like a web search engine, with small excerpt of the documents. Matching strings will have to be highlighted in excerpt(s).

*Plain text document examples:
doc 1: the roof is on fire
doc 2: Come on baby, light my fire

*query example: fire
-> convert in an larq query:
PREFIX pf: <http://jena.hpl.hp.com/ARQ/property#>
 SELECT ?doc ?score
 {
   (?lit ?score ) pf:textMatch '+fire' .
   ?doc ?p ?lit
 }

*Current result (doc, score)

*intented result (doc, score, offsets(begin;end)):
doc 1 / 0.8 / 15;18
doc 2 / 0.9/ 24;27


Currently, only the lucene score seems to be available from lucene - i would like to get matching string positions.

Thank you.

Jerome


Please provide a complete, minimal example.

    Andy

On 29/08/11 09:30, Jérôme wrote:
Hello,

I am a new Jena/Joseki user and i would like to get matching string
positions in order to highligth them.
Queries are LARQ queries.

Here the client side code:

Query query = QueryFactory.create(queryString) ;
QueryExecution qExec = QueryExecutionFactory.sparqlService(url, query);
ResultSet set = qExec.execSelect();
String xml = ResultSetFormatter.asXMLString(set) ;
qExec.close();

I probably have to use an other way than the sparqlService method. I
know that positions are available with Lucene, but how to recover this
information with the Jena API ?

What is the a simple way to do that?

Thanks.

Jerome.

Reply via email to