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

--
Lingsoft - 30 years of Leading Language Management

www.lingsoft.fi

Speech Applications - Language Management - Translation - Reader's and Writer's 
Tools - Text Tools - E-books and M-books

Mikael Pesonen
System Engineer

e-mail: [email protected]
Tel. +358 2 279 3300

Time zone: GMT+2

Helsinki Office
Eteläranta 10
FI-00130 Helsinki
FINLAND

Turku Office
Kauppiaskatu 5 A
FI-20100 Turku
FINLAND

Reply via email to