Hi Jean-Marc,

Depending on what exactly you want from such a service, this may be already possible with jena-text.

I'm assuming that you want to perform a prefix search such as "édu*" and get possible completions for that, such as "éducation".

You can of course already do a prefix search with jena-text. What you will get back will be the RDF resources which have labels that contain this prefix. If the text index is configured to store literal values, you can ask for the actual values as well.

E.g. with this data:

ex:cse rdfs:label "Conseil supérieur de l'éducation"@fr .

and a suitably configured jena-text index, you can perform this query:

(?s ?score ?literal) text:query (rdfs:label "édu*") .

and get back these bindings:

?s=ex:cse ?literal="Conseil supérieur de l'éducation"@fr

However, you will get the full original literal value, not just the individual word that matched ("éducation"). If you want just the matched word, you will need special support that jena-text doesn't currently have.

-Osma

On 17/10/16 11:37, Jean-Marc Vanel wrote:
Hi

I'm implementing an equivalent of dbPedia lookup service [1] in
semantic_forms, leveraging on Lucene integration in TDB, and dbPedia mirror
with TDB [2] .

The dbPedia lookup service is really nice but:

    - the hosted service is often down
    - completion is in english only

A lookup service with TDB and Lucene would overcome these 2 problems.

So I would need completion with Lucene from SPARQL.
According to Jena doc., this does not seems to be implemented:
https://jena.apache.org/documentation/query/text-query.html#query-with-sparql

There are plenty of pages when searching for
lucene completion

 From these pages there is a code snippet here
http://stackoverflow.com/questions/120180/how-to-do-query-auto-completion-suggestions-in-lucene
but a regular Lucene API may exist.

[1] https://github.com/dbpedia/lookup
[2]
https://github.com/jmvanel/semantic_forms/blob/master/doc/en/administration.md#populating-with-dbpedia-mirroring-dbpedia



--
Osma Suominen
D.Sc. (Tech), Information Systems Specialist
National Library of Finland
P.O. Box 26 (Kaikukatu 4)
00014 HELSINGIN YLIOPISTO
Tel. +358 50 3199529
[email protected]
http://www.nationallibrary.fi

Reply via email to