Hi,

after reading most (I hope) of the documentation and questions on indexing
in Fuseki,  these are my questions:

I load my data programmatically in Fuseki and then I do the following:

*1.  Effort No1*
*Start Fuseki with the following config file by using this command
: fuseki-server --config=config-tdb-text-test.ttl*
**********************************************************************************************************
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

## Example of a TDB dataset and text index published using Fuseki

@prefix :        <#> .
@prefix fuseki:  <http://jena.apache.org/fuseki#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb:     <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja:      <http://jena.hpl.hp.com/2005/11/Assembler#> .
@prefix text:    <http://jena.apache.org/text#> .
@prefix skos:    <http://www.w3.org/2004/02/skos/core#> .

[] rdf:type fuseki:Server ;
   # Timeout - server-wide default: milliseconds.
   # Format 1: "1000" -- 1 second timeout
   # Format 2: "10000,60000" -- 10s timeout to first result, then 60s
timeout to for rest of query.
   # See java doc for ARQ.queryTimeout
   # ja:context [ ja:cxtName "arq:queryTimeout" ;  ja:cxtValue "10000" ] ;
   # ja:loadClass "your.code.Class" ;

   fuseki:services (
     <#service_text_tdb>
   ) .

# 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                  <#text_dataset> ;
    .

<#text_dataset> 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> a text:EntityMap ;
    text:entityField      "uri" ;
    text:defaultField     "text" ;        ## Should be defined in the
text:map.
    text:map (
         # skos:prefLabel
         [ text:field "text" ; text:predicate skos:notation ]
         ) .

*************************************************************************************************************

The sparql endpoint returns the triples for simple queries like this:

prefix text:    <http://jena.apache.org/text#>
prefix skos:    <http://www.w3.org/2004/02/skos/core#>
select * where {?x a skos:Collection .} limit 100

but it returns empty result set for indexed queries like this:
prefix text:    <http://jena.apache.org/text#>
prefix skos:    <http://www.w3.org/2004/02/skos/core#>
select * where {?x text:query 'a' .} limit 100


*Effort No 2. Use the above mentioned file to index and then the same file
to start up fuseki:*

N:\fuseki\jena-fuseki1-1.1.2>java -cp fuseki-server.jar jena.textindexer
--desc=
config-tdb-text-test.ttl
Result:
INFO  93776 (2404 per second) properties indexed

Then start up fuseki:
N:\fuseki\jena-fuseki1-1.1.2>fuseki-server --config=config-tdb-text-test.ttl
10:46:57 INFO  Dataset path = /ds
10:46:57 INFO  Fuseki 1.1.2 2015-03-08T09:49:20+0000
10:46:57 INFO  Started 2015/07/09 10:46:57 BST on port 3030

I do the same  queries and again text:query does not return any results...

Could you please help me on what is going wrong?


Thanks very much.

Alexandra

Reply via email to