[siren-user] Parsing User-Input Query Text
renaud.delbru at deri.org
Wed Jun 23 15:55:15 IST 2010
On 23/06/10 13:51, Adam McLellan wrote:
> Good morning,
> Since there was a time lag between my submission of this message and
> my list subscription approval, I just wanted to check if this has
> already been responded to, but I missed the response. Sorry if this
> is not the case.
Sorry, I didn't received your previous mail. See my answers below.
> I am performing undergraduate research work involving semantic
> data, and I am currently working to implement SIREn as a backend
> for searching some RDF data I have generated. I am interested in
> how best to process user-input search query text. I see from the
> Sindice page
> that fairly complex support for this has been implemented, and I
> see a reference in the SirenPhraseQuery comments to Lucene's
> QueryParser. However, when I tried to simply use a QueryParser
> built with a TupleAnalyzer, I received no results for any
> attempted query.
The Lucene's Query Parser is not aware of the existence of the
Siren*Query classes, so it cannot translate the user query into
Siren*Query objects, only into Lucene's Query objects.
You need to write your own query parser (or extend the one from Lucene)
to build Siren*Query objects from the a user query input. For the
moment, we don't have publicly available code for this yet. We have a
query parser, but it needs a bit of work before being able to publish it
as open source. Moreover, this query parser will be tied to the Sindice
query syntax (if you need other functionalities, you will have to
implement it yourself).
There is maybe possibilities to provide you a snapshot of the query
parser if you are interested (in exchange of some debug feedbacks ;o))
Maybe you could tell me more about what kind of queries you want to
support. Do you want that the user types queries using syntax such as
the "advanced query" of Sindice ? This is normally reserved for
machines, nor really for humans. Or do you want to support only
full-text search queries ? In that case, maybe a simpler solution is
More information about the siren