You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Tarik Taleb <ta...@hotmail.com> on 2012/05/05 11:44:26 UTC

Just a small question please

Hi, we are two students in master informatics. We have our master to prepare, so we talk in about Jena (especially LARQ) and others features in Lucene assoociated with based-SPARQL interrogation. We have an elemetary question please, we read in http://incubator.apache.org/jena/documentation/larq/index.html that there is three patterns used in LARQ, the question is simple "HOW do we choose between them in a request?" Thank's.  		 	   		  

Re: Just a small question please

Posted by Paolo Castagna <ca...@googlemail.com>.
Tarik Taleb wrote:
> Hi, we are two students in master informatics. We have our master to prepare, so we talk in about Jena (especially LARQ) and others features in Lucene assoociated with based-SPARQL interrogation. We have an elemetary question please, we read in http://incubator.apache.org/jena/documentation/larq/index.html that there is three patterns used in LARQ, the question is simple "HOW do we choose between them in a request?" Thank's.  		 	   		  

Hi Tarik,
you do not choose between the an indexing pattern at query time, you choose that
at indexing time, since that affects how your Lucene index is built (and how you
query it).

I suggest not to worry too much about that and go with the default option, which
is the more flexible and correspond to what's in the documentation is called
pattern 1:

 "Pattern 1 : index string literals. The index will return the literals
  matching the Lucene search pattern."

Then, at query time, you just need to remember that what you get back from
Lucene are literal nodes and if you want to find the corresponding subject you
need to do something like:

PREFIX pf: <http://jena.hpl.hp.com/ARQ/property#>
SELECT ?doc
{
    ?lit pf:textMatch '+text' .
    ?doc ?p ?lit
}

I cannot think of something which can be done with 'pattern 2' and cannot be
done with 'pattern 1'.

My 2 cents.

Good luck with your master in Informatics,
Paolo