You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Kamalraj Jairam <kj...@semanticsoftware.com.au> on 2015/01/19 23:33:29 UTC
Jena text Search
Hello All,
I have number of data properties in TDB dataset with ranging Uris
I want to create a lucene index on these data properties so that any partial text search is fast.
I read the document on Jena Website, but i have some questions on what needs to be done
This is what the text says
// Example of building a text dataset with code.
// Example is in-memory.
// Base dataset
Dataset ds1 = DatasetFactory.createMem() ;
EntityDefinition entDef = new EntityDefinition("uri", "text", RDFS.label) ;
// Lucene, in memory.
Directory dir = new RAMDirectory();
// Join together into a dataset
Dataset ds = TextDatasetFactory.createLucene(ds1, dir, entDef) ;
What should go in the Uri - > is it the base Uri?
What should go in the “Text” ? can this be left blank?
Thanks
Kamalraj
Re: Jena text Search
Posted by Andy Seaborne <an...@apache.org>.
On 19/01/15 22:33, Kamalraj Jairam wrote:
> Hello All,
>
> I have number of data properties in TDB dataset with ranging Uris
>
> I want to create a lucene index on these data properties so that any partial text search is fast.
>
> I read the document on Jena Website, but i have some questions on what needs to be done
>
> This is what the text says
>
> // Example of building a text dataset with code.
>
> // Example is in-memory.
> // Base dataset
> Dataset ds1 = DatasetFactory.createMem() ;
>
> EntityDefinition entDef = new EntityDefinition("uri", "text", RDFS.label) ;
>
> // Lucene, in memory.
> Directory dir = new RAMDirectory();
>
> // Join together into a dataset
> Dataset ds = TextDatasetFactory.createLucene(ds1, dir, entDef) ;
>
> What should go in the Uri - > is it the base Uri?
>
> What should go in the “Text” ? can this be left blank?
The "uri" is the target (result) of the search.
That EntityDefinition says to use the Lucene field "text" for the
indexed strings of rdf:label statements.
It will look up "text" and return "uri".
Andy
>
> Thanks
> Kamalraj
>
>