Hello Mikael,

the config file should define

1)  the TDB dataset

2) the Lucene dataset that wraps the TDB dataset

3) the service should point to the Lucene dataset

In addition, you have to run the text indexer once to create the Lucene
index.


Once this is done, you have to check the Lucene query syntax. IIRC,
"medi" will just match text containing the full word "medi". Lucene is
just an inverted index of the tokens (aka words) occurring in the text
(aka skos:prefLabel). Substring matches would need a wildcard query,
e.g. "medi*" and similar. Or you have to change tokenizer, analyzer etc.



Cheers,
Lorenz

>
>
> On 18/01/2019 13:40, Andy Seaborne wrote:
>>
>>
>> On 17/01/2019 15:45, Mikael Pesonen wrote:
>>>
>>>
>>> On 17/01/2019 17:38, Andy Seaborne wrote:
>>>>
>>>>
>>>> On 17/01/2019 12:51, Mikael Pesonen wrote:
>>>>>
>>>>>
>>>>> On 17/01/2019 13:58, Andy Seaborne wrote:
>>>>>>
>>>>>>
>>>>>> On 16/01/2019 12:50, Mikael Pesonen wrote:
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> I'm trying to get text search work. Sparql REGEX takes few
>>>>>>> seconds to finish so hoping this would be faster. Application is
>>>>>>> term search using SKOS ontology.
>>>>>>>
>>>>>>>   First tested if it's enabled by default
>>>>>>>
>>>>>>>   ?concept text:query (skos:prefLabel "medi") .
>>>>>>>    ?concept skos:prefLabel ?prefLabel
>>>>>>>
>>>>>>> That returns all concepts so I guess it's not enabled.
>>>>>>
>>>>>> If it returns all concepts, the first line matched (otherwise you
>>>>>> get none). If so, there is a text index and "medi" (case
>>>>>> insensitive) matches Lucene rules, everything.
>>>>> What does this mean then, why is it matching everything?
>>>>
>>>> If zero matches, you don't get to ?concept skos:prefLabel
>>>> ?prefLabel (if the text index is correct)
>>>>
>>>> The query above, if the index is setup correctly,  gets all
>>>> concepts where any skos:prefLabel matches "medi" (not just at the
>>>> start), then gets all skos:prefLabel for those concepts. That does
>>>> not mean ?prefLabel only matches "medi"
>>>>
>>>> :c skos:prefLabel "medi" ;
>>>>    skos:prefLabel "Other" .
>>>>
>>>> will return 2 matches including ?prefLabel="Other"
>>> Yes that is how I understood it. But  ?concept text:query
>>> (skos:prefLabel "medi")  returns all concepts, also those that don't
>>> have any label having "medi".
>>
>> Then I don't understand what is going on.
>>
>> Do you have a complete, minimal example that someone can use to
>> recreate the situation?
>>
> This is the query:
>
> PREFIX skos: <http://www.w3.org/2004/02/skos/core#>
> PREFIX text: <http://jena.apache.org/text#>
> SELECT *
> WHERE
> {
>   GRAPH <http://www.yso.fi/onto/mesh/>
>   {
>     ?concept text:query (skos:prefLabel "medi") .
>     ?concept skos:prefLabel ?prefLabel .
>
>     # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>   }
> }
> limit 10
>
> and graph is dump copied from here:  https://finto.fi/mesh/en/
> end of page "Download this vocabulary"
>
> So to make clear, we have made zero configuration on jena/fuseki, all
> is default from 3.9.0 package.
>> Andy
>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

Reply via email to