You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Charles Abela <ch...@gmail.com> on 2015/02/27 15:07:33 UTC
jena-fuseki-lucene: no results returned
Hi,
I've managed to configure and run jena-fuseki. I used the
config-tdb-text.ttl and created a lucene index over the books.ttl example
(7 properties were indexed). However when I execute the query
PREFIX text: <http://jena.apache.org/text#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX book: <http://example.org/book/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?s
{ ?s dc:title ?x .
?s text:query (dc:title 'Harry') ;
}
no tuples are returned.
I've configured <#entMap> as follows:
<#entMap> a text:EntityMap ;
text:entityField "uri" ;
text:defaultField "text" ; ## Should be defined in the
text:map.
text:map (
[ text:field "text" ;
text:predicate dc:title;
text:analyzer [
a text:StandardAnalyzer ;
text:stopWords ("a" "an" "and" "but")
]
]
) .
am I on the right track here?
am I missing or doing something wrong?
thanks in advance
Re: jena-fuseki-lucene: no results returned
Posted by Charles Abela <ch...@gmail.com>.
Thanks Andy for the clarification.
C
On Sun, Mar 1, 2015 at 12:17 PM, Andy Seaborne <an...@apache.org> wrote:
> On 28/02/15 16:28, Charles Abela wrote:
>
>> Re-hi,
>> I just tried it out using ./fuseki-server --config=config-tdb-text.ttl
>> with the query
>>
>> SELECT ?s
>> { ?s dc:title ?x .
>> ?s text:query (dc:title 'Stone') ;
>> }
>>
>> and it worked fine.
>> I understood that I was starting the server wrongly. But what's the
>> difference?
>>
>
> "./fuseki-server --update --mem /ds"
> says
> "start server, one in-memory dataset at /ds; allow update"
>
> It does not tell Fuseki to look for a configuration file let alone a text
> index.
>
> Your configuration file has:
>
> -----------------------
> ...
> fuseki:dataset <#books> ;
> .
>
> <#books> rdf:type text:TextDataset ;
> text:dataset <#dataset> ;
> ##text:index <#indexSolr> ;
> text:index <#indexLucene> ;
> .
>
> <#dataset> rdf:type tdb:DatasetTDB ;
> tdb:location "DB" ;
> ##tdb:unionDefaultGraph true ;
> -----------------------
>
> which tells Fuseki to use a text index and TDb database in combination.
> It also tells the server where the data is on disk.
>
> If after starting the server with an in memory dataset, I upload the file.
>> Shouldn't it have worked just the same?
>>
>
> There is no text index. It needs to know what to index and wheer to store
> it.
>
>
>> cheers
>>
>> C
>>
>
> Andy
>
>
Re: jena-fuseki-lucene: no results returned
Posted by Andy Seaborne <an...@apache.org>.
On 28/02/15 16:28, Charles Abela wrote:
> Re-hi,
> I just tried it out using ./fuseki-server --config=config-tdb-text.ttl
> with the query
>
> SELECT ?s
> { ?s dc:title ?x .
> ?s text:query (dc:title 'Stone') ;
> }
>
> and it worked fine.
> I understood that I was starting the server wrongly. But what's the
> difference?
"./fuseki-server --update --mem /ds"
says
"start server, one in-memory dataset at /ds; allow update"
It does not tell Fuseki to look for a configuration file let alone a
text index.
Your configuration file has:
-----------------------
...
fuseki:dataset <#books> ;
.
<#books> rdf:type text:TextDataset ;
text:dataset <#dataset> ;
##text:index <#indexSolr> ;
text:index <#indexLucene> ;
.
<#dataset> rdf:type tdb:DatasetTDB ;
tdb:location "DB" ;
##tdb:unionDefaultGraph true ;
-----------------------
which tells Fuseki to use a text index and TDb database in combination.
It also tells the server where the data is on disk.
> If after starting the server with an in memory dataset, I upload the file.
> Shouldn't it have worked just the same?
There is no text index. It needs to know what to index and wheer to
store it.
>
> cheers
>
> C
Andy
Re: jena-fuseki-lucene: no results returned
Posted by Charles Abela <ch...@gmail.com>.
Re-hi,
I just tried it out using ./fuseki-server --config=config-tdb-text.ttl
with the query
SELECT ?s
{ ?s dc:title ?x .
?s text:query (dc:title 'Stone') ;
}
and it worked fine.
I understood that I was starting the server wrongly. But what's the
difference?
If after starting the server with an in memory dataset, I upload the file.
Shouldn't it have worked just the same?
cheers
C
On Sat, Feb 28, 2015 at 5:21 PM, Charles Abela <ch...@gmail.com>
wrote:
>
>
> On Sat, Feb 28, 2015 at 4:28 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> On 28/02/15 14:25, Charles Abela wrote:
>>
>>> Re-hi,
>>> still at it with no success, unfortunately.
>>>
>>
>> This does not look right:
>> > iii. I start the server
>> > ./fuseki-server --update --mem /ds
>> That's an in-memory dataset.
>> I don't see where it's getting any data from, let alone some triples.
>>
>
>
>
>> I would have expected:
>>
>> ./fuseki-server --config=config-tdb-text.ttl
>>
>> Did you do anything else after starting the server?
>>
>
> I load the books.ttl via the upload feature in the fuseki control panel.
>
>
>> How are you executing the query?
>>
> using the sprql query endpoint. Later on I will be doing this
> programmatically.
>
> C
>
>>
>> Andy
>>
>>
>> The process I'm following is the following:
>>> i. I'm calling the tdb loader which executes fine as below:
>>> java -cp fuseki-server.jar tdb.tdbloader --loc=DB
>>> data/books.ttl
>>> INFO -- Start triples data phase
>>> INFO ** Load into triples table with existing data
>>> INFO -- Start quads data phase
>>> INFO ** Load empty quads table
>>> INFO Load: data/books.ttl -- 2015/02/28 15:04:33 CET
>>> INFO -- Finish triples data phase
>>> INFO ** Data: 17 triples loaded in 0.47 seconds [Rate: 36.17
>>> per
>>> second]
>>> INFO -- Finish quads data phase
>>> INFO -- Start triples index phase
>>> INFO -- Finish triples index phase
>>> INFO -- Finish triples load
>>> INFO ** Completed: 17 triples loaded in 0.57 seconds [Rate:
>>> 30.04
>>> per second]
>>> INFO -- Finish quads load
>>>
>>> ii. Im then calling the textindexer which seems to execute of as well,
>>> since it says that 7 properties were indexed:
>>> java -cp fuseki-server.jar jena.textindexer
>>> --desc=config-tdb-text.ttl
>>> INFO 7 (7 per second) properties indexed
>>>
>>> iii. I start the server
>>> ./fuseki-server --update --mem /ds
>>> 15:05:27 INFO Dataset: in-memory15:05:28 INFO Dataset path = /ds
>>> 15:05:28 INFO Fuseki 1.1.1 2014-10-02T16:36:17+0100
>>> 15:05:28 INFO Started 2015/02/28 15:05:28 CET on port 3030
>>>
>>> When I execute the query without including text:query
>>>
>>> PREFIX text: <http://jena.apache.org/text#>
>>> PREFIX dc: <http://purl.org/dc/elements/1.1/>
>>> PREFIX book: <http://example.org/book/>
>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>>>
>>> SELECT ?s { ?s dc:title ?x . }
>>>
>>> the query executes fine and the result is all the book instances
>>>
>>> however whenever I include ....text:query in any of the mentioned ways,
>>> the
>>> result returns nothing.
>>>
>>> the assembler I;'m using is the config-tdb-text as follows:
>>>
>>> # TDB
>>> [] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
>>> tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
>>> tdb:GraphTDB rdfs:subClassOf ja:Model .
>>>
>>> # Text
>>> [] ja:loadClass "org.apache.jena.query.text.TextQuery" .
>>> text:TextDataset rdfs:subClassOf ja:RDFDataset .
>>> #text:TextIndexSolr rdfs:subClassOf text:TextIndex .
>>> text:TextIndexLucene rdfs:subClassOf text:TextIndex .
>>>
>>> ##------------------------------------------------------------------
>>>
>>> <#service_text_tdb> rdf:type fuseki:Service ;
>>> rdfs:label "TDB/text service" ;
>>> fuseki:name "ds" ;
>>> fuseki:serviceQuery "query" ;
>>> fuseki:serviceQuery "sparql" ;
>>> fuseki:serviceUpdate "update" ;
>>> fuseki:serviceUpload "upload" ;
>>> fuseki:serviceReadGraphStore "get" ;
>>> fuseki:serviceReadWriteGraphStore "data" ;
>>> fuseki:dataset <#books> ;
>>> .
>>>
>>> <#books> rdf:type text:TextDataset ;
>>> text:dataset <#dataset> ;
>>> ##text:index <#indexSolr> ;
>>> text:index <#indexLucene> ;
>>> .
>>>
>>> <#dataset> rdf:type tdb:DatasetTDB ;
>>> tdb:location "DB" ;
>>> ##tdb:unionDefaultGraph true ;
>>> .
>>>
>>> <#indexLucene> a text:TextIndexLucene ;
>>> text:directory <file:Lucene> ;
>>> ##text:directory "mem" ;
>>> text:entityMap <#entMap> ;
>>> .
>>>
>>> <#entMap> I've defined in my previous email.
>>>
>>> any ideas as to why I'm not getting any results is greatly appreciated.
>>>
>>> cheers
>>>
>>>
>>> On Fri, Feb 27, 2015 at 11:43 PM, Charles Abela <charles.abela@gmail.com
>>> >
>>> wrote:
>>>
>>> I did not understand your question re the assembler and how it is
>>>> connecting the dataset to the index. Can you elaborate pls?
>>>> Re the queries I had tried them already. This one
>>>>
>>>> SELECT ?s { ?s dc:title ?x }
>>>>
>>>> returned fine, while others did not return anything.
>>>>
>>>>
>>>> On Fri, Feb 27, 2015 at 9:42 PM, Andy Seaborne <an...@apache.org> wrote:
>>>>
>>>> On 27/02/15 14:07, Charles Abela wrote:
>>>>>
>>>>> Hi,
>>>>>> I've managed to configure and run jena-fuseki. I used the
>>>>>> config-tdb-text.ttl and created a lucene index over the books.ttl
>>>>>> example
>>>>>> (7 properties were indexed). However when I execute the query
>>>>>>
>>>>>> PREFIX text: <http://jena.apache.org/text#>
>>>>>> PREFIX dc: <http://purl.org/dc/elements/1.1/>
>>>>>> PREFIX book: <http://example.org/book/>
>>>>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>>>>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>>>>>>
>>>>>> SELECT ?s
>>>>>> { ?s dc:title ?x .
>>>>>> ?s text:query (dc:title 'Harry') ;
>>>>>> }
>>>>>>
>>>>>> no tuples are returned.
>>>>>>
>>>>>> I've configured <#entMap> as follows:
>>>>>>
>>>>>>
>>>>> How is the assembler connecting the dataset to the text index?
>>>>>
>>>>>
>>>>> <#entMap> a text:EntityMap ;
>>>>>> text:entityField "uri" ;
>>>>>> text:defaultField "text" ; ## Should be defined in
>>>>>> the
>>>>>> text:map.
>>>>>> text:map (
>>>>>> [ text:field "text" ;
>>>>>> text:predicate dc:title;
>>>>>> text:analyzer [
>>>>>> a text:StandardAnalyzer ;
>>>>>> text:stopWords ("a" "an" "and" "but")
>>>>>> ]
>>>>>> ]
>>>>>> ) .
>>>>>>
>>>>>> am I on the right track here?
>>>>>>
>>>>>>
>>>>> Yes
>>>>>
>>>>>
>>>>> am I missing or doing something wrong?
>>>>>>
>>>>>>
>>>>> Not obviously to me.
>>>>>
>>>>>
>>>>> thanks in advance
>>>>>>
>>>>>>
>>>>>> Try some debugging: these queries will poke into the database:
>>>>>
>>>>> SELECT ?s { ?s dc:title ?x }
>>>>>
>>>>> SELECT ?s { ?s text:query ('Harry') }
>>>>>
>>>>> SELECT ?s { ?s text:query (dc:title 'Harry') }
>>>>>
>>>>> Andy
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>
Re: jena-fuseki-lucene: no results returned
Posted by Charles Abela <ch...@gmail.com>.
On Sat, Feb 28, 2015 at 4:28 PM, Andy Seaborne <an...@apache.org> wrote:
> On 28/02/15 14:25, Charles Abela wrote:
>
>> Re-hi,
>> still at it with no success, unfortunately.
>>
>
> This does not look right:
> > iii. I start the server
> > ./fuseki-server --update --mem /ds
> That's an in-memory dataset.
> I don't see where it's getting any data from, let alone some triples.
>
> I would have expected:
>
> ./fuseki-server --config=config-tdb-text.ttl
>
> Did you do anything else after starting the server?
>
I load the books.ttl via the upload feature in the fuseki control panel.
> How are you executing the query?
>
using the sprql query endpoint. Later on I will be doing this
programmatically.
C
>
> Andy
>
>
> The process I'm following is the following:
>> i. I'm calling the tdb loader which executes fine as below:
>> java -cp fuseki-server.jar tdb.tdbloader --loc=DB data/books.ttl
>> INFO -- Start triples data phase
>> INFO ** Load into triples table with existing data
>> INFO -- Start quads data phase
>> INFO ** Load empty quads table
>> INFO Load: data/books.ttl -- 2015/02/28 15:04:33 CET
>> INFO -- Finish triples data phase
>> INFO ** Data: 17 triples loaded in 0.47 seconds [Rate: 36.17
>> per
>> second]
>> INFO -- Finish quads data phase
>> INFO -- Start triples index phase
>> INFO -- Finish triples index phase
>> INFO -- Finish triples load
>> INFO ** Completed: 17 triples loaded in 0.57 seconds [Rate:
>> 30.04
>> per second]
>> INFO -- Finish quads load
>>
>> ii. Im then calling the textindexer which seems to execute of as well,
>> since it says that 7 properties were indexed:
>> java -cp fuseki-server.jar jena.textindexer
>> --desc=config-tdb-text.ttl
>> INFO 7 (7 per second) properties indexed
>>
>> iii. I start the server
>> ./fuseki-server --update --mem /ds
>> 15:05:27 INFO Dataset: in-memory15:05:28 INFO Dataset path = /ds
>> 15:05:28 INFO Fuseki 1.1.1 2014-10-02T16:36:17+0100
>> 15:05:28 INFO Started 2015/02/28 15:05:28 CET on port 3030
>>
>> When I execute the query without including text:query
>>
>> PREFIX text: <http://jena.apache.org/text#>
>> PREFIX dc: <http://purl.org/dc/elements/1.1/>
>> PREFIX book: <http://example.org/book/>
>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>>
>> SELECT ?s { ?s dc:title ?x . }
>>
>> the query executes fine and the result is all the book instances
>>
>> however whenever I include ....text:query in any of the mentioned ways,
>> the
>> result returns nothing.
>>
>> the assembler I;'m using is the config-tdb-text as follows:
>>
>> # TDB
>> [] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
>> tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
>> tdb:GraphTDB rdfs:subClassOf ja:Model .
>>
>> # Text
>> [] ja:loadClass "org.apache.jena.query.text.TextQuery" .
>> text:TextDataset rdfs:subClassOf ja:RDFDataset .
>> #text:TextIndexSolr rdfs:subClassOf text:TextIndex .
>> text:TextIndexLucene rdfs:subClassOf text:TextIndex .
>>
>> ##------------------------------------------------------------------
>>
>> <#service_text_tdb> rdf:type fuseki:Service ;
>> rdfs:label "TDB/text service" ;
>> fuseki:name "ds" ;
>> fuseki:serviceQuery "query" ;
>> fuseki:serviceQuery "sparql" ;
>> fuseki:serviceUpdate "update" ;
>> fuseki:serviceUpload "upload" ;
>> fuseki:serviceReadGraphStore "get" ;
>> fuseki:serviceReadWriteGraphStore "data" ;
>> fuseki:dataset <#books> ;
>> .
>>
>> <#books> rdf:type text:TextDataset ;
>> text:dataset <#dataset> ;
>> ##text:index <#indexSolr> ;
>> text:index <#indexLucene> ;
>> .
>>
>> <#dataset> rdf:type tdb:DatasetTDB ;
>> tdb:location "DB" ;
>> ##tdb:unionDefaultGraph true ;
>> .
>>
>> <#indexLucene> a text:TextIndexLucene ;
>> text:directory <file:Lucene> ;
>> ##text:directory "mem" ;
>> text:entityMap <#entMap> ;
>> .
>>
>> <#entMap> I've defined in my previous email.
>>
>> any ideas as to why I'm not getting any results is greatly appreciated.
>>
>> cheers
>>
>>
>> On Fri, Feb 27, 2015 at 11:43 PM, Charles Abela <ch...@gmail.com>
>> wrote:
>>
>> I did not understand your question re the assembler and how it is
>>> connecting the dataset to the index. Can you elaborate pls?
>>> Re the queries I had tried them already. This one
>>>
>>> SELECT ?s { ?s dc:title ?x }
>>>
>>> returned fine, while others did not return anything.
>>>
>>>
>>> On Fri, Feb 27, 2015 at 9:42 PM, Andy Seaborne <an...@apache.org> wrote:
>>>
>>> On 27/02/15 14:07, Charles Abela wrote:
>>>>
>>>> Hi,
>>>>> I've managed to configure and run jena-fuseki. I used the
>>>>> config-tdb-text.ttl and created a lucene index over the books.ttl
>>>>> example
>>>>> (7 properties were indexed). However when I execute the query
>>>>>
>>>>> PREFIX text: <http://jena.apache.org/text#>
>>>>> PREFIX dc: <http://purl.org/dc/elements/1.1/>
>>>>> PREFIX book: <http://example.org/book/>
>>>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>>>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>>>>>
>>>>> SELECT ?s
>>>>> { ?s dc:title ?x .
>>>>> ?s text:query (dc:title 'Harry') ;
>>>>> }
>>>>>
>>>>> no tuples are returned.
>>>>>
>>>>> I've configured <#entMap> as follows:
>>>>>
>>>>>
>>>> How is the assembler connecting the dataset to the text index?
>>>>
>>>>
>>>> <#entMap> a text:EntityMap ;
>>>>> text:entityField "uri" ;
>>>>> text:defaultField "text" ; ## Should be defined in the
>>>>> text:map.
>>>>> text:map (
>>>>> [ text:field "text" ;
>>>>> text:predicate dc:title;
>>>>> text:analyzer [
>>>>> a text:StandardAnalyzer ;
>>>>> text:stopWords ("a" "an" "and" "but")
>>>>> ]
>>>>> ]
>>>>> ) .
>>>>>
>>>>> am I on the right track here?
>>>>>
>>>>>
>>>> Yes
>>>>
>>>>
>>>> am I missing or doing something wrong?
>>>>>
>>>>>
>>>> Not obviously to me.
>>>>
>>>>
>>>> thanks in advance
>>>>>
>>>>>
>>>>> Try some debugging: these queries will poke into the database:
>>>>
>>>> SELECT ?s { ?s dc:title ?x }
>>>>
>>>> SELECT ?s { ?s text:query ('Harry') }
>>>>
>>>> SELECT ?s { ?s text:query (dc:title 'Harry') }
>>>>
>>>> Andy
>>>>
>>>>
>>>>
>>>>
>>>
>>
>
Re: jena-fuseki-lucene: no results returned
Posted by Andy Seaborne <an...@apache.org>.
On 28/02/15 14:25, Charles Abela wrote:
> Re-hi,
> still at it with no success, unfortunately.
This does not look right:
> iii. I start the server
> ./fuseki-server --update --mem /ds
That's an in-memory dataset.
I don't see where it's getting any data from, let alone some triples.
I would have expected:
./fuseki-server --config=config-tdb-text.ttl
Did you do anything else after starting the server?
How are you executing the query?
Andy
> The process I'm following is the following:
> i. I'm calling the tdb loader which executes fine as below:
> java -cp fuseki-server.jar tdb.tdbloader --loc=DB data/books.ttl
> INFO -- Start triples data phase
> INFO ** Load into triples table with existing data
> INFO -- Start quads data phase
> INFO ** Load empty quads table
> INFO Load: data/books.ttl -- 2015/02/28 15:04:33 CET
> INFO -- Finish triples data phase
> INFO ** Data: 17 triples loaded in 0.47 seconds [Rate: 36.17 per
> second]
> INFO -- Finish quads data phase
> INFO -- Start triples index phase
> INFO -- Finish triples index phase
> INFO -- Finish triples load
> INFO ** Completed: 17 triples loaded in 0.57 seconds [Rate: 30.04
> per second]
> INFO -- Finish quads load
>
> ii. Im then calling the textindexer which seems to execute of as well,
> since it says that 7 properties were indexed:
> java -cp fuseki-server.jar jena.textindexer
> --desc=config-tdb-text.ttl
> INFO 7 (7 per second) properties indexed
>
> iii. I start the server
> ./fuseki-server --update --mem /ds
> 15:05:27 INFO Dataset: in-memory15:05:28 INFO Dataset path = /ds
> 15:05:28 INFO Fuseki 1.1.1 2014-10-02T16:36:17+0100
> 15:05:28 INFO Started 2015/02/28 15:05:28 CET on port 3030
>
> When I execute the query without including text:query
>
> PREFIX text: <http://jena.apache.org/text#>
> PREFIX dc: <http://purl.org/dc/elements/1.1/>
> PREFIX book: <http://example.org/book/>
> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>
> SELECT ?s { ?s dc:title ?x . }
>
> the query executes fine and the result is all the book instances
>
> however whenever I include ....text:query in any of the mentioned ways, the
> result returns nothing.
>
> the assembler I;'m using is the config-tdb-text as follows:
>
> # TDB
> [] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
> tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
> tdb:GraphTDB rdfs:subClassOf ja:Model .
>
> # Text
> [] ja:loadClass "org.apache.jena.query.text.TextQuery" .
> text:TextDataset rdfs:subClassOf ja:RDFDataset .
> #text:TextIndexSolr rdfs:subClassOf text:TextIndex .
> text:TextIndexLucene rdfs:subClassOf text:TextIndex .
>
> ##------------------------------------------------------------------
>
> <#service_text_tdb> rdf:type fuseki:Service ;
> rdfs:label "TDB/text service" ;
> fuseki:name "ds" ;
> fuseki:serviceQuery "query" ;
> fuseki:serviceQuery "sparql" ;
> fuseki:serviceUpdate "update" ;
> fuseki:serviceUpload "upload" ;
> fuseki:serviceReadGraphStore "get" ;
> fuseki:serviceReadWriteGraphStore "data" ;
> fuseki:dataset <#books> ;
> .
>
> <#books> rdf:type text:TextDataset ;
> text:dataset <#dataset> ;
> ##text:index <#indexSolr> ;
> text:index <#indexLucene> ;
> .
>
> <#dataset> rdf:type tdb:DatasetTDB ;
> tdb:location "DB" ;
> ##tdb:unionDefaultGraph true ;
> .
>
> <#indexLucene> a text:TextIndexLucene ;
> text:directory <file:Lucene> ;
> ##text:directory "mem" ;
> text:entityMap <#entMap> ;
> .
>
> <#entMap> I've defined in my previous email.
>
> any ideas as to why I'm not getting any results is greatly appreciated.
>
> cheers
>
>
> On Fri, Feb 27, 2015 at 11:43 PM, Charles Abela <ch...@gmail.com>
> wrote:
>
>> I did not understand your question re the assembler and how it is
>> connecting the dataset to the index. Can you elaborate pls?
>> Re the queries I had tried them already. This one
>>
>> SELECT ?s { ?s dc:title ?x }
>>
>> returned fine, while others did not return anything.
>>
>>
>> On Fri, Feb 27, 2015 at 9:42 PM, Andy Seaborne <an...@apache.org> wrote:
>>
>>> On 27/02/15 14:07, Charles Abela wrote:
>>>
>>>> Hi,
>>>> I've managed to configure and run jena-fuseki. I used the
>>>> config-tdb-text.ttl and created a lucene index over the books.ttl example
>>>> (7 properties were indexed). However when I execute the query
>>>>
>>>> PREFIX text: <http://jena.apache.org/text#>
>>>> PREFIX dc: <http://purl.org/dc/elements/1.1/>
>>>> PREFIX book: <http://example.org/book/>
>>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>>>>
>>>> SELECT ?s
>>>> { ?s dc:title ?x .
>>>> ?s text:query (dc:title 'Harry') ;
>>>> }
>>>>
>>>> no tuples are returned.
>>>>
>>>> I've configured <#entMap> as follows:
>>>>
>>>
>>> How is the assembler connecting the dataset to the text index?
>>>
>>>
>>>> <#entMap> a text:EntityMap ;
>>>> text:entityField "uri" ;
>>>> text:defaultField "text" ; ## Should be defined in the
>>>> text:map.
>>>> text:map (
>>>> [ text:field "text" ;
>>>> text:predicate dc:title;
>>>> text:analyzer [
>>>> a text:StandardAnalyzer ;
>>>> text:stopWords ("a" "an" "and" "but")
>>>> ]
>>>> ]
>>>> ) .
>>>>
>>>> am I on the right track here?
>>>>
>>>
>>> Yes
>>>
>>>
>>>> am I missing or doing something wrong?
>>>>
>>>
>>> Not obviously to me.
>>>
>>>
>>>> thanks in advance
>>>>
>>>>
>>> Try some debugging: these queries will poke into the database:
>>>
>>> SELECT ?s { ?s dc:title ?x }
>>>
>>> SELECT ?s { ?s text:query ('Harry') }
>>>
>>> SELECT ?s { ?s text:query (dc:title 'Harry') }
>>>
>>> Andy
>>>
>>>
>>>
>>
>
Re: jena-fuseki-lucene: no results returned
Posted by Charles Abela <ch...@gmail.com>.
Re-hi,
still at it with no success, unfortunately.
The process I'm following is the following:
i. I'm calling the tdb loader which executes fine as below:
java -cp fuseki-server.jar tdb.tdbloader --loc=DB data/books.ttl
INFO -- Start triples data phase
INFO ** Load into triples table with existing data
INFO -- Start quads data phase
INFO ** Load empty quads table
INFO Load: data/books.ttl -- 2015/02/28 15:04:33 CET
INFO -- Finish triples data phase
INFO ** Data: 17 triples loaded in 0.47 seconds [Rate: 36.17 per
second]
INFO -- Finish quads data phase
INFO -- Start triples index phase
INFO -- Finish triples index phase
INFO -- Finish triples load
INFO ** Completed: 17 triples loaded in 0.57 seconds [Rate: 30.04
per second]
INFO -- Finish quads load
ii. Im then calling the textindexer which seems to execute of as well,
since it says that 7 properties were indexed:
java -cp fuseki-server.jar jena.textindexer
--desc=config-tdb-text.ttl
INFO 7 (7 per second) properties indexed
iii. I start the server
./fuseki-server --update --mem /ds
15:05:27 INFO Dataset: in-memory15:05:28 INFO Dataset path = /ds
15:05:28 INFO Fuseki 1.1.1 2014-10-02T16:36:17+0100
15:05:28 INFO Started 2015/02/28 15:05:28 CET on port 3030
When I execute the query without including text:query
PREFIX text: <http://jena.apache.org/text#>
PREFIX dc: <http://purl.org/dc/elements/1.1/>
PREFIX book: <http://example.org/book/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT ?s { ?s dc:title ?x . }
the query executes fine and the result is all the book instances
however whenever I include ....text:query in any of the mentioned ways, the
result returns nothing.
the assembler I;'m using is the config-tdb-text as follows:
# TDB
[] ja:loadClass "com.hp.hpl.jena.tdb.TDB" .
tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .
# Text
[] ja:loadClass "org.apache.jena.query.text.TextQuery" .
text:TextDataset rdfs:subClassOf ja:RDFDataset .
#text:TextIndexSolr rdfs:subClassOf text:TextIndex .
text:TextIndexLucene rdfs:subClassOf text:TextIndex .
##------------------------------------------------------------------
<#service_text_tdb> rdf:type fuseki:Service ;
rdfs:label "TDB/text service" ;
fuseki:name "ds" ;
fuseki:serviceQuery "query" ;
fuseki:serviceQuery "sparql" ;
fuseki:serviceUpdate "update" ;
fuseki:serviceUpload "upload" ;
fuseki:serviceReadGraphStore "get" ;
fuseki:serviceReadWriteGraphStore "data" ;
fuseki:dataset <#books> ;
.
<#books> rdf:type text:TextDataset ;
text:dataset <#dataset> ;
##text:index <#indexSolr> ;
text:index <#indexLucene> ;
.
<#dataset> rdf:type tdb:DatasetTDB ;
tdb:location "DB" ;
##tdb:unionDefaultGraph true ;
.
<#indexLucene> a text:TextIndexLucene ;
text:directory <file:Lucene> ;
##text:directory "mem" ;
text:entityMap <#entMap> ;
.
<#entMap> I've defined in my previous email.
any ideas as to why I'm not getting any results is greatly appreciated.
cheers
On Fri, Feb 27, 2015 at 11:43 PM, Charles Abela <ch...@gmail.com>
wrote:
> I did not understand your question re the assembler and how it is
> connecting the dataset to the index. Can you elaborate pls?
> Re the queries I had tried them already. This one
>
> SELECT ?s { ?s dc:title ?x }
>
> returned fine, while others did not return anything.
>
>
> On Fri, Feb 27, 2015 at 9:42 PM, Andy Seaborne <an...@apache.org> wrote:
>
>> On 27/02/15 14:07, Charles Abela wrote:
>>
>>> Hi,
>>> I've managed to configure and run jena-fuseki. I used the
>>> config-tdb-text.ttl and created a lucene index over the books.ttl example
>>> (7 properties were indexed). However when I execute the query
>>>
>>> PREFIX text: <http://jena.apache.org/text#>
>>> PREFIX dc: <http://purl.org/dc/elements/1.1/>
>>> PREFIX book: <http://example.org/book/>
>>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>>>
>>> SELECT ?s
>>> { ?s dc:title ?x .
>>> ?s text:query (dc:title 'Harry') ;
>>> }
>>>
>>> no tuples are returned.
>>>
>>> I've configured <#entMap> as follows:
>>>
>>
>> How is the assembler connecting the dataset to the text index?
>>
>>
>>> <#entMap> a text:EntityMap ;
>>> text:entityField "uri" ;
>>> text:defaultField "text" ; ## Should be defined in the
>>> text:map.
>>> text:map (
>>> [ text:field "text" ;
>>> text:predicate dc:title;
>>> text:analyzer [
>>> a text:StandardAnalyzer ;
>>> text:stopWords ("a" "an" "and" "but")
>>> ]
>>> ]
>>> ) .
>>>
>>> am I on the right track here?
>>>
>>
>> Yes
>>
>>
>>> am I missing or doing something wrong?
>>>
>>
>> Not obviously to me.
>>
>>
>>> thanks in advance
>>>
>>>
>> Try some debugging: these queries will poke into the database:
>>
>> SELECT ?s { ?s dc:title ?x }
>>
>> SELECT ?s { ?s text:query ('Harry') }
>>
>> SELECT ?s { ?s text:query (dc:title 'Harry') }
>>
>> Andy
>>
>>
>>
>
Re: jena-fuseki-lucene: no results returned
Posted by Charles Abela <ch...@gmail.com>.
I did not understand your question re the assembler and how it is
connecting the dataset to the index. Can you elaborate pls?
Re the queries I had tried them already. This one
SELECT ?s { ?s dc:title ?x }
returned fine, while others did not return anything.
On Fri, Feb 27, 2015 at 9:42 PM, Andy Seaborne <an...@apache.org> wrote:
> On 27/02/15 14:07, Charles Abela wrote:
>
>> Hi,
>> I've managed to configure and run jena-fuseki. I used the
>> config-tdb-text.ttl and created a lucene index over the books.ttl example
>> (7 properties were indexed). However when I execute the query
>>
>> PREFIX text: <http://jena.apache.org/text#>
>> PREFIX dc: <http://purl.org/dc/elements/1.1/>
>> PREFIX book: <http://example.org/book/>
>> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
>> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>>
>> SELECT ?s
>> { ?s dc:title ?x .
>> ?s text:query (dc:title 'Harry') ;
>> }
>>
>> no tuples are returned.
>>
>> I've configured <#entMap> as follows:
>>
>
> How is the assembler connecting the dataset to the text index?
>
>
>> <#entMap> a text:EntityMap ;
>> text:entityField "uri" ;
>> text:defaultField "text" ; ## Should be defined in the
>> text:map.
>> text:map (
>> [ text:field "text" ;
>> text:predicate dc:title;
>> text:analyzer [
>> a text:StandardAnalyzer ;
>> text:stopWords ("a" "an" "and" "but")
>> ]
>> ]
>> ) .
>>
>> am I on the right track here?
>>
>
> Yes
>
>
>> am I missing or doing something wrong?
>>
>
> Not obviously to me.
>
>
>> thanks in advance
>>
>>
> Try some debugging: these queries will poke into the database:
>
> SELECT ?s { ?s dc:title ?x }
>
> SELECT ?s { ?s text:query ('Harry') }
>
> SELECT ?s { ?s text:query (dc:title 'Harry') }
>
> Andy
>
>
>
Re: jena-fuseki-lucene: no results returned
Posted by Andy Seaborne <an...@apache.org>.
On 27/02/15 14:07, Charles Abela wrote:
> Hi,
> I've managed to configure and run jena-fuseki. I used the
> config-tdb-text.ttl and created a lucene index over the books.ttl example
> (7 properties were indexed). However when I execute the query
>
> PREFIX text: <http://jena.apache.org/text#>
> PREFIX dc: <http://purl.org/dc/elements/1.1/>
> PREFIX book: <http://example.org/book/>
> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
>
> SELECT ?s
> { ?s dc:title ?x .
> ?s text:query (dc:title 'Harry') ;
> }
>
> no tuples are returned.
>
> I've configured <#entMap> as follows:
How is the assembler connecting the dataset to the text index?
>
> <#entMap> a text:EntityMap ;
> text:entityField "uri" ;
> text:defaultField "text" ; ## Should be defined in the
> text:map.
> text:map (
> [ text:field "text" ;
> text:predicate dc:title;
> text:analyzer [
> a text:StandardAnalyzer ;
> text:stopWords ("a" "an" "and" "but")
> ]
> ]
> ) .
>
> am I on the right track here?
Yes
>
> am I missing or doing something wrong?
Not obviously to me.
>
> thanks in advance
>
Try some debugging: these queries will poke into the database:
SELECT ?s { ?s dc:title ?x }
SELECT ?s { ?s text:query ('Harry') }
SELECT ?s { ?s text:query (dc:title 'Harry') }
Andy