You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by Mikael Pesonen <mi...@lingsoft.fi> on 2019/01/16 12:50:06 UTC

Text search from sparql

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.

Then copied Text Dataset Assembler from 
https://jena.apache.org/documentation/query/text-query.html#configuration 
into apache-jena-fuseki-3.9.0/run/configuration
With that fuseki start fails:

Jan 16 14:40:03 semantic-dev java[17961]: [2019-01-16 14:40:03] 
WebAppContext WARN  Failed startup of context 
o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
Jan 16 14:40:03 semantic-dev java[17961]:         at 
org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
Jan 16 14:40:03 semantic-dev java[17961]:         at 
org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178)
Jan 16 14:40:03 semantic-dev java[17961]:         at 
org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226)
Jan 16 14:40:03 semantic-dev java[17961]:         at 
org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98)
Jan 16 14:40:03 semantic-dev java[17961]:         at 
org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
Jan 16 14:40:03 semantic-dev java[17961]:         at 
org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
Jan 16 14:40:03 semantic-dev java[17961]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
Jan 16 14:40:03 semantic-dev java[17961]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
Jan 16 14:40:03 semantic-dev java[17961]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
Jan 16 14:40:03 semantic-dev java[17961]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)

Otherwise all settings are default. Any tips what to try next?


Re: Text search from sparql

Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
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


Re: Text search from sparql

Posted by Chris Tomlinson <ch...@gmail.com>.
Hi again,

Indeed, if there is no TextIndex configured then the text:query will return null to the surrounding context:


        Log.warn(TextQueryPF.class, "Failed to find the text index : tried context and as a text-enabled dataset") ;
        return null ;

So you could perhaps verify that when you see all concepts returned that there is a log message indicating that the TextIndex is missing for the dataset.

Thanks,
Chris


> On Jan 18, 2019, at 10:13 AM, Chris Tomlinson <ch...@gmail.com> wrote:
> 
> Hi,
> 
> 1) If you’re using a default config, it does not have a working jena-text configuration. The config will need to  include skos:prefLabel in the entity map.
> 
> 2) when you change the jena-text in significant ways, such as changing what analyzer is used for a given property and so on, then you’ll need to rebuild the Lucene index via reloading the dataset or using the textIndexer <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. I don’t recall this being mentioned as part of your testing
> 
> 3) Please indicate exactly which item you’re using jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and the config file itself. The error you’ve mentioned previously:
> 
>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] Config     INFO  Load configuration: file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>> Jan 17 17:00:28 semantic-dev java[16800]:         at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
> 
> suggests to me that something in the config file is confusing the readAssemblerFile. It doesn’t look like it’s failing in the reading the jena-text portion of the config.
> 
> If http://api.finto.fi/download/mesh/mesh-skos.ttl <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then can you cut it down to just a small test case with some concepts with “medi” and a few without? That along with the other information should help move this further along..
> 
> 4) Your query: 
> 
>> PREFIX skos: <http://www.w3.org/2004/02/skos/core# <http://www.w3.org/2004/02/skos/core#>>
>> PREFIX text: <http://jena.apache.org/text# <http://jena.apache.org/text#>>
>> SELECT *
>> WHERE
>> {
>>   GRAPH <http://www.yso.fi/onto/mesh/ <http://www.yso.fi/onto/mesh/>>
>>   {
>>     ?concept text:query (skos:prefLabel "medi") .
>>     ?concept skos:prefLabel ?prefLabel .
>> 
>>     # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>   }
>> }
>> limit 10
> 
> might effectively just be executing:
> 
>> ?concept skos:prefLabel ?prefLabel .
> 
> if there is actually no jena-text config - I haven’t checked what happens when there is no TextIndex configured and the text:query is invoked, but may be a noop
> 
> Thanks,
> Chris
> 
> 
>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen <mikael.pesonen@lingsoft.fi <ma...@lingsoft.fi>> wrote:
>> 
>> 
>> 
>> 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# <http://www.w3.org/2004/02/skos/core#>>
>> PREFIX text: <http://jena.apache.org/text# <http://jena.apache.org/text#>>
>> SELECT *
>> WHERE
>> {
>>   GRAPH <http://www.yso.fi/onto/mesh/ <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/ <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 <http://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: mikael.pesonen@lingsoft.fi
>> 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
>> 
> 


Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
Thanks I'll change that to something better when have working setup.

On 22/01/2019 17:28, vincent ventresque wrote:
> Maybe it doesn't have any connection with your problem but I noticed 
> you have a /tmp directory for your index : don't know if your /tmp 
> directory is erased when you reboot, but you may have trouble when 
> restarting Fuseki
>
> text:directory<file:/tmp/tdb-lucene-index>
>
> Le 22/01/2019 à 16:21, Mikael Pesonen a écrit :
>>
>> Sorry had issues with permissions. So now I can load configuration 
>> from cmd line
>>
>> /usr/bin/java 
>> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
>> -Xmx5600M -jar fuseki-server.jar --update --port 3030 
>> --config=run/config.ttl
>>
>> and Indexer works
>> ...
>> INFO  2060054 (32699 per second) properties indexed
>>
>> and sparql text search works. Only issue remaining is that now 
>> Skosmos application (and possible some others) stopped working. 
>> Fuseki log says
>>  Fuseki     INFO  [2] 404 Not found: dataset='ds' service='sparql' (1 
>> ms)
>>
>> Here is the config where I updated tdb:location:
>>
>> @prefix :<http://localhost/jena_example/#>  .
>> @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#>
>> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>>
>> ## Example of a TDB dataset and text index
>> ## Initialize TDB
>> [] ja:loadClass "org.apache.jena.tdb.TDB" .
>> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
>> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>>
>> ## Initialize text query
>> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
>> # A TextDataset is a regular dataset with a text index.
>> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
>> # Lucene index
>> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>>
>>
>> ## ---------------------------------------------------------------
>>
>>
>> :text_dataset rdf:type     text:TextDataset ;
>>      text:dataset   :my_dataset ;
>>      text:index     <#indexLucene> ;
>>      .
>>
>> # A TDB dataset used for RDF storage
>> :my_dataset rdf:type      tdb:DatasetTDB ;
>>      tdb:location "/home/text/tools/jena_data_test/" ;
>> #    tdb:unionDefaultGraph true ; # Optional
>>      .
>>
>> # Text index description
>> <#indexLucene> a text:TextIndexLucene ;
>>      text:directory<file:/tmp/tdb-lucene-index>  ;
>>      text:entityMap <#entMap> ;
>>      text:storeValues true ;
>>      text:analyzer [ a text:StandardAnalyzer ] ;
>>      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>>      text:queryParser text:AnalyzingQueryParser ;
>>      text:multilingualSupport true ;
>>   .
>>
>> <#entMap> a text:EntityMap ;
>>      text:defaultField     "label" ;
>>      text:entityField      "uri" ;
>>      text:uidField         "uid" ;
>>      text:langField        "lang" ;
>>      text:graphField       "graph" ;
>>      text:map (
>>           [ text:field "label" ;
>>             text:predicate skos:prefLabel ]
>>           ) .
>>
>> <#service> rdf:type fuseki:Service ;
>>      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
>>      fuseki:serviceQuery             "query" ;    # SPARQL query service
>>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph 
>> store protocol (read only)
>>      fuseki:dataset           :text_dataset ;
>>      .
>>
>>
>>
>> On 22/01/2019 17:01, Lorenz B. wrote:
>>> Can't reproduce this. With the config file I shared with you, it works
>>> for me as expected with Fuseki 3.10.0
>>>
>>> Which config file do you use now?
>>>
>>>> On 22/01/2019 16:17, vincent ventresque wrote:
>>>>> Hello
>>>>>
>>>>> If the configuration folder is empty, the run/config.ttl (default
>>>>> file) should be the one that Fuseki uses : you should try to replace
>>>>> the content of run/config.ttl with the one Chris has sent in previous
>>>>> msg
>>>>>
>>>> That worked!
>>>>
>>>> So now with the example Lorenz posted I get
>>>>
>>>>   java -cp ./fuseki-server.jar jena.textindexer --desc=run/config.ttl
>>>> org.apache.jena.sparql.ARQException: No such type:
>>>> <http://jena.apache.org/text#TextDataset>
>>>>          at
>>>> org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122) 
>>>>
>>>>          at
>>>> org.apache.jena.query.text.TextDatasetFactory.create(TextDatasetFactory.java:38) 
>>>>
>>>>          at 
>>>> jena.textindexer.processModulesAndArgs(textindexer.java:90)
>>>>          at jena.cmd.CmdArgModule.process(CmdArgModule.java:52)
>>>>          at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
>>>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>>>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>>>>          at jena.textindexer.main(textindexer.java:52)
>>>>
>>>>
>>>> @prefix :<http://localhost/jena_example/#>  .
>>>> @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#>
>>>> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>>>>
>>>> ## Example of a TDB dataset and text index
>>>> ## Initialize TDB
>>>> [] ja:loadClass "org.apache.jena.tdb.TDB" .
>>>> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
>>>> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>>>>
>>>> ## Initialize text query
>>>> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
>>>> # A TextDataset is a regular dataset with a text index.
>>>> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
>>>> # Lucene index
>>>> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>>>>
>>>>
>>>> ## ---------------------------------------------------------------
>>>>
>>>>
>>>> :text_dataset rdf:type     text:TextDataset ;
>>>>      text:dataset   :my_dataset ;
>>>>      text:index     <#indexLucene> ;
>>>>      .
>>>>
>>>> # A TDB dataset used for RDF storage
>>>> :my_dataset rdf:type      tdb:DatasetTDB ;
>>>>      tdb:location "/tmp/tdb-dataset/" ;
>>>> #    tdb:unionDefaultGraph true ; # Optional
>>>>      .
>>>>
>>>> # Text index description
>>>> <#indexLucene> a text:TextIndexLucene ;
>>>>      text:directory<file:/tmp/tdb-lucene-index>  ;
>>>>      text:entityMap <#entMap> ;
>>>>      text:storeValues true ;
>>>>      text:analyzer [ a text:StandardAnalyzer ] ;
>>>>      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>>>>      text:queryParser text:AnalyzingQueryParser ;
>>>>      text:multilingualSupport true ;
>>>>   .
>>>>
>>>> <#entMap> a text:EntityMap ;
>>>>      text:defaultField     "label" ;
>>>>      text:entityField      "uri" ;
>>>>      text:uidField         "uid" ;
>>>>      text:langField        "lang" ;
>>>>      text:graphField       "graph" ;
>>>>      text:map (
>>>>           [ text:field "label" ;
>>>>             text:predicate skos:prefLabel ]
>>>>           ) .
>>>>
>>>> <#service> rdf:type fuseki:Service ;
>>>>      fuseki:name                     "/ds" ;   # 
>>>> http://host:port/ds-ro
>>>>      fuseki:serviceQuery             "query" ;    # SPARQL query 
>>>> service
>>>>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
>>>> protocol (read only)
>>>>      fuseki:dataset           :text_dataset ;
>>>>      .
>>>>
>>>>> Le 22/01/2019 à 14:58, Mikael Pesonen a écrit :
>>>>>> Hi,
>>>>>>
>>>>>> we haven't made any configuration files, so configuration folder is
>>>>>> empty. Everything is working fine except text search so are there
>>>>>> some advances for doing custom config? I understand now that for
>>>>>> text search we need the config and about that I asked for help.
>>>>>>
>>>>>> On 21/01/2019 19:24, Chris Tomlinson wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> You’ve presented your system service configuration. We need to see
>>>>>>> the configuration file
>>>>>>> <http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html> 
>>>>>>>
>>>>>>> in:
>>>>>>>
>>>>>>>       $FUSEKI_BASE/configuration/text_svc.ttl
>>>>>>>
>>>>>>> It is a ttl file that is interpreted by the assembler system to
>>>>>>> build the endpoints and dataset components. This is where the
>>>>>>> jena-text configuration info will go. Here is a sample
>>>>>>> configuration based on info in your service defn:
>>>>>>>
>>>>>>>> # Fuseki configuration for BDRC, configures two endpoints:
>>>>>>>> #   - /bdrc is read-only
>>>>>>>> #   - /bdrcrw is read-write
>>>>>>>> #
>>>>>>>> # This was painful to come up with but the web interface basically
>>>>>>>> allows no option
>>>>>>>> # and there is no subclass inference by default so such a
>>>>>>>> configuration file is necessary.
>>>>>>>> #
>>>>>>>> # The main doc sources are:
>>>>>>>> #  -
>>>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html 
>>>>>>>>
>>>>>>>>
>>>>>>>> #  -
>>>>>>>> https://jena.apache.org/documentation/assembler/assembler-howto.html 
>>>>>>>>
>>>>>>>> #  - https://jena.apache.org/documentation/assembler/assembler.ttl
>>>>>>>> #
>>>>>>>> # See
>>>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-layout.html
>>>>>>>> for the destination of this file.
>>>>>>>>
>>>>>>>> @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#> .
>>>>>>>> @prefix :        <http://base/#> .
>>>>>>>>
>>>>>>>> [] rdf:type fuseki:Server ;
>>>>>>>>      fuseki:services (
>>>>>>>>        :text_svc
>>>>>>>>      ) .
>>>>>>>>
>>>>>>>> :text_svc rdf:type fuseki:Service ;
>>>>>>>>       fuseki:name                       "text_svc" ;     # name of
>>>>>>>> the dataset in the url
>>>>>>>>       fuseki:serviceQuery               "query" ; # SPARQL query
>>>>>>>> service
>>>>>>>>       fuseki:serviceUpdate              "update" ; # SPARQL
>>>>>>>> update service
>>>>>>>>       fuseki:serviceUpload              "upload" ; # Non-SPARQL
>>>>>>>> upload service
>>>>>>>>       fuseki:serviceReadWriteGraphStore "data" ; # SPARQL Graph
>>>>>>>> store protocol (read and write)
>>>>>>>>       fuseki:dataset :text_dataset ;
>>>>>>>>       .
>>>>>>>>
>>>>>>>> :text_dataset rdf:type     text:TextDataset ;
>>>>>>>>       text:dataset   :tdb_dataset ;
>>>>>>>>       text:index     :lucene_index ;
>>>>>>>>       .
>>>>>>>>
>>>>>>>> # using TDB
>>>>>>>> :tdb_dataset rdf:type tdb:DatasetTDB ;
>>>>>>>>        tdb:location
>>>>>>>> "/home/text/tools/apache-jena-fuseki-3.9.0/run/tdb_dataset" ;
>>>>>>>>        tdb:unionDefaultGraph true ;
>>>>>>>>        .
>>>>>>>>
>>>>>>>> # Text index description
>>>>>>>> :lucene_index a text:TextIndexLucene ;
>>>>>>>>       text:directory
>>>>>>>> <file:/home/text/tools/apache-jena-fuseki-3.9.0/run/lucene_index> 
>>>>>>>> ;
>>>>>>>>       text:storeValues true ;
>>>>>>>>       text:entityMap :entitymap ;
>>>>>>>>       .
>>>>>>>>
>>>>>>>> # Index mappings
>>>>>>>> :entitymap a text:EntityMap ;
>>>>>>>>       text:entityField      "uri" ;
>>>>>>>>       text:uidField         "uid" ;
>>>>>>>>       text:defaultField     "label" ;
>>>>>>>>       text:langField        "lang" ;
>>>>>>>>       text:graphField       "graph" ; ## enable graph-specific
>>>>>>>> indexing
>>>>>>>>       text:map (
>>>>>>>>            [ text:field "label" ;
>>>>>>>>              text:predicate skos:prefLabel ]
>>>>>>>>            ) ;
>>>>>>>>       .
>>>>>>> hth,
>>>>>>> Chris
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>> On Jan 21, 2019, at 5:21 AM, Mikael Pesonen
>>>>>>>> <mi...@lingsoft.fi> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>>
>>>>>>>> On 18/01/2019 18:13, Chris Tomlinson wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> 1) If you’re using a default config, it does not have a working
>>>>>>>>> jena-text configuration. The config will need to include
>>>>>>>>> skos:prefLabel in the entity map.
>>>>>>>>>
>>>>>>>>> 2) when you change the jena-text in significant ways, such as
>>>>>>>>> changing what analyzer is used for a given property and so on,
>>>>>>>>> then you’ll need to rebuild the Lucene index via reloading the
>>>>>>>>> dataset or using the textIndexer
>>>>>>>>> <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. 
>>>>>>>>>
>>>>>>>>> I don’t recall this being mentioned as part of your testing
>>>>>>>>>
>>>>>>>>> 3) Please indicate exactly which item you’re using
>>>>>>>>> jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc,
>>>>>>>>> and the config file itself. The error you’ve mentioned 
>>>>>>>>> previously:
>>>>>>>> We are running Fuseki as service
>>>>>>>>
>>>>>>>> -----
>>>>>>>> [Unit]
>>>>>>>> Description=Apache Jena Fuseki
>>>>>>>>
>>>>>>>> [Service]
>>>>>>>> Type=simple
>>>>>>>> User=fuseki
>>>>>>>> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
>>>>>>>> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
>>>>>>>> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run 
>>>>>>>>
>>>>>>>> ExecStart=/usr/bin/java
>>>>>>>> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
>>>>>>>>
>>>>>>>> -Xmx5600M -jar
>>>>>>>> /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar
>>>>>>>> --update --port 3030 --loc=/home/text/tools/jena_data_test/ /ds
>>>>>>>>
>>>>>>>> [Install]
>>>>>>>> WantedBy=multi-user.target
>>>>>>>> -----
>>>>>>>>
>>>>>>>> All settings are default otherwise, we haven't changed any config
>>>>>>>> file.
>>>>>>>>
>>>>>>>> Are there some minimal settings to this example config so that I
>>>>>>>> could get skos:prefLabel working?
>>>>>>>>
>>>>>>>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> So when we have a working configuration/assembler file, all is
>>>>>>>> needed is to build the index
>>>>>>>>
>>>>>>>> java  -cp  $FUSEKI_HOME/fuseki-server.jar jena.textindexer
>>>>>>>> --desc=assembler_file ?
>>>>>>>>
>>>>>>>>
>>>>>>>> Thank everyone for the help
>>>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>>>>>>>>> Config     INFO  Load configuration:
>>>>>>>>>> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl 
>>>>>>>>>>
>>>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl> 
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>>>>>>>>> WebAppContext WARN  Failed startup of context
>>>>>>>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki
>>>>>>>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE 
>>>>>>>>>>
>>>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>} 
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: at
>>>>>>>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148) 
>>>>>>>>>>
>>>>>>>>> suggests to me that something in the config file is confusing the
>>>>>>>>> readAssemblerFile. It doesn’t look like it’s failing in the
>>>>>>>>> reading the jena-text portion of the config.
>>>>>>>>>
>>>>>>>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl
>>>>>>>>> <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset,
>>>>>>>>> then can you cut it down to just a small test case with some
>>>>>>>>> concepts with “medi” and a few without? That along with the other
>>>>>>>>> information should help move this further along..
>>>>>>>>>
>>>>>>>>> 4) Your query:
>>>>>>>>>
>>>>>>>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core#
>>>>>>>>>> <http://www.w3.org/2004/02/skos/core#>>
>>>>>>>>>> PREFIX text: <http://jena.apache.org/text#
>>>>>>>>>> <http://jena.apache.org/text#>>
>>>>>>>>>> SELECT *
>>>>>>>>>> WHERE
>>>>>>>>>> {
>>>>>>>>>>     GRAPH <http://www.yso.fi/onto/mesh/
>>>>>>>>>> <http://www.yso.fi/onto/mesh/>>
>>>>>>>>>>     {
>>>>>>>>>>       ?concept text:query (skos:prefLabel "medi") .
>>>>>>>>>>       ?concept skos:prefLabel ?prefLabel .
>>>>>>>>>>
>>>>>>>>>>       # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>>>>>>>>     }
>>>>>>>>>> }
>>>>>>>>>> limit 10
>>>>>>>>> might effectively just be executing:
>>>>>>>>>
>>>>>>>>>> ?concept skos:prefLabel ?prefLabel .
>>>>>>>>> if there is actually no jena-text config - I haven’t checked what
>>>>>>>>> happens when there is no TextIndex configured and the text:query
>>>>>>>>> is invoked, but may be a noop
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Chris
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen
>>>>>>>>>> <mi...@lingsoft.fi> wrote:
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>>>>>>> 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
>>>>>>>>>>
>>>>>>>> -- 
>>>>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>>>>> 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
>>>>>>>>
>>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by vincent ventresque <vi...@ens-lyon.fr>.
Maybe it doesn't have any connection with your problem but I noticed you 
have a /tmp directory for your index : don't know if your /tmp directory 
is erased when you reboot, but you may have trouble when restarting Fuseki

text:directory<file:/tmp/tdb-lucene-index>

Le 22/01/2019 à 16:21, Mikael Pesonen a écrit :
>
> Sorry had issues with permissions. So now I can load configuration 
> from cmd line
>
> /usr/bin/java 
> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
> -Xmx5600M -jar fuseki-server.jar --update --port 3030 
> --config=run/config.ttl
>
> and Indexer works
> ...
> INFO  2060054 (32699 per second) properties indexed
>
> and sparql text search works. Only issue remaining is that now Skosmos 
> application (and possible some others) stopped working. Fuseki log says
>  Fuseki     INFO  [2] 404 Not found: dataset='ds' service='sparql' (1 ms)
>
> Here is the config where I updated tdb:location:
>
> @prefix :<http://localhost/jena_example/#>  .
> @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#>
> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>
> ## Example of a TDB dataset and text index
> ## Initialize TDB
> [] ja:loadClass "org.apache.jena.tdb.TDB" .
> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>
> ## Initialize text query
> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
> # A TextDataset is a regular dataset with a text index.
> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
> # Lucene index
> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>
>
> ## ---------------------------------------------------------------
>
>
> :text_dataset rdf:type     text:TextDataset ;
>      text:dataset   :my_dataset ;
>      text:index     <#indexLucene> ;
>      .
>
> # A TDB dataset used for RDF storage
> :my_dataset rdf:type      tdb:DatasetTDB ;
>      tdb:location "/home/text/tools/jena_data_test/" ;
> #    tdb:unionDefaultGraph true ; # Optional
>      .
>
> # Text index description
> <#indexLucene> a text:TextIndexLucene ;
>      text:directory<file:/tmp/tdb-lucene-index>  ;
>      text:entityMap <#entMap> ;
>      text:storeValues true ;
>      text:analyzer [ a text:StandardAnalyzer ] ;
>      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>      text:queryParser text:AnalyzingQueryParser ;
>      text:multilingualSupport true ;
>   .
>
> <#entMap> a text:EntityMap ;
>      text:defaultField     "label" ;
>      text:entityField      "uri" ;
>      text:uidField         "uid" ;
>      text:langField        "lang" ;
>      text:graphField       "graph" ;
>      text:map (
>           [ text:field "label" ;
>             text:predicate skos:prefLabel ]
>           ) .
>
> <#service> rdf:type fuseki:Service ;
>      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
>      fuseki:serviceQuery             "query" ;    # SPARQL query service
>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store 
> protocol (read only)
>      fuseki:dataset           :text_dataset ;
>      .
>
>
>
> On 22/01/2019 17:01, Lorenz B. wrote:
>> Can't reproduce this. With the config file I shared with you, it works
>> for me as expected with Fuseki 3.10.0
>>
>> Which config file do you use now?
>>
>>> On 22/01/2019 16:17, vincent ventresque wrote:
>>>> Hello
>>>>
>>>> If the configuration folder is empty, the run/config.ttl (default
>>>> file) should be the one that Fuseki uses : you should try to replace
>>>> the content of run/config.ttl with the one Chris has sent in previous
>>>> msg
>>>>
>>> That worked!
>>>
>>> So now with the example Lorenz posted I get
>>>
>>>   java -cp ./fuseki-server.jar jena.textindexer --desc=run/config.ttl
>>> org.apache.jena.sparql.ARQException: No such type:
>>> <http://jena.apache.org/text#TextDataset>
>>>          at
>>> org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122) 
>>>
>>>          at
>>> org.apache.jena.query.text.TextDatasetFactory.create(TextDatasetFactory.java:38) 
>>>
>>>          at jena.textindexer.processModulesAndArgs(textindexer.java:90)
>>>          at jena.cmd.CmdArgModule.process(CmdArgModule.java:52)
>>>          at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
>>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>>>          at jena.textindexer.main(textindexer.java:52)
>>>
>>>
>>> @prefix :<http://localhost/jena_example/#>  .
>>> @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#>
>>> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>>>
>>> ## Example of a TDB dataset and text index
>>> ## Initialize TDB
>>> [] ja:loadClass "org.apache.jena.tdb.TDB" .
>>> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
>>> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>>>
>>> ## Initialize text query
>>> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
>>> # A TextDataset is a regular dataset with a text index.
>>> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
>>> # Lucene index
>>> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>>>
>>>
>>> ## ---------------------------------------------------------------
>>>
>>>
>>> :text_dataset rdf:type     text:TextDataset ;
>>>      text:dataset   :my_dataset ;
>>>      text:index     <#indexLucene> ;
>>>      .
>>>
>>> # A TDB dataset used for RDF storage
>>> :my_dataset rdf:type      tdb:DatasetTDB ;
>>>      tdb:location "/tmp/tdb-dataset/" ;
>>> #    tdb:unionDefaultGraph true ; # Optional
>>>      .
>>>
>>> # Text index description
>>> <#indexLucene> a text:TextIndexLucene ;
>>>      text:directory<file:/tmp/tdb-lucene-index>  ;
>>>      text:entityMap <#entMap> ;
>>>      text:storeValues true ;
>>>      text:analyzer [ a text:StandardAnalyzer ] ;
>>>      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>>>      text:queryParser text:AnalyzingQueryParser ;
>>>      text:multilingualSupport true ;
>>>   .
>>>
>>> <#entMap> a text:EntityMap ;
>>>      text:defaultField     "label" ;
>>>      text:entityField      "uri" ;
>>>      text:uidField         "uid" ;
>>>      text:langField        "lang" ;
>>>      text:graphField       "graph" ;
>>>      text:map (
>>>           [ text:field "label" ;
>>>             text:predicate skos:prefLabel ]
>>>           ) .
>>>
>>> <#service> rdf:type fuseki:Service ;
>>>      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
>>>      fuseki:serviceQuery             "query" ;    # SPARQL query 
>>> service
>>>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
>>> protocol (read only)
>>>      fuseki:dataset           :text_dataset ;
>>>      .
>>>
>>>> Le 22/01/2019 à 14:58, Mikael Pesonen a écrit :
>>>>> Hi,
>>>>>
>>>>> we haven't made any configuration files, so configuration folder is
>>>>> empty. Everything is working fine except text search so are there
>>>>> some advances for doing custom config? I understand now that for
>>>>> text search we need the config and about that I asked for help.
>>>>>
>>>>> On 21/01/2019 19:24, Chris Tomlinson wrote:
>>>>>> Hi,
>>>>>>
>>>>>> You’ve presented your system service configuration. We need to see
>>>>>> the configuration file
>>>>>> <http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html> 
>>>>>>
>>>>>> in:
>>>>>>
>>>>>>       $FUSEKI_BASE/configuration/text_svc.ttl
>>>>>>
>>>>>> It is a ttl file that is interpreted by the assembler system to
>>>>>> build the endpoints and dataset components. This is where the
>>>>>> jena-text configuration info will go. Here is a sample
>>>>>> configuration based on info in your service defn:
>>>>>>
>>>>>>> # Fuseki configuration for BDRC, configures two endpoints:
>>>>>>> #   - /bdrc is read-only
>>>>>>> #   - /bdrcrw is read-write
>>>>>>> #
>>>>>>> # This was painful to come up with but the web interface basically
>>>>>>> allows no option
>>>>>>> # and there is no subclass inference by default so such a
>>>>>>> configuration file is necessary.
>>>>>>> #
>>>>>>> # The main doc sources are:
>>>>>>> #  -
>>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html 
>>>>>>>
>>>>>>>
>>>>>>> #  -
>>>>>>> https://jena.apache.org/documentation/assembler/assembler-howto.html 
>>>>>>>
>>>>>>> #  - https://jena.apache.org/documentation/assembler/assembler.ttl
>>>>>>> #
>>>>>>> # See
>>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-layout.html
>>>>>>> for the destination of this file.
>>>>>>>
>>>>>>> @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#> .
>>>>>>> @prefix :        <http://base/#> .
>>>>>>>
>>>>>>> [] rdf:type fuseki:Server ;
>>>>>>>      fuseki:services (
>>>>>>>        :text_svc
>>>>>>>      ) .
>>>>>>>
>>>>>>> :text_svc rdf:type fuseki:Service ;
>>>>>>>       fuseki:name                       "text_svc" ;     # name of
>>>>>>> the dataset in the url
>>>>>>>       fuseki:serviceQuery               "query" ;    # SPARQL query
>>>>>>> service
>>>>>>>       fuseki:serviceUpdate              "update" ;   # SPARQL
>>>>>>> update service
>>>>>>>       fuseki:serviceUpload              "upload" ;   # Non-SPARQL
>>>>>>> upload service
>>>>>>>       fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph
>>>>>>> store protocol (read and write)
>>>>>>>       fuseki:dataset                    :text_dataset ;
>>>>>>>       .
>>>>>>>
>>>>>>> :text_dataset rdf:type     text:TextDataset ;
>>>>>>>       text:dataset   :tdb_dataset ;
>>>>>>>       text:index     :lucene_index ;
>>>>>>>       .
>>>>>>>
>>>>>>> # using TDB
>>>>>>> :tdb_dataset rdf:type tdb:DatasetTDB ;
>>>>>>>        tdb:location
>>>>>>> "/home/text/tools/apache-jena-fuseki-3.9.0/run/tdb_dataset" ;
>>>>>>>        tdb:unionDefaultGraph true ;
>>>>>>>        .
>>>>>>>
>>>>>>> # Text index description
>>>>>>> :lucene_index a text:TextIndexLucene ;
>>>>>>>       text:directory
>>>>>>> <file:/home/text/tools/apache-jena-fuseki-3.9.0/run/lucene_index> ;
>>>>>>>       text:storeValues true ;
>>>>>>>       text:entityMap :entitymap ;
>>>>>>>       .
>>>>>>>
>>>>>>> # Index mappings
>>>>>>> :entitymap a text:EntityMap ;
>>>>>>>       text:entityField      "uri" ;
>>>>>>>       text:uidField         "uid" ;
>>>>>>>       text:defaultField     "label" ;
>>>>>>>       text:langField        "lang" ;
>>>>>>>       text:graphField       "graph" ; ## enable graph-specific
>>>>>>> indexing
>>>>>>>       text:map (
>>>>>>>            [ text:field "label" ;
>>>>>>>              text:predicate skos:prefLabel ]
>>>>>>>            ) ;
>>>>>>>       .
>>>>>> hth,
>>>>>> Chris
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> On Jan 21, 2019, at 5:21 AM, Mikael Pesonen
>>>>>>> <mi...@lingsoft.fi> wrote:
>>>>>>>
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>
>>>>>>> On 18/01/2019 18:13, Chris Tomlinson wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> 1) If you’re using a default config, it does not have a working
>>>>>>>> jena-text configuration. The config will need to include
>>>>>>>> skos:prefLabel in the entity map.
>>>>>>>>
>>>>>>>> 2) when you change the jena-text in significant ways, such as
>>>>>>>> changing what analyzer is used for a given property and so on,
>>>>>>>> then you’ll need to rebuild the Lucene index via reloading the
>>>>>>>> dataset or using the textIndexer
>>>>>>>> <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. 
>>>>>>>>
>>>>>>>> I don’t recall this being mentioned as part of your testing
>>>>>>>>
>>>>>>>> 3) Please indicate exactly which item you’re using
>>>>>>>> jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc,
>>>>>>>> and the config file itself. The error you’ve mentioned previously:
>>>>>>> We are running Fuseki as service
>>>>>>>
>>>>>>> -----
>>>>>>> [Unit]
>>>>>>> Description=Apache Jena Fuseki
>>>>>>>
>>>>>>> [Service]
>>>>>>> Type=simple
>>>>>>> User=fuseki
>>>>>>> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
>>>>>>> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
>>>>>>> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run 
>>>>>>>
>>>>>>> ExecStart=/usr/bin/java
>>>>>>> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
>>>>>>>
>>>>>>> -Xmx5600M -jar
>>>>>>> /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar
>>>>>>> --update --port 3030 --loc=/home/text/tools/jena_data_test/ /ds
>>>>>>>
>>>>>>> [Install]
>>>>>>> WantedBy=multi-user.target
>>>>>>> -----
>>>>>>>
>>>>>>> All settings are default otherwise, we haven't changed any config
>>>>>>> file.
>>>>>>>
>>>>>>> Are there some minimal settings to this example config so that I
>>>>>>> could get skos:prefLabel working?
>>>>>>>
>>>>>>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> So when we have a working configuration/assembler file, all is
>>>>>>> needed is to build the index
>>>>>>>
>>>>>>> java  -cp  $FUSEKI_HOME/fuseki-server.jar jena.textindexer
>>>>>>> --desc=assembler_file ?
>>>>>>>
>>>>>>>
>>>>>>> Thank everyone for the help
>>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>>>>>>>> Config     INFO  Load configuration:
>>>>>>>>> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl 
>>>>>>>>>
>>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl> 
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>>>>>>>> WebAppContext WARN  Failed startup of context
>>>>>>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki
>>>>>>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE 
>>>>>>>>>
>>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>} 
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: at
>>>>>>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148) 
>>>>>>>>>
>>>>>>>> suggests to me that something in the config file is confusing the
>>>>>>>> readAssemblerFile. It doesn’t look like it’s failing in the
>>>>>>>> reading the jena-text portion of the config.
>>>>>>>>
>>>>>>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl
>>>>>>>> <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset,
>>>>>>>> then can you cut it down to just a small test case with some
>>>>>>>> concepts with “medi” and a few without? That along with the other
>>>>>>>> information should help move this further along..
>>>>>>>>
>>>>>>>> 4) Your query:
>>>>>>>>
>>>>>>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core#
>>>>>>>>> <http://www.w3.org/2004/02/skos/core#>>
>>>>>>>>> PREFIX text: <http://jena.apache.org/text#
>>>>>>>>> <http://jena.apache.org/text#>>
>>>>>>>>> SELECT *
>>>>>>>>> WHERE
>>>>>>>>> {
>>>>>>>>>     GRAPH <http://www.yso.fi/onto/mesh/
>>>>>>>>> <http://www.yso.fi/onto/mesh/>>
>>>>>>>>>     {
>>>>>>>>>       ?concept text:query (skos:prefLabel "medi") .
>>>>>>>>>       ?concept skos:prefLabel ?prefLabel .
>>>>>>>>>
>>>>>>>>>       # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>>>>>>>     }
>>>>>>>>> }
>>>>>>>>> limit 10
>>>>>>>> might effectively just be executing:
>>>>>>>>
>>>>>>>>> ?concept skos:prefLabel ?prefLabel .
>>>>>>>> if there is actually no jena-text config - I haven’t checked what
>>>>>>>> happens when there is no TextIndex configured and the text:query
>>>>>>>> is invoked, but may be a noop
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Chris
>>>>>>>>
>>>>>>>>
>>>>>>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen
>>>>>>>>> <mi...@lingsoft.fi> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>>>>>> 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
>>>>>>>>>
>>>>>>> -- 
>>>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>>>> 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
>>>>>>>
>

Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
Thanks, now Skosmos works too. This all works when ran from command 
line, but not as service. I'm getting still

Jan 23 13:18:19 semantic-dev java[7286]: [2019-01-23 13:18:19] 
Server     INFO  Apache Jena Fuseki 3.9.0
Jan 23 13:18:20 semantic-dev java[7286]: [2019-01-23 13:18:20] 
Config     INFO FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
Jan 23 13:18:20 semantic-dev java[7286]: [2019-01-23 13:18:20] 
Config     INFO FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
Jan 23 13:18:20 semantic-dev java[7286]: [2019-01-23 13:18:20] 
Config     INFO  Shiro file: 
file:///home/text/tools/apache-jena-fuseki-3.9.0/run/shiro.ini
Jan 23 13:18:20 semantic-dev java[7286]: [2019-01-23 13:18:20] 
Config     INFO  Configuration file: 
/home/text/tools/apache-jena-fuseki-3.9.0/run/config.ttl
Jan 23 13:18:20 semantic-dev java[7286]: [2019-01-23 13:18:20] 
WebAppContext WARN  Failed startup of context 
o.e.j.w.WebAppContext@7c455e96{Apache Jena Fuseki 
Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
Jan 23 13:18:20 semantic-dev java[7286]:     root: 
file:///home/text/tools/apache-jena-fuseki-3.9.0/run/config.ttl#indexLucene 
with type: http://jena.apache.org/text#TextIndexLucene assembler class: 
class org.apache.jena.query.text.assembler.TextIndexLuceneAssembler
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.build.FusekiConfig.getDataset(FusekiConfig.java:272)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.build.FusekiConfig.buildDataServiceCustom(FusekiConfig.java:225)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.build.FusekiConfig.buildDataAccessPoint(FusekiConfig.java:217)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.build.FusekiConfig.servicesAndDatasets(FusekiConfig.java:126)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.webapp.FusekiSystem.processServerConfigFile(FusekiSystem.java:285)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.webapp.FusekiSystem.initServerConfiguration(FusekiSystem.java:256)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:225)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
Jan 23 13:18:20 semantic-dev java[7286]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)



[Unit]
Description=Apache Jena Fuseki

[Service]
Type=simple
User=fuseki
#Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
ExecStart=/usr/bin/java 
-Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
-Xmx5600M -jar 
/home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar --update 
--port 3030 
--config=/home/text/tools/apache-jena-fuseki-3.9.0/run/config.ttl

[Install]
WantedBy=multi-user.target


On 22/01/2019 17:42, Rob Vesse wrote:
> http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html
>
> You need to add fuseki:serviceQuery "sparql" as an additional entry to your fuseki:Service definition in order for it to respond to SPARQL queries on /ds/sparql
>
> Rob
>
> On 22/01/2019, 15:28, "Mikael Pesonen" <mi...@lingsoft.fi> wrote:
>
>      
>      This is the call Skosmos makes:
>      
>      GET http://localhost:3030/ds/sparql?query=...
>      
>      
>      
>      On 22/01/2019 17:21, Mikael Pesonen wrote:
>      >
>      > Sorry had issues with permissions. So now I can load configuration
>      > from cmd line
>      >
>      > /usr/bin/java
>      > -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties
>      > -Xmx5600M -jar fuseki-server.jar --update --port 3030
>      > --config=run/config.ttl
>      >
>      > and Indexer works
>      > ...
>      > INFO  2060054 (32699 per second) properties indexed
>      >
>      > and sparql text search works. Only issue remaining is that now Skosmos
>      > application (and possible some others) stopped working. Fuseki log says
>      >  Fuseki     INFO  [2] 404 Not found: dataset='ds' service='sparql' (1 ms)
>      >
>      > Here is the config where I updated tdb:location:
>      >
>      > @prefix :<http://localhost/jena_example/#>  .
>      > @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#>
>      > @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>      >
>      > ## Example of a TDB dataset and text index
>      > ## Initialize TDB
>      > [] ja:loadClass "org.apache.jena.tdb.TDB" .
>      > tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
>      > tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>      >
>      > ## Initialize text query
>      > [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
>      > # A TextDataset is a regular dataset with a text index.
>      > text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
>      > # Lucene index
>      > text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>      >
>      >
>      > ## ---------------------------------------------------------------
>      >
>      >
>      > :text_dataset rdf:type     text:TextDataset ;
>      >      text:dataset   :my_dataset ;
>      >      text:index     <#indexLucene> ;
>      >      .
>      >
>      > # A TDB dataset used for RDF storage
>      > :my_dataset rdf:type      tdb:DatasetTDB ;
>      >      tdb:location "/home/text/tools/jena_data_test/" ;
>      > #    tdb:unionDefaultGraph true ; # Optional
>      >      .
>      >
>      > # Text index description
>      > <#indexLucene> a text:TextIndexLucene ;
>      >      text:directory<file:/tmp/tdb-lucene-index>  ;
>      >      text:entityMap <#entMap> ;
>      >      text:storeValues true ;
>      >      text:analyzer [ a text:StandardAnalyzer ] ;
>      >      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>      >      text:queryParser text:AnalyzingQueryParser ;
>      >      text:multilingualSupport true ;
>      >   .
>      >
>      > <#entMap> a text:EntityMap ;
>      >      text:defaultField     "label" ;
>      >      text:entityField      "uri" ;
>      >      text:uidField         "uid" ;
>      >      text:langField        "lang" ;
>      >      text:graphField       "graph" ;
>      >      text:map (
>      >           [ text:field "label" ;
>      >             text:predicate skos:prefLabel ]
>      >           ) .
>      >
>      > <#service> rdf:type fuseki:Service ;
>      >      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
>      >      fuseki:serviceQuery             "query" ;    # SPARQL query service
>      >      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
>      > protocol (read only)
>      >      fuseki:dataset           :text_dataset ;
>      >      .
>      >
>      >
>      >
>      > On 22/01/2019 17:01, Lorenz B. wrote:
>      >> Can't reproduce this. With the config file I shared with you, it works
>      >> for me as expected with Fuseki 3.10.0
>      >>
>      >> Which config file do you use now?
>      >>
>      >>> On 22/01/2019 16:17, vincent ventresque wrote:
>      >>>> Hello
>      >>>>
>      >>>> If the configuration folder is empty, the run/config.ttl (default
>      >>>> file) should be the one that Fuseki uses : you should try to replace
>      >>>> the content of run/config.ttl with the one Chris has sent in previous
>      >>>> msg
>      >>>>
>      >>> That worked!
>      >>>
>      >>> So now with the example Lorenz posted I get
>      >>>
>      >>>   java -cp ./fuseki-server.jar jena.textindexer --desc=run/config.ttl
>      >>> org.apache.jena.sparql.ARQException: No such type:
>      >>> <http://jena.apache.org/text#TextDataset>
>      >>>          at
>      >>> org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>      >>>
>      >>>          at
>      >>> org.apache.jena.query.text.TextDatasetFactory.create(TextDatasetFactory.java:38)
>      >>>
>      >>>          at jena.textindexer.processModulesAndArgs(textindexer.java:90)
>      >>>          at jena.cmd.CmdArgModule.process(CmdArgModule.java:52)
>      >>>          at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
>      >>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>      >>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>      >>>          at jena.textindexer.main(textindexer.java:52)
>      >>>
>      >>>
>      >>> @prefix :<http://localhost/jena_example/#>  .
>      >>> @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#>
>      >>> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>      >>>
>      >>> ## Example of a TDB dataset and text index
>      >>> ## Initialize TDB
>      >>> [] ja:loadClass "org.apache.jena.tdb.TDB" .
>      >>> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
>      >>> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>      >>>
>      >>> ## Initialize text query
>      >>> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
>      >>> # A TextDataset is a regular dataset with a text index.
>      >>> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
>      >>> # Lucene index
>      >>> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>      >>>
>      >>>
>      >>> ## ---------------------------------------------------------------
>      >>>
>      >>>
>      >>> :text_dataset rdf:type     text:TextDataset ;
>      >>>      text:dataset   :my_dataset ;
>      >>>      text:index     <#indexLucene> ;
>      >>>      .
>      >>>
>      >>> # A TDB dataset used for RDF storage
>      >>> :my_dataset rdf:type      tdb:DatasetTDB ;
>      >>>      tdb:location "/tmp/tdb-dataset/" ;
>      >>> #    tdb:unionDefaultGraph true ; # Optional
>      >>>      .
>      >>>
>      >>> # Text index description
>      >>> <#indexLucene> a text:TextIndexLucene ;
>      >>>      text:directory<file:/tmp/tdb-lucene-index>  ;
>      >>>      text:entityMap <#entMap> ;
>      >>>      text:storeValues true ;
>      >>>      text:analyzer [ a text:StandardAnalyzer ] ;
>      >>>      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>      >>>      text:queryParser text:AnalyzingQueryParser ;
>      >>>      text:multilingualSupport true ;
>      >>>   .
>      >>>
>      >>> <#entMap> a text:EntityMap ;
>      >>>      text:defaultField     "label" ;
>      >>>      text:entityField      "uri" ;
>      >>>      text:uidField         "uid" ;
>      >>>      text:langField        "lang" ;
>      >>>      text:graphField       "graph" ;
>      >>>      text:map (
>      >>>           [ text:field "label" ;
>      >>>             text:predicate skos:prefLabel ]
>      >>>           ) .
>      >>>
>      >>> <#service> rdf:type fuseki:Service ;
>      >>>      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
>      >>>      fuseki:serviceQuery             "query" ;    # SPARQL query
>      >>> service
>      >>>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
>      >>> protocol (read only)
>      >>>      fuseki:dataset           :text_dataset ;
>      >>>      .
>      >>>
>      >>>> Le 22/01/2019 à 14:58, Mikael Pesonen a écrit :
>      >>>>> Hi,
>      >>>>>
>      >>>>> we haven't made any configuration files, so configuration folder is
>      >>>>> empty. Everything is working fine except text search so are there
>      >>>>> some advances for doing custom config? I understand now that for
>      >>>>> text search we need the config and about that I asked for help.
>      >>>>>
>      >>>>> On 21/01/2019 19:24, Chris Tomlinson wrote:
>      >>>>>> Hi,
>      >>>>>>
>      >>>>>> You’ve presented your system service configuration. We need to see
>      >>>>>> the configuration file
>      >>>>>> <http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html>
>      >>>>>>
>      >>>>>> in:
>      >>>>>>
>      >>>>>>       $FUSEKI_BASE/configuration/text_svc.ttl
>      >>>>>>
>      >>>>>> It is a ttl file that is interpreted by the assembler system to
>      >>>>>> build the endpoints and dataset components. This is where the
>      >>>>>> jena-text configuration info will go. Here is a sample
>      >>>>>> configuration based on info in your service defn:
>      >>>>>>
>      >>>>>>> # Fuseki configuration for BDRC, configures two endpoints:
>      >>>>>>> #   - /bdrc is read-only
>      >>>>>>> #   - /bdrcrw is read-write
>      >>>>>>> #
>      >>>>>>> # This was painful to come up with but the web interface basically
>      >>>>>>> allows no option
>      >>>>>>> # and there is no subclass inference by default so such a
>      >>>>>>> configuration file is necessary.
>      >>>>>>> #
>      >>>>>>> # The main doc sources are:
>      >>>>>>> #  -
>      >>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html
>      >>>>>>>
>      >>>>>>>
>      >>>>>>> #  -
>      >>>>>>> https://jena.apache.org/documentation/assembler/assembler-howto.html
>      >>>>>>>
>      >>>>>>> #  - https://jena.apache.org/documentation/assembler/assembler.ttl
>      >>>>>>> #
>      >>>>>>> # See
>      >>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-layout.html
>      >>>>>>> for the destination of this file.
>      >>>>>>>
>      >>>>>>> @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#> .
>      >>>>>>> @prefix :        <http://base/#> .
>      >>>>>>>
>      >>>>>>> [] rdf:type fuseki:Server ;
>      >>>>>>>      fuseki:services (
>      >>>>>>>        :text_svc
>      >>>>>>>      ) .
>      >>>>>>>
>      >>>>>>> :text_svc rdf:type fuseki:Service ;
>      >>>>>>>       fuseki:name                       "text_svc" ;     # name of
>      >>>>>>> the dataset in the url
>      >>>>>>>       fuseki:serviceQuery               "query" ;    # SPARQL query
>      >>>>>>> service
>      >>>>>>>       fuseki:serviceUpdate              "update" ;   # SPARQL
>      >>>>>>> update service
>      >>>>>>>       fuseki:serviceUpload              "upload" ;   # Non-SPARQL
>      >>>>>>> upload service
>      >>>>>>>       fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph
>      >>>>>>> store protocol (read and write)
>      >>>>>>>       fuseki:dataset                    :text_dataset ;
>      >>>>>>>       .
>      >>>>>>>
>      >>>>>>> :text_dataset rdf:type     text:TextDataset ;
>      >>>>>>>       text:dataset   :tdb_dataset ;
>      >>>>>>>       text:index     :lucene_index ;
>      >>>>>>>       .
>      >>>>>>>
>      >>>>>>> # using TDB
>      >>>>>>> :tdb_dataset rdf:type tdb:DatasetTDB ;
>      >>>>>>>        tdb:location
>      >>>>>>> "/home/text/tools/apache-jena-fuseki-3.9.0/run/tdb_dataset" ;
>      >>>>>>>        tdb:unionDefaultGraph true ;
>      >>>>>>>        .
>      >>>>>>>
>      >>>>>>> # Text index description
>      >>>>>>> :lucene_index a text:TextIndexLucene ;
>      >>>>>>>       text:directory
>      >>>>>>> <file:/home/text/tools/apache-jena-fuseki-3.9.0/run/lucene_index> ;
>      >>>>>>>       text:storeValues true ;
>      >>>>>>>       text:entityMap :entitymap ;
>      >>>>>>>       .
>      >>>>>>>
>      >>>>>>> # Index mappings
>      >>>>>>> :entitymap a text:EntityMap ;
>      >>>>>>>       text:entityField      "uri" ;
>      >>>>>>>       text:uidField         "uid" ;
>      >>>>>>>       text:defaultField     "label" ;
>      >>>>>>>       text:langField        "lang" ;
>      >>>>>>>       text:graphField       "graph" ; ## enable graph-specific
>      >>>>>>> indexing
>      >>>>>>>       text:map (
>      >>>>>>>            [ text:field "label" ;
>      >>>>>>>              text:predicate skos:prefLabel ]
>      >>>>>>>            ) ;
>      >>>>>>>       .
>      >>>>>> hth,
>      >>>>>> Chris
>      >>>>>>
>      >>>>>>
>      >>>>>>
>      >>>>>>
>      >>>>>>> On Jan 21, 2019, at 5:21 AM, Mikael Pesonen
>      >>>>>>> <mi...@lingsoft.fi> wrote:
>      >>>>>>>
>      >>>>>>>
>      >>>>>>> Hi,
>      >>>>>>>
>      >>>>>>>
>      >>>>>>> On 18/01/2019 18:13, Chris Tomlinson wrote:
>      >>>>>>>> Hi,
>      >>>>>>>>
>      >>>>>>>> 1) If you’re using a default config, it does not have a working
>      >>>>>>>> jena-text configuration. The config will need to include
>      >>>>>>>> skos:prefLabel in the entity map.
>      >>>>>>>>
>      >>>>>>>> 2) when you change the jena-text in significant ways, such as
>      >>>>>>>> changing what analyzer is used for a given property and so on,
>      >>>>>>>> then you’ll need to rebuild the Lucene index via reloading the
>      >>>>>>>> dataset or using the textIndexer
>      >>>>>>>> <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>.
>      >>>>>>>>
>      >>>>>>>> I don’t recall this being mentioned as part of your testing
>      >>>>>>>>
>      >>>>>>>> 3) Please indicate exactly which item you’re using
>      >>>>>>>> jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc,
>      >>>>>>>> and the config file itself. The error you’ve mentioned previously:
>      >>>>>>> We are running Fuseki as service
>      >>>>>>>
>      >>>>>>> -----
>      >>>>>>> [Unit]
>      >>>>>>> Description=Apache Jena Fuseki
>      >>>>>>>
>      >>>>>>> [Service]
>      >>>>>>> Type=simple
>      >>>>>>> User=fuseki
>      >>>>>>> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
>      >>>>>>> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
>      >>>>>>> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
>      >>>>>>>
>      >>>>>>> ExecStart=/usr/bin/java
>      >>>>>>> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties
>      >>>>>>>
>      >>>>>>> -Xmx5600M -jar
>      >>>>>>> /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar
>      >>>>>>> --update --port 3030 --loc=/home/text/tools/jena_data_test/ /ds
>      >>>>>>>
>      >>>>>>> [Install]
>      >>>>>>> WantedBy=multi-user.target
>      >>>>>>> -----
>      >>>>>>>
>      >>>>>>> All settings are default otherwise, we haven't changed any config
>      >>>>>>> file.
>      >>>>>>>
>      >>>>>>> Are there some minimal settings to this example config so that I
>      >>>>>>> could get skos:prefLabel working?
>      >>>>>>>
>      >>>>>>> https://jena.apache.org/documentation/query/text-query.html#configuration
>      >>>>>>>
>      >>>>>>>
>      >>>>>>>
>      >>>>>>> So when we have a working configuration/assembler file, all is
>      >>>>>>> needed is to build the index
>      >>>>>>>
>      >>>>>>> java  -cp  $FUSEKI_HOME/fuseki-server.jar jena.textindexer
>      >>>>>>> --desc=assembler_file ?
>      >>>>>>>
>      >>>>>>>
>      >>>>>>> Thank everyone for the help
>      >>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>      >>>>>>>>> Config     INFO  Load configuration:
>      >>>>>>>>> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl
>      >>>>>>>>>
>      >>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>      >>>>>>>>>
>      >>>>>>>>>
>      >>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>      >>>>>>>>> WebAppContext WARN  Failed startup of context
>      >>>>>>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki
>      >>>>>>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE
>      >>>>>>>>>
>      >>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>      >>>>>>>>>
>      >>>>>>>>>
>      >>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: at
>      >>>>>>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>      >>>>>>>>>
>      >>>>>>>> suggests to me that something in the config file is confusing the
>      >>>>>>>> readAssemblerFile. It doesn’t look like it’s failing in the
>      >>>>>>>> reading the jena-text portion of the config.
>      >>>>>>>>
>      >>>>>>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl
>      >>>>>>>> <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset,
>      >>>>>>>> then can you cut it down to just a small test case with some
>      >>>>>>>> concepts with “medi” and a few without? That along with the other
>      >>>>>>>> information should help move this further along..
>      >>>>>>>>
>      >>>>>>>> 4) Your query:
>      >>>>>>>>
>      >>>>>>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core#
>      >>>>>>>>> <http://www.w3.org/2004/02/skos/core#>>
>      >>>>>>>>> PREFIX text: <http://jena.apache.org/text#
>      >>>>>>>>> <http://jena.apache.org/text#>>
>      >>>>>>>>> SELECT *
>      >>>>>>>>> WHERE
>      >>>>>>>>> {
>      >>>>>>>>>     GRAPH <http://www.yso.fi/onto/mesh/
>      >>>>>>>>> <http://www.yso.fi/onto/mesh/>>
>      >>>>>>>>>     {
>      >>>>>>>>>       ?concept text:query (skos:prefLabel "medi") .
>      >>>>>>>>>       ?concept skos:prefLabel ?prefLabel .
>      >>>>>>>>>
>      >>>>>>>>>       # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>      >>>>>>>>>     }
>      >>>>>>>>> }
>      >>>>>>>>> limit 10
>      >>>>>>>> might effectively just be executing:
>      >>>>>>>>
>      >>>>>>>>> ?concept skos:prefLabel ?prefLabel .
>      >>>>>>>> if there is actually no jena-text config - I haven’t checked what
>      >>>>>>>> happens when there is no TextIndex configured and the text:query
>      >>>>>>>> is invoked, but may be a noop
>      >>>>>>>>
>      >>>>>>>> Thanks,
>      >>>>>>>> Chris
>      >>>>>>>>
>      >>>>>>>>
>      >>>>>>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen
>      >>>>>>>>> <mi...@lingsoft.fi> wrote:
>      >>>>>>>>>
>      >>>>>>>>>
>      >>>>>>>>>
>      >>>>>>>>> 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: mikael.pesonen@lingsoft.fi
>      >>>>>>>>> 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
>      >>>>>>>>>
>      >>>>>>> --
>      >>>>>>> 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: mikael.pesonen@lingsoft.fi
>      >>>>>>> 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
>      >>>>>>>
>      >
>      
>      --
>      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: mikael.pesonen@lingsoft.fi
>      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
>      
>      
>
>
>
>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by Rob Vesse <rv...@dotnetrdf.org>.
http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html

You need to add fuseki:serviceQuery "sparql" as an additional entry to your fuseki:Service definition in order for it to respond to SPARQL queries on /ds/sparql

Rob

On 22/01/2019, 15:28, "Mikael Pesonen" <mi...@lingsoft.fi> wrote:

    
    This is the call Skosmos makes:
    
    GET http://localhost:3030/ds/sparql?query=...
    
    
    
    On 22/01/2019 17:21, Mikael Pesonen wrote:
    >
    > Sorry had issues with permissions. So now I can load configuration 
    > from cmd line
    >
    > /usr/bin/java 
    > -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
    > -Xmx5600M -jar fuseki-server.jar --update --port 3030 
    > --config=run/config.ttl
    >
    > and Indexer works
    > ...
    > INFO  2060054 (32699 per second) properties indexed
    >
    > and sparql text search works. Only issue remaining is that now Skosmos 
    > application (and possible some others) stopped working. Fuseki log says
    >  Fuseki     INFO  [2] 404 Not found: dataset='ds' service='sparql' (1 ms)
    >
    > Here is the config where I updated tdb:location:
    >
    > @prefix :<http://localhost/jena_example/#>  .
    > @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#>
    > @prefix fuseki:<http://jena.apache.org/fuseki#>  .
    >
    > ## Example of a TDB dataset and text index
    > ## Initialize TDB
    > [] ja:loadClass "org.apache.jena.tdb.TDB" .
    > tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
    > tdb:GraphTDB    rdfs:subClassOf  ja:Model .
    >
    > ## Initialize text query
    > [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
    > # A TextDataset is a regular dataset with a text index.
    > text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
    > # Lucene index
    > text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
    >
    >
    > ## ---------------------------------------------------------------
    >
    >
    > :text_dataset rdf:type     text:TextDataset ;
    >      text:dataset   :my_dataset ;
    >      text:index     <#indexLucene> ;
    >      .
    >
    > # A TDB dataset used for RDF storage
    > :my_dataset rdf:type      tdb:DatasetTDB ;
    >      tdb:location "/home/text/tools/jena_data_test/" ;
    > #    tdb:unionDefaultGraph true ; # Optional
    >      .
    >
    > # Text index description
    > <#indexLucene> a text:TextIndexLucene ;
    >      text:directory<file:/tmp/tdb-lucene-index>  ;
    >      text:entityMap <#entMap> ;
    >      text:storeValues true ;
    >      text:analyzer [ a text:StandardAnalyzer ] ;
    >      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
    >      text:queryParser text:AnalyzingQueryParser ;
    >      text:multilingualSupport true ;
    >   .
    >
    > <#entMap> a text:EntityMap ;
    >      text:defaultField     "label" ;
    >      text:entityField      "uri" ;
    >      text:uidField         "uid" ;
    >      text:langField        "lang" ;
    >      text:graphField       "graph" ;
    >      text:map (
    >           [ text:field "label" ;
    >             text:predicate skos:prefLabel ]
    >           ) .
    >
    > <#service> rdf:type fuseki:Service ;
    >      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
    >      fuseki:serviceQuery             "query" ;    # SPARQL query service
    >      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store 
    > protocol (read only)
    >      fuseki:dataset           :text_dataset ;
    >      .
    >
    >
    >
    > On 22/01/2019 17:01, Lorenz B. wrote:
    >> Can't reproduce this. With the config file I shared with you, it works
    >> for me as expected with Fuseki 3.10.0
    >>
    >> Which config file do you use now?
    >>
    >>> On 22/01/2019 16:17, vincent ventresque wrote:
    >>>> Hello
    >>>>
    >>>> If the configuration folder is empty, the run/config.ttl (default
    >>>> file) should be the one that Fuseki uses : you should try to replace
    >>>> the content of run/config.ttl with the one Chris has sent in previous
    >>>> msg
    >>>>
    >>> That worked!
    >>>
    >>> So now with the example Lorenz posted I get
    >>>
    >>>   java -cp ./fuseki-server.jar jena.textindexer --desc=run/config.ttl
    >>> org.apache.jena.sparql.ARQException: No such type:
    >>> <http://jena.apache.org/text#TextDataset>
    >>>          at
    >>> org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122) 
    >>>
    >>>          at
    >>> org.apache.jena.query.text.TextDatasetFactory.create(TextDatasetFactory.java:38) 
    >>>
    >>>          at jena.textindexer.processModulesAndArgs(textindexer.java:90)
    >>>          at jena.cmd.CmdArgModule.process(CmdArgModule.java:52)
    >>>          at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
    >>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
    >>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
    >>>          at jena.textindexer.main(textindexer.java:52)
    >>>
    >>>
    >>> @prefix :<http://localhost/jena_example/#>  .
    >>> @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#>
    >>> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
    >>>
    >>> ## Example of a TDB dataset and text index
    >>> ## Initialize TDB
    >>> [] ja:loadClass "org.apache.jena.tdb.TDB" .
    >>> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
    >>> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
    >>>
    >>> ## Initialize text query
    >>> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
    >>> # A TextDataset is a regular dataset with a text index.
    >>> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
    >>> # Lucene index
    >>> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
    >>>
    >>>
    >>> ## ---------------------------------------------------------------
    >>>
    >>>
    >>> :text_dataset rdf:type     text:TextDataset ;
    >>>      text:dataset   :my_dataset ;
    >>>      text:index     <#indexLucene> ;
    >>>      .
    >>>
    >>> # A TDB dataset used for RDF storage
    >>> :my_dataset rdf:type      tdb:DatasetTDB ;
    >>>      tdb:location "/tmp/tdb-dataset/" ;
    >>> #    tdb:unionDefaultGraph true ; # Optional
    >>>      .
    >>>
    >>> # Text index description
    >>> <#indexLucene> a text:TextIndexLucene ;
    >>>      text:directory<file:/tmp/tdb-lucene-index>  ;
    >>>      text:entityMap <#entMap> ;
    >>>      text:storeValues true ;
    >>>      text:analyzer [ a text:StandardAnalyzer ] ;
    >>>      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
    >>>      text:queryParser text:AnalyzingQueryParser ;
    >>>      text:multilingualSupport true ;
    >>>   .
    >>>
    >>> <#entMap> a text:EntityMap ;
    >>>      text:defaultField     "label" ;
    >>>      text:entityField      "uri" ;
    >>>      text:uidField         "uid" ;
    >>>      text:langField        "lang" ;
    >>>      text:graphField       "graph" ;
    >>>      text:map (
    >>>           [ text:field "label" ;
    >>>             text:predicate skos:prefLabel ]
    >>>           ) .
    >>>
    >>> <#service> rdf:type fuseki:Service ;
    >>>      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
    >>>      fuseki:serviceQuery             "query" ;    # SPARQL query 
    >>> service
    >>>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
    >>> protocol (read only)
    >>>      fuseki:dataset           :text_dataset ;
    >>>      .
    >>>
    >>>> Le 22/01/2019 à 14:58, Mikael Pesonen a écrit :
    >>>>> Hi,
    >>>>>
    >>>>> we haven't made any configuration files, so configuration folder is
    >>>>> empty. Everything is working fine except text search so are there
    >>>>> some advances for doing custom config? I understand now that for
    >>>>> text search we need the config and about that I asked for help.
    >>>>>
    >>>>> On 21/01/2019 19:24, Chris Tomlinson wrote:
    >>>>>> Hi,
    >>>>>>
    >>>>>> You’ve presented your system service configuration. We need to see
    >>>>>> the configuration file
    >>>>>> <http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html> 
    >>>>>>
    >>>>>> in:
    >>>>>>
    >>>>>>       $FUSEKI_BASE/configuration/text_svc.ttl
    >>>>>>
    >>>>>> It is a ttl file that is interpreted by the assembler system to
    >>>>>> build the endpoints and dataset components. This is where the
    >>>>>> jena-text configuration info will go. Here is a sample
    >>>>>> configuration based on info in your service defn:
    >>>>>>
    >>>>>>> # Fuseki configuration for BDRC, configures two endpoints:
    >>>>>>> #   - /bdrc is read-only
    >>>>>>> #   - /bdrcrw is read-write
    >>>>>>> #
    >>>>>>> # This was painful to come up with but the web interface basically
    >>>>>>> allows no option
    >>>>>>> # and there is no subclass inference by default so such a
    >>>>>>> configuration file is necessary.
    >>>>>>> #
    >>>>>>> # The main doc sources are:
    >>>>>>> #  -
    >>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html 
    >>>>>>>
    >>>>>>>
    >>>>>>> #  -
    >>>>>>> https://jena.apache.org/documentation/assembler/assembler-howto.html 
    >>>>>>>
    >>>>>>> #  - https://jena.apache.org/documentation/assembler/assembler.ttl
    >>>>>>> #
    >>>>>>> # See
    >>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-layout.html
    >>>>>>> for the destination of this file.
    >>>>>>>
    >>>>>>> @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#> .
    >>>>>>> @prefix :        <http://base/#> .
    >>>>>>>
    >>>>>>> [] rdf:type fuseki:Server ;
    >>>>>>>      fuseki:services (
    >>>>>>>        :text_svc
    >>>>>>>      ) .
    >>>>>>>
    >>>>>>> :text_svc rdf:type fuseki:Service ;
    >>>>>>>       fuseki:name                       "text_svc" ;     # name of
    >>>>>>> the dataset in the url
    >>>>>>>       fuseki:serviceQuery               "query" ;    # SPARQL query
    >>>>>>> service
    >>>>>>>       fuseki:serviceUpdate              "update" ;   # SPARQL
    >>>>>>> update service
    >>>>>>>       fuseki:serviceUpload              "upload" ;   # Non-SPARQL
    >>>>>>> upload service
    >>>>>>>       fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph
    >>>>>>> store protocol (read and write)
    >>>>>>>       fuseki:dataset                    :text_dataset ;
    >>>>>>>       .
    >>>>>>>
    >>>>>>> :text_dataset rdf:type     text:TextDataset ;
    >>>>>>>       text:dataset   :tdb_dataset ;
    >>>>>>>       text:index     :lucene_index ;
    >>>>>>>       .
    >>>>>>>
    >>>>>>> # using TDB
    >>>>>>> :tdb_dataset rdf:type tdb:DatasetTDB ;
    >>>>>>>        tdb:location
    >>>>>>> "/home/text/tools/apache-jena-fuseki-3.9.0/run/tdb_dataset" ;
    >>>>>>>        tdb:unionDefaultGraph true ;
    >>>>>>>        .
    >>>>>>>
    >>>>>>> # Text index description
    >>>>>>> :lucene_index a text:TextIndexLucene ;
    >>>>>>>       text:directory
    >>>>>>> <file:/home/text/tools/apache-jena-fuseki-3.9.0/run/lucene_index> ;
    >>>>>>>       text:storeValues true ;
    >>>>>>>       text:entityMap :entitymap ;
    >>>>>>>       .
    >>>>>>>
    >>>>>>> # Index mappings
    >>>>>>> :entitymap a text:EntityMap ;
    >>>>>>>       text:entityField      "uri" ;
    >>>>>>>       text:uidField         "uid" ;
    >>>>>>>       text:defaultField     "label" ;
    >>>>>>>       text:langField        "lang" ;
    >>>>>>>       text:graphField       "graph" ; ## enable graph-specific
    >>>>>>> indexing
    >>>>>>>       text:map (
    >>>>>>>            [ text:field "label" ;
    >>>>>>>              text:predicate skos:prefLabel ]
    >>>>>>>            ) ;
    >>>>>>>       .
    >>>>>> hth,
    >>>>>> Chris
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>>
    >>>>>>> On Jan 21, 2019, at 5:21 AM, Mikael Pesonen
    >>>>>>> <mi...@lingsoft.fi> wrote:
    >>>>>>>
    >>>>>>>
    >>>>>>> Hi,
    >>>>>>>
    >>>>>>>
    >>>>>>> On 18/01/2019 18:13, Chris Tomlinson wrote:
    >>>>>>>> Hi,
    >>>>>>>>
    >>>>>>>> 1) If you’re using a default config, it does not have a working
    >>>>>>>> jena-text configuration. The config will need to include
    >>>>>>>> skos:prefLabel in the entity map.
    >>>>>>>>
    >>>>>>>> 2) when you change the jena-text in significant ways, such as
    >>>>>>>> changing what analyzer is used for a given property and so on,
    >>>>>>>> then you’ll need to rebuild the Lucene index via reloading the
    >>>>>>>> dataset or using the textIndexer
    >>>>>>>> <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. 
    >>>>>>>>
    >>>>>>>> I don’t recall this being mentioned as part of your testing
    >>>>>>>>
    >>>>>>>> 3) Please indicate exactly which item you’re using
    >>>>>>>> jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc,
    >>>>>>>> and the config file itself. The error you’ve mentioned previously:
    >>>>>>> We are running Fuseki as service
    >>>>>>>
    >>>>>>> -----
    >>>>>>> [Unit]
    >>>>>>> Description=Apache Jena Fuseki
    >>>>>>>
    >>>>>>> [Service]
    >>>>>>> Type=simple
    >>>>>>> User=fuseki
    >>>>>>> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
    >>>>>>> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
    >>>>>>> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run 
    >>>>>>>
    >>>>>>> ExecStart=/usr/bin/java
    >>>>>>> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
    >>>>>>>
    >>>>>>> -Xmx5600M -jar
    >>>>>>> /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar
    >>>>>>> --update --port 3030 --loc=/home/text/tools/jena_data_test/ /ds
    >>>>>>>
    >>>>>>> [Install]
    >>>>>>> WantedBy=multi-user.target
    >>>>>>> -----
    >>>>>>>
    >>>>>>> All settings are default otherwise, we haven't changed any config
    >>>>>>> file.
    >>>>>>>
    >>>>>>> Are there some minimal settings to this example config so that I
    >>>>>>> could get skos:prefLabel working?
    >>>>>>>
    >>>>>>> https://jena.apache.org/documentation/query/text-query.html#configuration 
    >>>>>>>
    >>>>>>>
    >>>>>>>
    >>>>>>> So when we have a working configuration/assembler file, all is
    >>>>>>> needed is to build the index
    >>>>>>>
    >>>>>>> java  -cp  $FUSEKI_HOME/fuseki-server.jar jena.textindexer
    >>>>>>> --desc=assembler_file ?
    >>>>>>>
    >>>>>>>
    >>>>>>> Thank everyone for the help
    >>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
    >>>>>>>>> Config     INFO  Load configuration:
    >>>>>>>>> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl 
    >>>>>>>>>
    >>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl> 
    >>>>>>>>>
    >>>>>>>>>
    >>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
    >>>>>>>>> WebAppContext WARN  Failed startup of context
    >>>>>>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki
    >>>>>>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE 
    >>>>>>>>>
    >>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>} 
    >>>>>>>>>
    >>>>>>>>>
    >>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: at
    >>>>>>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148) 
    >>>>>>>>>
    >>>>>>>> suggests to me that something in the config file is confusing the
    >>>>>>>> readAssemblerFile. It doesn’t look like it’s failing in the
    >>>>>>>> reading the jena-text portion of the config.
    >>>>>>>>
    >>>>>>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl
    >>>>>>>> <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset,
    >>>>>>>> then can you cut it down to just a small test case with some
    >>>>>>>> concepts with “medi” and a few without? That along with the other
    >>>>>>>> information should help move this further along..
    >>>>>>>>
    >>>>>>>> 4) Your query:
    >>>>>>>>
    >>>>>>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core#
    >>>>>>>>> <http://www.w3.org/2004/02/skos/core#>>
    >>>>>>>>> PREFIX text: <http://jena.apache.org/text#
    >>>>>>>>> <http://jena.apache.org/text#>>
    >>>>>>>>> SELECT *
    >>>>>>>>> WHERE
    >>>>>>>>> {
    >>>>>>>>>     GRAPH <http://www.yso.fi/onto/mesh/
    >>>>>>>>> <http://www.yso.fi/onto/mesh/>>
    >>>>>>>>>     {
    >>>>>>>>>       ?concept text:query (skos:prefLabel "medi") .
    >>>>>>>>>       ?concept skos:prefLabel ?prefLabel .
    >>>>>>>>>
    >>>>>>>>>       # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
    >>>>>>>>>     }
    >>>>>>>>> }
    >>>>>>>>> limit 10
    >>>>>>>> might effectively just be executing:
    >>>>>>>>
    >>>>>>>>> ?concept skos:prefLabel ?prefLabel .
    >>>>>>>> if there is actually no jena-text config - I haven’t checked what
    >>>>>>>> happens when there is no TextIndex configured and the text:query
    >>>>>>>> is invoked, but may be a noop
    >>>>>>>>
    >>>>>>>> Thanks,
    >>>>>>>> Chris
    >>>>>>>>
    >>>>>>>>
    >>>>>>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen
    >>>>>>>>> <mi...@lingsoft.fi> wrote:
    >>>>>>>>>
    >>>>>>>>>
    >>>>>>>>>
    >>>>>>>>> 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: mikael.pesonen@lingsoft.fi
    >>>>>>>>> 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
    >>>>>>>>>
    >>>>>>> -- 
    >>>>>>> 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: mikael.pesonen@lingsoft.fi
    >>>>>>> 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
    >>>>>>>
    >
    
    -- 
    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: mikael.pesonen@lingsoft.fi
    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
    
    





Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
This is the call Skosmos makes:

GET http://localhost:3030/ds/sparql?query=...



On 22/01/2019 17:21, Mikael Pesonen wrote:
>
> Sorry had issues with permissions. So now I can load configuration 
> from cmd line
>
> /usr/bin/java 
> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
> -Xmx5600M -jar fuseki-server.jar --update --port 3030 
> --config=run/config.ttl
>
> and Indexer works
> ...
> INFO  2060054 (32699 per second) properties indexed
>
> and sparql text search works. Only issue remaining is that now Skosmos 
> application (and possible some others) stopped working. Fuseki log says
>  Fuseki     INFO  [2] 404 Not found: dataset='ds' service='sparql' (1 ms)
>
> Here is the config where I updated tdb:location:
>
> @prefix :<http://localhost/jena_example/#>  .
> @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#>
> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>
> ## Example of a TDB dataset and text index
> ## Initialize TDB
> [] ja:loadClass "org.apache.jena.tdb.TDB" .
> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>
> ## Initialize text query
> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
> # A TextDataset is a regular dataset with a text index.
> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
> # Lucene index
> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>
>
> ## ---------------------------------------------------------------
>
>
> :text_dataset rdf:type     text:TextDataset ;
>      text:dataset   :my_dataset ;
>      text:index     <#indexLucene> ;
>      .
>
> # A TDB dataset used for RDF storage
> :my_dataset rdf:type      tdb:DatasetTDB ;
>      tdb:location "/home/text/tools/jena_data_test/" ;
> #    tdb:unionDefaultGraph true ; # Optional
>      .
>
> # Text index description
> <#indexLucene> a text:TextIndexLucene ;
>      text:directory<file:/tmp/tdb-lucene-index>  ;
>      text:entityMap <#entMap> ;
>      text:storeValues true ;
>      text:analyzer [ a text:StandardAnalyzer ] ;
>      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>      text:queryParser text:AnalyzingQueryParser ;
>      text:multilingualSupport true ;
>   .
>
> <#entMap> a text:EntityMap ;
>      text:defaultField     "label" ;
>      text:entityField      "uri" ;
>      text:uidField         "uid" ;
>      text:langField        "lang" ;
>      text:graphField       "graph" ;
>      text:map (
>           [ text:field "label" ;
>             text:predicate skos:prefLabel ]
>           ) .
>
> <#service> rdf:type fuseki:Service ;
>      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
>      fuseki:serviceQuery             "query" ;    # SPARQL query service
>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store 
> protocol (read only)
>      fuseki:dataset           :text_dataset ;
>      .
>
>
>
> On 22/01/2019 17:01, Lorenz B. wrote:
>> Can't reproduce this. With the config file I shared with you, it works
>> for me as expected with Fuseki 3.10.0
>>
>> Which config file do you use now?
>>
>>> On 22/01/2019 16:17, vincent ventresque wrote:
>>>> Hello
>>>>
>>>> If the configuration folder is empty, the run/config.ttl (default
>>>> file) should be the one that Fuseki uses : you should try to replace
>>>> the content of run/config.ttl with the one Chris has sent in previous
>>>> msg
>>>>
>>> That worked!
>>>
>>> So now with the example Lorenz posted I get
>>>
>>>   java -cp ./fuseki-server.jar jena.textindexer --desc=run/config.ttl
>>> org.apache.jena.sparql.ARQException: No such type:
>>> <http://jena.apache.org/text#TextDataset>
>>>          at
>>> org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122) 
>>>
>>>          at
>>> org.apache.jena.query.text.TextDatasetFactory.create(TextDatasetFactory.java:38) 
>>>
>>>          at jena.textindexer.processModulesAndArgs(textindexer.java:90)
>>>          at jena.cmd.CmdArgModule.process(CmdArgModule.java:52)
>>>          at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
>>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>>>          at jena.textindexer.main(textindexer.java:52)
>>>
>>>
>>> @prefix :<http://localhost/jena_example/#>  .
>>> @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#>
>>> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>>>
>>> ## Example of a TDB dataset and text index
>>> ## Initialize TDB
>>> [] ja:loadClass "org.apache.jena.tdb.TDB" .
>>> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
>>> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>>>
>>> ## Initialize text query
>>> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
>>> # A TextDataset is a regular dataset with a text index.
>>> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
>>> # Lucene index
>>> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>>>
>>>
>>> ## ---------------------------------------------------------------
>>>
>>>
>>> :text_dataset rdf:type     text:TextDataset ;
>>>      text:dataset   :my_dataset ;
>>>      text:index     <#indexLucene> ;
>>>      .
>>>
>>> # A TDB dataset used for RDF storage
>>> :my_dataset rdf:type      tdb:DatasetTDB ;
>>>      tdb:location "/tmp/tdb-dataset/" ;
>>> #    tdb:unionDefaultGraph true ; # Optional
>>>      .
>>>
>>> # Text index description
>>> <#indexLucene> a text:TextIndexLucene ;
>>>      text:directory<file:/tmp/tdb-lucene-index>  ;
>>>      text:entityMap <#entMap> ;
>>>      text:storeValues true ;
>>>      text:analyzer [ a text:StandardAnalyzer ] ;
>>>      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>>>      text:queryParser text:AnalyzingQueryParser ;
>>>      text:multilingualSupport true ;
>>>   .
>>>
>>> <#entMap> a text:EntityMap ;
>>>      text:defaultField     "label" ;
>>>      text:entityField      "uri" ;
>>>      text:uidField         "uid" ;
>>>      text:langField        "lang" ;
>>>      text:graphField       "graph" ;
>>>      text:map (
>>>           [ text:field "label" ;
>>>             text:predicate skos:prefLabel ]
>>>           ) .
>>>
>>> <#service> rdf:type fuseki:Service ;
>>>      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
>>>      fuseki:serviceQuery             "query" ;    # SPARQL query 
>>> service
>>>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
>>> protocol (read only)
>>>      fuseki:dataset           :text_dataset ;
>>>      .
>>>
>>>> Le 22/01/2019 à 14:58, Mikael Pesonen a écrit :
>>>>> Hi,
>>>>>
>>>>> we haven't made any configuration files, so configuration folder is
>>>>> empty. Everything is working fine except text search so are there
>>>>> some advances for doing custom config? I understand now that for
>>>>> text search we need the config and about that I asked for help.
>>>>>
>>>>> On 21/01/2019 19:24, Chris Tomlinson wrote:
>>>>>> Hi,
>>>>>>
>>>>>> You’ve presented your system service configuration. We need to see
>>>>>> the configuration file
>>>>>> <http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html> 
>>>>>>
>>>>>> in:
>>>>>>
>>>>>>       $FUSEKI_BASE/configuration/text_svc.ttl
>>>>>>
>>>>>> It is a ttl file that is interpreted by the assembler system to
>>>>>> build the endpoints and dataset components. This is where the
>>>>>> jena-text configuration info will go. Here is a sample
>>>>>> configuration based on info in your service defn:
>>>>>>
>>>>>>> # Fuseki configuration for BDRC, configures two endpoints:
>>>>>>> #   - /bdrc is read-only
>>>>>>> #   - /bdrcrw is read-write
>>>>>>> #
>>>>>>> # This was painful to come up with but the web interface basically
>>>>>>> allows no option
>>>>>>> # and there is no subclass inference by default so such a
>>>>>>> configuration file is necessary.
>>>>>>> #
>>>>>>> # The main doc sources are:
>>>>>>> #  -
>>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html 
>>>>>>>
>>>>>>>
>>>>>>> #  -
>>>>>>> https://jena.apache.org/documentation/assembler/assembler-howto.html 
>>>>>>>
>>>>>>> #  - https://jena.apache.org/documentation/assembler/assembler.ttl
>>>>>>> #
>>>>>>> # See
>>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-layout.html
>>>>>>> for the destination of this file.
>>>>>>>
>>>>>>> @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#> .
>>>>>>> @prefix :        <http://base/#> .
>>>>>>>
>>>>>>> [] rdf:type fuseki:Server ;
>>>>>>>      fuseki:services (
>>>>>>>        :text_svc
>>>>>>>      ) .
>>>>>>>
>>>>>>> :text_svc rdf:type fuseki:Service ;
>>>>>>>       fuseki:name                       "text_svc" ;     # name of
>>>>>>> the dataset in the url
>>>>>>>       fuseki:serviceQuery               "query" ;    # SPARQL query
>>>>>>> service
>>>>>>>       fuseki:serviceUpdate              "update" ;   # SPARQL
>>>>>>> update service
>>>>>>>       fuseki:serviceUpload              "upload" ;   # Non-SPARQL
>>>>>>> upload service
>>>>>>>       fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph
>>>>>>> store protocol (read and write)
>>>>>>>       fuseki:dataset                    :text_dataset ;
>>>>>>>       .
>>>>>>>
>>>>>>> :text_dataset rdf:type     text:TextDataset ;
>>>>>>>       text:dataset   :tdb_dataset ;
>>>>>>>       text:index     :lucene_index ;
>>>>>>>       .
>>>>>>>
>>>>>>> # using TDB
>>>>>>> :tdb_dataset rdf:type tdb:DatasetTDB ;
>>>>>>>        tdb:location
>>>>>>> "/home/text/tools/apache-jena-fuseki-3.9.0/run/tdb_dataset" ;
>>>>>>>        tdb:unionDefaultGraph true ;
>>>>>>>        .
>>>>>>>
>>>>>>> # Text index description
>>>>>>> :lucene_index a text:TextIndexLucene ;
>>>>>>>       text:directory
>>>>>>> <file:/home/text/tools/apache-jena-fuseki-3.9.0/run/lucene_index> ;
>>>>>>>       text:storeValues true ;
>>>>>>>       text:entityMap :entitymap ;
>>>>>>>       .
>>>>>>>
>>>>>>> # Index mappings
>>>>>>> :entitymap a text:EntityMap ;
>>>>>>>       text:entityField      "uri" ;
>>>>>>>       text:uidField         "uid" ;
>>>>>>>       text:defaultField     "label" ;
>>>>>>>       text:langField        "lang" ;
>>>>>>>       text:graphField       "graph" ; ## enable graph-specific
>>>>>>> indexing
>>>>>>>       text:map (
>>>>>>>            [ text:field "label" ;
>>>>>>>              text:predicate skos:prefLabel ]
>>>>>>>            ) ;
>>>>>>>       .
>>>>>> hth,
>>>>>> Chris
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>> On Jan 21, 2019, at 5:21 AM, Mikael Pesonen
>>>>>>> <mi...@lingsoft.fi> wrote:
>>>>>>>
>>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>>
>>>>>>> On 18/01/2019 18:13, Chris Tomlinson wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> 1) If you’re using a default config, it does not have a working
>>>>>>>> jena-text configuration. The config will need to include
>>>>>>>> skos:prefLabel in the entity map.
>>>>>>>>
>>>>>>>> 2) when you change the jena-text in significant ways, such as
>>>>>>>> changing what analyzer is used for a given property and so on,
>>>>>>>> then you’ll need to rebuild the Lucene index via reloading the
>>>>>>>> dataset or using the textIndexer
>>>>>>>> <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. 
>>>>>>>>
>>>>>>>> I don’t recall this being mentioned as part of your testing
>>>>>>>>
>>>>>>>> 3) Please indicate exactly which item you’re using
>>>>>>>> jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc,
>>>>>>>> and the config file itself. The error you’ve mentioned previously:
>>>>>>> We are running Fuseki as service
>>>>>>>
>>>>>>> -----
>>>>>>> [Unit]
>>>>>>> Description=Apache Jena Fuseki
>>>>>>>
>>>>>>> [Service]
>>>>>>> Type=simple
>>>>>>> User=fuseki
>>>>>>> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
>>>>>>> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
>>>>>>> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run 
>>>>>>>
>>>>>>> ExecStart=/usr/bin/java
>>>>>>> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
>>>>>>>
>>>>>>> -Xmx5600M -jar
>>>>>>> /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar
>>>>>>> --update --port 3030 --loc=/home/text/tools/jena_data_test/ /ds
>>>>>>>
>>>>>>> [Install]
>>>>>>> WantedBy=multi-user.target
>>>>>>> -----
>>>>>>>
>>>>>>> All settings are default otherwise, we haven't changed any config
>>>>>>> file.
>>>>>>>
>>>>>>> Are there some minimal settings to this example config so that I
>>>>>>> could get skos:prefLabel working?
>>>>>>>
>>>>>>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> So when we have a working configuration/assembler file, all is
>>>>>>> needed is to build the index
>>>>>>>
>>>>>>> java  -cp  $FUSEKI_HOME/fuseki-server.jar jena.textindexer
>>>>>>> --desc=assembler_file ?
>>>>>>>
>>>>>>>
>>>>>>> Thank everyone for the help
>>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>>>>>>>> Config     INFO  Load configuration:
>>>>>>>>> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl 
>>>>>>>>>
>>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl> 
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>>>>>>>> WebAppContext WARN  Failed startup of context
>>>>>>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki
>>>>>>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE 
>>>>>>>>>
>>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>} 
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: at
>>>>>>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148) 
>>>>>>>>>
>>>>>>>> suggests to me that something in the config file is confusing the
>>>>>>>> readAssemblerFile. It doesn’t look like it’s failing in the
>>>>>>>> reading the jena-text portion of the config.
>>>>>>>>
>>>>>>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl
>>>>>>>> <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset,
>>>>>>>> then can you cut it down to just a small test case with some
>>>>>>>> concepts with “medi” and a few without? That along with the other
>>>>>>>> information should help move this further along..
>>>>>>>>
>>>>>>>> 4) Your query:
>>>>>>>>
>>>>>>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core#
>>>>>>>>> <http://www.w3.org/2004/02/skos/core#>>
>>>>>>>>> PREFIX text: <http://jena.apache.org/text#
>>>>>>>>> <http://jena.apache.org/text#>>
>>>>>>>>> SELECT *
>>>>>>>>> WHERE
>>>>>>>>> {
>>>>>>>>>     GRAPH <http://www.yso.fi/onto/mesh/
>>>>>>>>> <http://www.yso.fi/onto/mesh/>>
>>>>>>>>>     {
>>>>>>>>>       ?concept text:query (skos:prefLabel "medi") .
>>>>>>>>>       ?concept skos:prefLabel ?prefLabel .
>>>>>>>>>
>>>>>>>>>       # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>>>>>>>     }
>>>>>>>>> }
>>>>>>>>> limit 10
>>>>>>>> might effectively just be executing:
>>>>>>>>
>>>>>>>>> ?concept skos:prefLabel ?prefLabel .
>>>>>>>> if there is actually no jena-text config - I haven’t checked what
>>>>>>>> happens when there is no TextIndex configured and the text:query
>>>>>>>> is invoked, but may be a noop
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Chris
>>>>>>>>
>>>>>>>>
>>>>>>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen
>>>>>>>>> <mi...@lingsoft.fi> wrote:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>>>>>> 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
>>>>>>>>>
>>>>>>> -- 
>>>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>>>> 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
>>>>>>>
>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
Sorry had issues with permissions. So now I can load configuration from 
cmd line

/usr/bin/java 
-Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
-Xmx5600M -jar fuseki-server.jar --update --port 3030 
--config=run/config.ttl

and Indexer works
...
INFO  2060054 (32699 per second) properties indexed

and sparql text search works. Only issue remaining is that now Skosmos 
application (and possible some others) stopped working. Fuseki log says
  Fuseki     INFO  [2] 404 Not found: dataset='ds' service='sparql' (1 ms)

Here is the config where I updated tdb:location:

@prefix :<http://localhost/jena_example/#>  .
@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#>
@prefix fuseki:<http://jena.apache.org/fuseki#>  .

## Example of a TDB dataset and text index
## Initialize TDB
[] ja:loadClass "org.apache.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

## Initialize text query
[] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
# A TextDataset is a regular dataset with a text index.
text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
# Lucene index
text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .


## ---------------------------------------------------------------


:text_dataset rdf:type     text:TextDataset ;
      text:dataset   :my_dataset ;
      text:index     <#indexLucene> ;
      .

# A TDB dataset used for RDF storage
:my_dataset rdf:type      tdb:DatasetTDB ;
      tdb:location "/home/text/tools/jena_data_test/" ;
#    tdb:unionDefaultGraph true ; # Optional
      .

# Text index description
<#indexLucene> a text:TextIndexLucene ;
      text:directory<file:/tmp/tdb-lucene-index>  ;
      text:entityMap <#entMap> ;
      text:storeValues true ;
      text:analyzer [ a text:StandardAnalyzer ] ;
      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
      text:queryParser text:AnalyzingQueryParser ;
      text:multilingualSupport true ;
   .

<#entMap> a text:EntityMap ;
      text:defaultField     "label" ;
      text:entityField      "uri" ;
      text:uidField         "uid" ;
      text:langField        "lang" ;
      text:graphField       "graph" ;
      text:map (
           [ text:field "label" ;
             text:predicate skos:prefLabel ]
           ) .

<#service> rdf:type fuseki:Service ;
      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
      fuseki:serviceQuery             "query" ;    # SPARQL query service
      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store 
protocol (read only)
      fuseki:dataset           :text_dataset ;
      .



On 22/01/2019 17:01, Lorenz B. wrote:
> Can't reproduce this. With the config file I shared with you, it works
> for me as expected with Fuseki 3.10.0
>
> Which config file do you use now?
>
>> On 22/01/2019 16:17, vincent ventresque wrote:
>>> Hello
>>>
>>> If the configuration folder is empty, the run/config.ttl (default
>>> file) should be the one that Fuseki uses : you should try to replace
>>> the content of run/config.ttl with the one Chris has sent in previous
>>> msg
>>>
>> That worked!
>>
>> So now with the example Lorenz posted I get
>>
>>   java -cp ./fuseki-server.jar jena.textindexer --desc=run/config.ttl
>> org.apache.jena.sparql.ARQException: No such type:
>> <http://jena.apache.org/text#TextDataset>
>>          at
>> org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>>          at
>> org.apache.jena.query.text.TextDatasetFactory.create(TextDatasetFactory.java:38)
>>          at jena.textindexer.processModulesAndArgs(textindexer.java:90)
>>          at jena.cmd.CmdArgModule.process(CmdArgModule.java:52)
>>          at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>>          at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>>          at jena.textindexer.main(textindexer.java:52)
>>
>>
>> @prefix :<http://localhost/jena_example/#>  .
>> @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#>
>> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>>
>> ## Example of a TDB dataset and text index
>> ## Initialize TDB
>> [] ja:loadClass "org.apache.jena.tdb.TDB" .
>> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
>> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>>
>> ## Initialize text query
>> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
>> # A TextDataset is a regular dataset with a text index.
>> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
>> # Lucene index
>> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>>
>>
>> ## ---------------------------------------------------------------
>>
>>
>> :text_dataset rdf:type     text:TextDataset ;
>>      text:dataset   :my_dataset ;
>>      text:index     <#indexLucene> ;
>>      .
>>
>> # A TDB dataset used for RDF storage
>> :my_dataset rdf:type      tdb:DatasetTDB ;
>>      tdb:location "/tmp/tdb-dataset/" ;
>> #    tdb:unionDefaultGraph true ; # Optional
>>      .
>>
>> # Text index description
>> <#indexLucene> a text:TextIndexLucene ;
>>      text:directory<file:/tmp/tdb-lucene-index>  ;
>>      text:entityMap <#entMap> ;
>>      text:storeValues true ;
>>      text:analyzer [ a text:StandardAnalyzer ] ;
>>      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>>      text:queryParser text:AnalyzingQueryParser ;
>>      text:multilingualSupport true ;
>>   .
>>
>> <#entMap> a text:EntityMap ;
>>      text:defaultField     "label" ;
>>      text:entityField      "uri" ;
>>      text:uidField         "uid" ;
>>      text:langField        "lang" ;
>>      text:graphField       "graph" ;
>>      text:map (
>>           [ text:field "label" ;
>>             text:predicate skos:prefLabel ]
>>           ) .
>>
>> <#service> rdf:type fuseki:Service ;
>>      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
>>      fuseki:serviceQuery             "query" ;    # SPARQL query service
>>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
>> protocol (read only)
>>      fuseki:dataset           :text_dataset ;
>>      .
>>
>>> Le 22/01/2019 à 14:58, Mikael Pesonen a écrit :
>>>> Hi,
>>>>
>>>> we haven't made any configuration files, so configuration folder is
>>>> empty. Everything is working fine except text search so are there
>>>> some advances for doing custom config? I understand now that for
>>>> text search we need the config and about that I asked for help.
>>>>
>>>> On 21/01/2019 19:24, Chris Tomlinson wrote:
>>>>> Hi,
>>>>>
>>>>> You’ve presented your system service configuration. We need to see
>>>>> the configuration file
>>>>> <http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html>
>>>>> in:
>>>>>
>>>>>       $FUSEKI_BASE/configuration/text_svc.ttl
>>>>>
>>>>> It is a ttl file that is interpreted by the assembler system to
>>>>> build the endpoints and dataset components. This is where the
>>>>> jena-text configuration info will go. Here is a sample
>>>>> configuration based on info in your service defn:
>>>>>
>>>>>> # Fuseki configuration for BDRC, configures two endpoints:
>>>>>> #   - /bdrc is read-only
>>>>>> #   - /bdrcrw is read-write
>>>>>> #
>>>>>> # This was painful to come up with but the web interface basically
>>>>>> allows no option
>>>>>> # and there is no subclass inference by default so such a
>>>>>> configuration file is necessary.
>>>>>> #
>>>>>> # The main doc sources are:
>>>>>> #  -
>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html
>>>>>>
>>>>>> #  -
>>>>>> https://jena.apache.org/documentation/assembler/assembler-howto.html
>>>>>> #  - https://jena.apache.org/documentation/assembler/assembler.ttl
>>>>>> #
>>>>>> # See
>>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-layout.html
>>>>>> for the destination of this file.
>>>>>>
>>>>>> @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#> .
>>>>>> @prefix :        <http://base/#> .
>>>>>>
>>>>>> [] rdf:type fuseki:Server ;
>>>>>>      fuseki:services (
>>>>>>        :text_svc
>>>>>>      ) .
>>>>>>
>>>>>> :text_svc rdf:type fuseki:Service ;
>>>>>>       fuseki:name                       "text_svc" ;     # name of
>>>>>> the dataset in the url
>>>>>>       fuseki:serviceQuery               "query" ;    # SPARQL query
>>>>>> service
>>>>>>       fuseki:serviceUpdate              "update" ;   # SPARQL
>>>>>> update service
>>>>>>       fuseki:serviceUpload              "upload" ;   # Non-SPARQL
>>>>>> upload service
>>>>>>       fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph
>>>>>> store protocol (read and write)
>>>>>>       fuseki:dataset                    :text_dataset ;
>>>>>>       .
>>>>>>
>>>>>> :text_dataset rdf:type     text:TextDataset ;
>>>>>>       text:dataset   :tdb_dataset ;
>>>>>>       text:index     :lucene_index ;
>>>>>>       .
>>>>>>
>>>>>> # using TDB
>>>>>> :tdb_dataset rdf:type tdb:DatasetTDB ;
>>>>>>        tdb:location
>>>>>> "/home/text/tools/apache-jena-fuseki-3.9.0/run/tdb_dataset" ;
>>>>>>        tdb:unionDefaultGraph true ;
>>>>>>        .
>>>>>>
>>>>>> # Text index description
>>>>>> :lucene_index a text:TextIndexLucene ;
>>>>>>       text:directory
>>>>>> <file:/home/text/tools/apache-jena-fuseki-3.9.0/run/lucene_index> ;
>>>>>>       text:storeValues true ;
>>>>>>       text:entityMap :entitymap ;
>>>>>>       .
>>>>>>
>>>>>> # Index mappings
>>>>>> :entitymap a text:EntityMap ;
>>>>>>       text:entityField      "uri" ;
>>>>>>       text:uidField         "uid" ;
>>>>>>       text:defaultField     "label" ;
>>>>>>       text:langField        "lang" ;
>>>>>>       text:graphField       "graph" ; ## enable graph-specific
>>>>>> indexing
>>>>>>       text:map (
>>>>>>            [ text:field "label" ;
>>>>>>              text:predicate skos:prefLabel ]
>>>>>>            ) ;
>>>>>>       .
>>>>> hth,
>>>>> Chris
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>> On Jan 21, 2019, at 5:21 AM, Mikael Pesonen
>>>>>> <mi...@lingsoft.fi> wrote:
>>>>>>
>>>>>>
>>>>>> Hi,
>>>>>>
>>>>>>
>>>>>> On 18/01/2019 18:13, Chris Tomlinson wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> 1) If you’re using a default config, it does not have a working
>>>>>>> jena-text configuration. The config will need to include
>>>>>>> skos:prefLabel in the entity map.
>>>>>>>
>>>>>>> 2) when you change the jena-text in significant ways, such as
>>>>>>> changing what analyzer is used for a given property and so on,
>>>>>>> then you’ll need to rebuild the Lucene index via reloading the
>>>>>>> dataset or using the textIndexer
>>>>>>> <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>.
>>>>>>> I don’t recall this being mentioned as part of your testing
>>>>>>>
>>>>>>> 3) Please indicate exactly which item you’re using
>>>>>>> jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc,
>>>>>>> and the config file itself. The error you’ve mentioned previously:
>>>>>> We are running Fuseki as service
>>>>>>
>>>>>> -----
>>>>>> [Unit]
>>>>>> Description=Apache Jena Fuseki
>>>>>>
>>>>>> [Service]
>>>>>> Type=simple
>>>>>> User=fuseki
>>>>>> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
>>>>>> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
>>>>>> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
>>>>>> ExecStart=/usr/bin/java
>>>>>> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties
>>>>>> -Xmx5600M -jar
>>>>>> /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar
>>>>>> --update --port 3030  --loc=/home/text/tools/jena_data_test/ /ds
>>>>>>
>>>>>> [Install]
>>>>>> WantedBy=multi-user.target
>>>>>> -----
>>>>>>
>>>>>> All settings are default otherwise, we haven't changed any config
>>>>>> file.
>>>>>>
>>>>>> Are there some minimal settings to this example config so that I
>>>>>> could get skos:prefLabel working?
>>>>>>
>>>>>> https://jena.apache.org/documentation/query/text-query.html#configuration
>>>>>>
>>>>>>
>>>>>> So when we have a working configuration/assembler file, all is
>>>>>> needed is to build the index
>>>>>>
>>>>>> java  -cp  $FUSEKI_HOME/fuseki-server.jar  jena.textindexer
>>>>>> --desc=assembler_file ?
>>>>>>
>>>>>>
>>>>>> Thank everyone for the help
>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>>>>>>> Config     INFO  Load configuration:
>>>>>>>> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl
>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>>>>>>>>
>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>>>>>>> WebAppContext WARN  Failed startup of context
>>>>>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki
>>>>>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE
>>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>>>>>>>>
>>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]:         at
>>>>>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>>>>>>> suggests to me that something in the config file is confusing the
>>>>>>> readAssemblerFile. It doesn’t look like it’s failing in the
>>>>>>> reading the jena-text portion of the config.
>>>>>>>
>>>>>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl
>>>>>>> <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset,
>>>>>>> then can you cut it down to just a small test case with some
>>>>>>> concepts with “medi” and a few without? That along with the other
>>>>>>> information should help move this further along..
>>>>>>>
>>>>>>> 4) Your query:
>>>>>>>
>>>>>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core#
>>>>>>>> <http://www.w3.org/2004/02/skos/core#>>
>>>>>>>> PREFIX text: <http://jena.apache.org/text#
>>>>>>>> <http://jena.apache.org/text#>>
>>>>>>>> SELECT *
>>>>>>>> WHERE
>>>>>>>> {
>>>>>>>>     GRAPH <http://www.yso.fi/onto/mesh/
>>>>>>>> <http://www.yso.fi/onto/mesh/>>
>>>>>>>>     {
>>>>>>>>       ?concept text:query (skos:prefLabel "medi") .
>>>>>>>>       ?concept skos:prefLabel ?prefLabel .
>>>>>>>>
>>>>>>>>       # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>>>>>>     }
>>>>>>>> }
>>>>>>>> limit 10
>>>>>>> might effectively just be executing:
>>>>>>>
>>>>>>>> ?concept skos:prefLabel ?prefLabel .
>>>>>>> if there is actually no jena-text config - I haven’t checked what
>>>>>>> happens when there is no TextIndex configured and the text:query
>>>>>>> is invoked, but may be a noop
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Chris
>>>>>>>
>>>>>>>
>>>>>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen
>>>>>>>> <mi...@lingsoft.fi> wrote:
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>>>>> 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
>>>>>>>>
>>>>>> -- 
>>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>>> 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
>>>>>>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
Can't reproduce this. With the config file I shared with you, it works
for me as expected with Fuseki 3.10.0

Which config file do you use now?

>
> On 22/01/2019 16:17, vincent ventresque wrote:
>> Hello
>>
>> If the configuration folder is empty, the run/config.ttl (default
>> file) should be the one that Fuseki uses : you should try to replace
>> the content of run/config.ttl with the one Chris has sent in previous
>> msg
>>
> That worked!
>
> So now with the example Lorenz posted I get
>
>  java -cp ./fuseki-server.jar jena.textindexer --desc=run/config.ttl
> org.apache.jena.sparql.ARQException: No such type:
> <http://jena.apache.org/text#TextDataset>
>         at
> org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
>         at
> org.apache.jena.query.text.TextDatasetFactory.create(TextDatasetFactory.java:38)
>         at jena.textindexer.processModulesAndArgs(textindexer.java:90)
>         at jena.cmd.CmdArgModule.process(CmdArgModule.java:52)
>         at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
>         at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>         at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>         at jena.textindexer.main(textindexer.java:52)
>
>
> @prefix :<http://localhost/jena_example/#>  .
> @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#>
> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>
> ## Example of a TDB dataset and text index
> ## Initialize TDB
> [] ja:loadClass "org.apache.jena.tdb.TDB" .
> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>
> ## Initialize text query
> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
> # A TextDataset is a regular dataset with a text index.
> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
> # Lucene index
> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>
>
> ## ---------------------------------------------------------------
>
>
> :text_dataset rdf:type     text:TextDataset ;
>     text:dataset   :my_dataset ;
>     text:index     <#indexLucene> ;
>     .
>
> # A TDB dataset used for RDF storage
> :my_dataset rdf:type      tdb:DatasetTDB ;
>     tdb:location "/tmp/tdb-dataset/" ;
> #    tdb:unionDefaultGraph true ; # Optional
>     .
>
> # Text index description
> <#indexLucene> a text:TextIndexLucene ;
>     text:directory<file:/tmp/tdb-lucene-index>  ;
>     text:entityMap <#entMap> ;
>     text:storeValues true ;
>     text:analyzer [ a text:StandardAnalyzer ] ;
>     text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>     text:queryParser text:AnalyzingQueryParser ;
>     text:multilingualSupport true ;
>  .
>
> <#entMap> a text:EntityMap ;
>     text:defaultField     "label" ;
>     text:entityField      "uri" ;
>     text:uidField         "uid" ;
>     text:langField        "lang" ;
>     text:graphField       "graph" ;
>     text:map (
>          [ text:field "label" ;
>            text:predicate skos:prefLabel ]
>          ) .
>
> <#service> rdf:type fuseki:Service ;
>     fuseki:name                     "/ds" ;   # http://host:port/ds-ro
>     fuseki:serviceQuery             "query" ;    # SPARQL query service
>     fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
> protocol (read only)
>     fuseki:dataset           :text_dataset ;
>     .
>
>> Le 22/01/2019 à 14:58, Mikael Pesonen a écrit :
>>>
>>> Hi,
>>>
>>> we haven't made any configuration files, so configuration folder is
>>> empty. Everything is working fine except text search so are there
>>> some advances for doing custom config? I understand now that for
>>> text search we need the config and about that I asked for help.
>>>
>>> On 21/01/2019 19:24, Chris Tomlinson wrote:
>>>> Hi,
>>>>
>>>> You’ve presented your system service configuration. We need to see
>>>> the configuration file
>>>> <http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html>
>>>> in:
>>>>
>>>>      $FUSEKI_BASE/configuration/text_svc.ttl
>>>>
>>>> It is a ttl file that is interpreted by the assembler system to
>>>> build the endpoints and dataset components. This is where the
>>>> jena-text configuration info will go. Here is a sample
>>>> configuration based on info in your service defn:
>>>>
>>>>> # Fuseki configuration for BDRC, configures two endpoints:
>>>>> #   - /bdrc is read-only
>>>>> #   - /bdrcrw is read-write
>>>>> #
>>>>> # This was painful to come up with but the web interface basically
>>>>> allows no option
>>>>> # and there is no subclass inference by default so such a
>>>>> configuration file is necessary.
>>>>> #
>>>>> # The main doc sources are:
>>>>> #  -
>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html
>>>>>
>>>>> #  -
>>>>> https://jena.apache.org/documentation/assembler/assembler-howto.html
>>>>> #  - https://jena.apache.org/documentation/assembler/assembler.ttl
>>>>> #
>>>>> # See
>>>>> https://jena.apache.org/documentation/fuseki2/fuseki-layout.html
>>>>> for the destination of this file.
>>>>>
>>>>> @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#> .
>>>>> @prefix :        <http://base/#> .
>>>>>
>>>>> [] rdf:type fuseki:Server ;
>>>>>     fuseki:services (
>>>>>       :text_svc
>>>>>     ) .
>>>>>
>>>>> :text_svc rdf:type fuseki:Service ;
>>>>>      fuseki:name                       "text_svc" ;     # name of
>>>>> the dataset in the url
>>>>>      fuseki:serviceQuery               "query" ;    # SPARQL query
>>>>> service
>>>>>      fuseki:serviceUpdate              "update" ;   # SPARQL
>>>>> update service
>>>>>      fuseki:serviceUpload              "upload" ;   # Non-SPARQL
>>>>> upload service
>>>>>      fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph
>>>>> store protocol (read and write)
>>>>>      fuseki:dataset                    :text_dataset ;
>>>>>      .
>>>>>
>>>>> :text_dataset rdf:type     text:TextDataset ;
>>>>>      text:dataset   :tdb_dataset ;
>>>>>      text:index     :lucene_index ;
>>>>>      .
>>>>>
>>>>> # using TDB
>>>>> :tdb_dataset rdf:type tdb:DatasetTDB ;
>>>>>       tdb:location
>>>>> "/home/text/tools/apache-jena-fuseki-3.9.0/run/tdb_dataset" ;
>>>>>       tdb:unionDefaultGraph true ;
>>>>>       .
>>>>>
>>>>> # Text index description
>>>>> :lucene_index a text:TextIndexLucene ;
>>>>>      text:directory
>>>>> <file:/home/text/tools/apache-jena-fuseki-3.9.0/run/lucene_index> ;
>>>>>      text:storeValues true ;
>>>>>      text:entityMap :entitymap ;
>>>>>      .
>>>>>
>>>>> # Index mappings
>>>>> :entitymap a text:EntityMap ;
>>>>>      text:entityField      "uri" ;
>>>>>      text:uidField         "uid" ;
>>>>>      text:defaultField     "label" ;
>>>>>      text:langField        "lang" ;
>>>>>      text:graphField       "graph" ; ## enable graph-specific
>>>>> indexing
>>>>>      text:map (
>>>>>           [ text:field "label" ;
>>>>>             text:predicate skos:prefLabel ]
>>>>>           ) ;
>>>>>      .
>>>> hth,
>>>> Chris
>>>>
>>>>
>>>>
>>>>
>>>>> On Jan 21, 2019, at 5:21 AM, Mikael Pesonen
>>>>> <mi...@lingsoft.fi> wrote:
>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>>
>>>>> On 18/01/2019 18:13, Chris Tomlinson wrote:
>>>>>> Hi,
>>>>>>
>>>>>> 1) If you’re using a default config, it does not have a working
>>>>>> jena-text configuration. The config will need to include
>>>>>> skos:prefLabel in the entity map.
>>>>>>
>>>>>> 2) when you change the jena-text in significant ways, such as
>>>>>> changing what analyzer is used for a given property and so on,
>>>>>> then you’ll need to rebuild the Lucene index via reloading the
>>>>>> dataset or using the textIndexer
>>>>>> <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>.
>>>>>> I don’t recall this being mentioned as part of your testing
>>>>>>
>>>>>> 3) Please indicate exactly which item you’re using
>>>>>> jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc,
>>>>>> and the config file itself. The error you’ve mentioned previously:
>>>>> We are running Fuseki as service
>>>>>
>>>>> -----
>>>>> [Unit]
>>>>> Description=Apache Jena Fuseki
>>>>>
>>>>> [Service]
>>>>> Type=simple
>>>>> User=fuseki
>>>>> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
>>>>> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
>>>>> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
>>>>> ExecStart=/usr/bin/java
>>>>> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties
>>>>> -Xmx5600M -jar
>>>>> /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar
>>>>> --update --port 3030  --loc=/home/text/tools/jena_data_test/ /ds
>>>>>
>>>>> [Install]
>>>>> WantedBy=multi-user.target
>>>>> -----
>>>>>
>>>>> All settings are default otherwise, we haven't changed any config
>>>>> file.
>>>>>
>>>>> Are there some minimal settings to this example config so that I
>>>>> could get skos:prefLabel working?
>>>>>
>>>>> https://jena.apache.org/documentation/query/text-query.html#configuration
>>>>>
>>>>>
>>>>> So when we have a working configuration/assembler file, all is
>>>>> needed is to build the index
>>>>>
>>>>> java  -cp  $FUSEKI_HOME/fuseki-server.jar  jena.textindexer
>>>>> --desc=assembler_file ?
>>>>>
>>>>>
>>>>> Thank everyone for the help
>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>>>>>> Config     INFO  Load configuration:
>>>>>>> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl
>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>>>>>>>
>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>>>>>> WebAppContext WARN  Failed startup of context
>>>>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki
>>>>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE
>>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>>>>>>>
>>>>>>> Jan 17 17:00:28 semantic-dev java[16800]:         at
>>>>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>>>>>> suggests to me that something in the config file is confusing the
>>>>>> readAssemblerFile. It doesn’t look like it’s failing in the
>>>>>> reading the jena-text portion of the config.
>>>>>>
>>>>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl
>>>>>> <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset,
>>>>>> then can you cut it down to just a small test case with some
>>>>>> concepts with “medi” and a few without? That along with the other
>>>>>> information should help move this further along..
>>>>>>
>>>>>> 4) Your query:
>>>>>>
>>>>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core#
>>>>>>> <http://www.w3.org/2004/02/skos/core#>>
>>>>>>> PREFIX text: <http://jena.apache.org/text#
>>>>>>> <http://jena.apache.org/text#>>
>>>>>>> SELECT *
>>>>>>> WHERE
>>>>>>> {
>>>>>>>    GRAPH <http://www.yso.fi/onto/mesh/
>>>>>>> <http://www.yso.fi/onto/mesh/>>
>>>>>>>    {
>>>>>>>      ?concept text:query (skos:prefLabel "medi") .
>>>>>>>      ?concept skos:prefLabel ?prefLabel .
>>>>>>>
>>>>>>>      # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>>>>>    }
>>>>>>> }
>>>>>>> limit 10
>>>>>> might effectively just be executing:
>>>>>>
>>>>>>> ?concept skos:prefLabel ?prefLabel .
>>>>>> if there is actually no jena-text config - I haven’t checked what
>>>>>> happens when there is no TextIndex configured and the text:query
>>>>>> is invoked, but may be a noop
>>>>>>
>>>>>> Thanks,
>>>>>> Chris
>>>>>>
>>>>>>
>>>>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen
>>>>>>> <mi...@lingsoft.fi> wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>>>> 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
>>>>>>>
>>>>> -- 
>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>> 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
>>>>>
>>>>
>>>
>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center


Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
On 22/01/2019 16:17, vincent ventresque wrote:
> Hello
>
> If the configuration folder is empty, the run/config.ttl (default 
> file) should be the one that Fuseki uses : you should try to replace 
> the content of run/config.ttl with the one Chris has sent in previous msg
>
That worked!

So now with the example Lorenz posted I get

  java -cp ./fuseki-server.jar jena.textindexer --desc=run/config.ttl
org.apache.jena.sparql.ARQException: No such type: 
<http://jena.apache.org/text#TextDataset>
         at 
org.apache.jena.sparql.core.assembler.AssemblerUtils.build(AssemblerUtils.java:122)
         at 
org.apache.jena.query.text.TextDatasetFactory.create(TextDatasetFactory.java:38)
         at jena.textindexer.processModulesAndArgs(textindexer.java:90)
         at jena.cmd.CmdArgModule.process(CmdArgModule.java:52)
         at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
         at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
         at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
         at jena.textindexer.main(textindexer.java:52)


@prefix :<http://localhost/jena_example/#>  .
@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#>
@prefix fuseki:<http://jena.apache.org/fuseki#>  .

## Example of a TDB dataset and text index
## Initialize TDB
[] ja:loadClass "org.apache.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

## Initialize text query
[] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
# A TextDataset is a regular dataset with a text index.
text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
# Lucene index
text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .


## ---------------------------------------------------------------


:text_dataset rdf:type     text:TextDataset ;
     text:dataset   :my_dataset ;
     text:index     <#indexLucene> ;
     .

# A TDB dataset used for RDF storage
:my_dataset rdf:type      tdb:DatasetTDB ;
     tdb:location "/tmp/tdb-dataset/" ;
#    tdb:unionDefaultGraph true ; # Optional
     .

# Text index description
<#indexLucene> a text:TextIndexLucene ;
     text:directory<file:/tmp/tdb-lucene-index>  ;
     text:entityMap <#entMap> ;
     text:storeValues true ;
     text:analyzer [ a text:StandardAnalyzer ] ;
     text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
     text:queryParser text:AnalyzingQueryParser ;
     text:multilingualSupport true ;
  .

<#entMap> a text:EntityMap ;
     text:defaultField     "label" ;
     text:entityField      "uri" ;
     text:uidField         "uid" ;
     text:langField        "lang" ;
     text:graphField       "graph" ;
     text:map (
          [ text:field "label" ;
            text:predicate skos:prefLabel ]
          ) .

<#service> rdf:type fuseki:Service ;
     fuseki:name                     "/ds" ;   # http://host:port/ds-ro
     fuseki:serviceQuery             "query" ;    # SPARQL query service
     fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
protocol (read only)
     fuseki:dataset           :text_dataset ;
     .

> Le 22/01/2019 à 14:58, Mikael Pesonen a écrit :
>>
>> Hi,
>>
>> we haven't made any configuration files, so configuration folder is 
>> empty. Everything is working fine except text search so are there 
>> some advances for doing custom config? I understand now that for text 
>> search we need the config and about that I asked for help.
>>
>> On 21/01/2019 19:24, Chris Tomlinson wrote:
>>> Hi,
>>>
>>> You’ve presented your system service configuration. We need to see 
>>> the configuration file 
>>> <http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html> 
>>> in:
>>>
>>>      $FUSEKI_BASE/configuration/text_svc.ttl
>>>
>>> It is a ttl file that is interpreted by the assembler system to 
>>> build the endpoints and dataset components. This is where the 
>>> jena-text configuration info will go. Here is a sample configuration 
>>> based on info in your service defn:
>>>
>>>> # Fuseki configuration for BDRC, configures two endpoints:
>>>> #   - /bdrc is read-only
>>>> #   - /bdrcrw is read-write
>>>> #
>>>> # This was painful to come up with but the web interface basically 
>>>> allows no option
>>>> # and there is no subclass inference by default so such a 
>>>> configuration file is necessary.
>>>> #
>>>> # The main doc sources are:
>>>> #  - 
>>>> https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html 
>>>>
>>>> #  - 
>>>> https://jena.apache.org/documentation/assembler/assembler-howto.html
>>>> #  - https://jena.apache.org/documentation/assembler/assembler.ttl
>>>> #
>>>> # See 
>>>> https://jena.apache.org/documentation/fuseki2/fuseki-layout.html 
>>>> for the destination of this file.
>>>>
>>>> @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#> .
>>>> @prefix :        <http://base/#> .
>>>>
>>>> [] rdf:type fuseki:Server ;
>>>>     fuseki:services (
>>>>       :text_svc
>>>>     ) .
>>>>
>>>> :text_svc rdf:type fuseki:Service ;
>>>>      fuseki:name                       "text_svc" ;     # name of 
>>>> the dataset in the url
>>>>      fuseki:serviceQuery               "query" ;    # SPARQL query 
>>>> service
>>>>      fuseki:serviceUpdate              "update" ;   # SPARQL update 
>>>> service
>>>>      fuseki:serviceUpload              "upload" ;   # Non-SPARQL 
>>>> upload service
>>>>      fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph 
>>>> store protocol (read and write)
>>>>      fuseki:dataset                    :text_dataset ;
>>>>      .
>>>>
>>>> :text_dataset rdf:type     text:TextDataset ;
>>>>      text:dataset   :tdb_dataset ;
>>>>      text:index     :lucene_index ;
>>>>      .
>>>>
>>>> # using TDB
>>>> :tdb_dataset rdf:type tdb:DatasetTDB ;
>>>>       tdb:location 
>>>> "/home/text/tools/apache-jena-fuseki-3.9.0/run/tdb_dataset" ;
>>>>       tdb:unionDefaultGraph true ;
>>>>       .
>>>>
>>>> # Text index description
>>>> :lucene_index a text:TextIndexLucene ;
>>>>      text:directory 
>>>> <file:/home/text/tools/apache-jena-fuseki-3.9.0/run/lucene_index> ;
>>>>      text:storeValues true ;
>>>>      text:entityMap :entitymap ;
>>>>      .
>>>>
>>>> # Index mappings
>>>> :entitymap a text:EntityMap ;
>>>>      text:entityField      "uri" ;
>>>>      text:uidField         "uid" ;
>>>>      text:defaultField     "label" ;
>>>>      text:langField        "lang" ;
>>>>      text:graphField       "graph" ; ## enable graph-specific indexing
>>>>      text:map (
>>>>           [ text:field "label" ;
>>>>             text:predicate skos:prefLabel ]
>>>>           ) ;
>>>>      .
>>> hth,
>>> Chris
>>>
>>>
>>>
>>>
>>>> On Jan 21, 2019, at 5:21 AM, Mikael Pesonen 
>>>> <mi...@lingsoft.fi> wrote:
>>>>
>>>>
>>>> Hi,
>>>>
>>>>
>>>> On 18/01/2019 18:13, Chris Tomlinson wrote:
>>>>> Hi,
>>>>>
>>>>> 1) If you’re using a default config, it does not have a working 
>>>>> jena-text configuration. The config will need to include 
>>>>> skos:prefLabel in the entity map.
>>>>>
>>>>> 2) when you change the jena-text in significant ways, such as 
>>>>> changing what analyzer is used for a given property and so on, 
>>>>> then you’ll need to rebuild the Lucene index via reloading the 
>>>>> dataset or using the textIndexer 
>>>>> <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. 
>>>>> I don’t recall this being mentioned as part of your testing
>>>>>
>>>>> 3) Please indicate exactly which item you’re using 
>>>>> jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and 
>>>>> the config file itself. The error you’ve mentioned previously:
>>>> We are running Fuseki as service
>>>>
>>>> -----
>>>> [Unit]
>>>> Description=Apache Jena Fuseki
>>>>
>>>> [Service]
>>>> Type=simple
>>>> User=fuseki
>>>> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
>>>> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
>>>> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
>>>> ExecStart=/usr/bin/java 
>>>> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
>>>> -Xmx5600M -jar 
>>>> /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar 
>>>> --update --port 3030  --loc=/home/text/tools/jena_data_test/ /ds
>>>>
>>>> [Install]
>>>> WantedBy=multi-user.target
>>>> -----
>>>>
>>>> All settings are default otherwise, we haven't changed any config 
>>>> file.
>>>>
>>>> Are there some minimal settings to this example config so that I 
>>>> could get skos:prefLabel working?
>>>>
>>>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>>>>
>>>>
>>>> So when we have a working configuration/assembler file, all is 
>>>> needed is to build the index
>>>>
>>>> java  -cp  $FUSEKI_HOME/fuseki-server.jar  jena.textindexer 
>>>> --desc=assembler_file ?
>>>>
>>>>
>>>> Thank everyone for the help
>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] 
>>>>>> Config     INFO  Load configuration: 
>>>>>> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl 
>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl> 
>>>>>>
>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] 
>>>>>> WebAppContext WARN  Failed startup of context 
>>>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
>>>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE 
>>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>} 
>>>>>>
>>>>>> Jan 17 17:00:28 semantic-dev java[16800]:         at 
>>>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>>>>> suggests to me that something in the config file is confusing the 
>>>>> readAssemblerFile. It doesn’t look like it’s failing in the 
>>>>> reading the jena-text portion of the config.
>>>>>
>>>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl 
>>>>> <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, 
>>>>> then can you cut it down to just a small test case with some 
>>>>> concepts with “medi” and a few without? That along with the other 
>>>>> information should help move this further along..
>>>>>
>>>>> 4) Your query:
>>>>>
>>>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core# 
>>>>>> <http://www.w3.org/2004/02/skos/core#>>
>>>>>> PREFIX text: <http://jena.apache.org/text# 
>>>>>> <http://jena.apache.org/text#>>
>>>>>> SELECT *
>>>>>> WHERE
>>>>>> {
>>>>>>    GRAPH <http://www.yso.fi/onto/mesh/ 
>>>>>> <http://www.yso.fi/onto/mesh/>>
>>>>>>    {
>>>>>>      ?concept text:query (skos:prefLabel "medi") .
>>>>>>      ?concept skos:prefLabel ?prefLabel .
>>>>>>
>>>>>>      # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>>>>    }
>>>>>> }
>>>>>> limit 10
>>>>> might effectively just be executing:
>>>>>
>>>>>> ?concept skos:prefLabel ?prefLabel .
>>>>> if there is actually no jena-text config - I haven’t checked what 
>>>>> happens when there is no TextIndex configured and the text:query 
>>>>> is invoked, but may be a noop
>>>>>
>>>>> Thanks,
>>>>> Chris
>>>>>
>>>>>
>>>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen 
>>>>>> <mi...@lingsoft.fi> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>>> 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
>>>>>>
>>>> -- 
>>>> 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: mikael.pesonen@lingsoft.fi
>>>> 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
>>>>
>>>
>>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by vincent ventresque <vi...@ens-lyon.fr>.
Hello

If the configuration folder is empty, the run/config.ttl (default file) 
should be the one that Fuseki uses : you should try to replace the 
content of run/config.ttl with the one Chris has sent in previous msg

Le 22/01/2019 à 14:58, Mikael Pesonen a écrit :
>
> Hi,
>
> we haven't made any configuration files, so configuration folder is 
> empty. Everything is working fine except text search so are there some 
> advances for doing custom config? I understand now that for text 
> search we need the config and about that I asked for help.
>
> On 21/01/2019 19:24, Chris Tomlinson wrote:
>> Hi,
>>
>> You’ve presented your system service configuration. We need to see 
>> the configuration file 
>> <http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html> 
>> in:
>>
>>      $FUSEKI_BASE/configuration/text_svc.ttl
>>
>> It is a ttl file that is interpreted by the assembler system to build 
>> the endpoints and dataset components. This is where the jena-text 
>> configuration info will go. Here is a sample configuration based on 
>> info in your service defn:
>>
>>> # Fuseki configuration for BDRC, configures two endpoints:
>>> #   - /bdrc is read-only
>>> #   - /bdrcrw is read-write
>>> #
>>> # This was painful to come up with but the web interface basically 
>>> allows no option
>>> # and there is no subclass inference by default so such a 
>>> configuration file is necessary.
>>> #
>>> # The main doc sources are:
>>> #  - 
>>> https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html
>>> #  - 
>>> https://jena.apache.org/documentation/assembler/assembler-howto.html
>>> #  - https://jena.apache.org/documentation/assembler/assembler.ttl
>>> #
>>> # See 
>>> https://jena.apache.org/documentation/fuseki2/fuseki-layout.html for 
>>> the destination of this file.
>>>
>>> @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#> .
>>> @prefix :        <http://base/#> .
>>>
>>> [] rdf:type fuseki:Server ;
>>>     fuseki:services (
>>>       :text_svc
>>>     ) .
>>>
>>> :text_svc rdf:type fuseki:Service ;
>>>      fuseki:name                       "text_svc" ;     # name of 
>>> the dataset in the url
>>>      fuseki:serviceQuery               "query" ;    # SPARQL query 
>>> service
>>>      fuseki:serviceUpdate              "update" ;   # SPARQL update 
>>> service
>>>      fuseki:serviceUpload              "upload" ;   # Non-SPARQL 
>>> upload service
>>>      fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph 
>>> store protocol (read and write)
>>>      fuseki:dataset                    :text_dataset ;
>>>      .
>>>
>>> :text_dataset rdf:type     text:TextDataset ;
>>>      text:dataset   :tdb_dataset ;
>>>      text:index     :lucene_index ;
>>>      .
>>>
>>> # using TDB
>>> :tdb_dataset rdf:type tdb:DatasetTDB ;
>>>       tdb:location 
>>> "/home/text/tools/apache-jena-fuseki-3.9.0/run/tdb_dataset" ;
>>>       tdb:unionDefaultGraph true ;
>>>       .
>>>
>>> # Text index description
>>> :lucene_index a text:TextIndexLucene ;
>>>      text:directory 
>>> <file:/home/text/tools/apache-jena-fuseki-3.9.0/run/lucene_index> ;
>>>      text:storeValues true ;
>>>      text:entityMap :entitymap ;
>>>      .
>>>
>>> # Index mappings
>>> :entitymap a text:EntityMap ;
>>>      text:entityField      "uri" ;
>>>      text:uidField         "uid" ;
>>>      text:defaultField     "label" ;
>>>      text:langField        "lang" ;
>>>      text:graphField       "graph" ; ## enable graph-specific indexing
>>>      text:map (
>>>           [ text:field "label" ;
>>>             text:predicate skos:prefLabel ]
>>>           ) ;
>>>      .
>> hth,
>> Chris
>>
>>
>>
>>
>>> On Jan 21, 2019, at 5:21 AM, Mikael Pesonen 
>>> <mi...@lingsoft.fi> wrote:
>>>
>>>
>>> Hi,
>>>
>>>
>>> On 18/01/2019 18:13, Chris Tomlinson wrote:
>>>> Hi,
>>>>
>>>> 1) If you’re using a default config, it does not have a working 
>>>> jena-text configuration. The config will need to include 
>>>> skos:prefLabel in the entity map.
>>>>
>>>> 2) when you change the jena-text in significant ways, such as 
>>>> changing what analyzer is used for a given property and so on, then 
>>>> you’ll need to rebuild the Lucene index via reloading the dataset 
>>>> or using the textIndexer 
>>>> <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. 
>>>> I don’t recall this being mentioned as part of your testing
>>>>
>>>> 3) Please indicate exactly which item you’re using 
>>>> jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and 
>>>> the config file itself. The error you’ve mentioned previously:
>>> We are running Fuseki as service
>>>
>>> -----
>>> [Unit]
>>> Description=Apache Jena Fuseki
>>>
>>> [Service]
>>> Type=simple
>>> User=fuseki
>>> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
>>> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
>>> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
>>> ExecStart=/usr/bin/java 
>>> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
>>> -Xmx5600M -jar 
>>> /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar --update 
>>> --port 3030  --loc=/home/text/tools/jena_data_test/ /ds
>>>
>>> [Install]
>>> WantedBy=multi-user.target
>>> -----
>>>
>>> All settings are default otherwise, we haven't changed any config file.
>>>
>>> Are there some minimal settings to this example config so that I 
>>> could get skos:prefLabel working?
>>>
>>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>>>
>>>
>>> So when we have a working configuration/assembler file, all is 
>>> needed is to build the index
>>>
>>> java  -cp  $FUSEKI_HOME/fuseki-server.jar  jena.textindexer 
>>> --desc=assembler_file ?
>>>
>>>
>>> Thank everyone for the help
>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] 
>>>>> Config     INFO  Load configuration: 
>>>>> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl 
>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl> 
>>>>>
>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] 
>>>>> WebAppContext WARN  Failed startup of context 
>>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
>>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE 
>>>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>} 
>>>>>
>>>>> Jan 17 17:00:28 semantic-dev java[16800]:         at 
>>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>>>> suggests to me that something in the config file is confusing the 
>>>> readAssemblerFile. It doesn’t look like it’s failing in the reading 
>>>> the jena-text portion of the config.
>>>>
>>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl 
>>>> <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then 
>>>> can you cut it down to just a small test case with some concepts 
>>>> with “medi” and a few without? That along with the other 
>>>> information should help move this further along..
>>>>
>>>> 4) Your query:
>>>>
>>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core# 
>>>>> <http://www.w3.org/2004/02/skos/core#>>
>>>>> PREFIX text: <http://jena.apache.org/text# 
>>>>> <http://jena.apache.org/text#>>
>>>>> SELECT *
>>>>> WHERE
>>>>> {
>>>>>    GRAPH <http://www.yso.fi/onto/mesh/ 
>>>>> <http://www.yso.fi/onto/mesh/>>
>>>>>    {
>>>>>      ?concept text:query (skos:prefLabel "medi") .
>>>>>      ?concept skos:prefLabel ?prefLabel .
>>>>>
>>>>>      # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>>>    }
>>>>> }
>>>>> limit 10
>>>> might effectively just be executing:
>>>>
>>>>> ?concept skos:prefLabel ?prefLabel .
>>>> if there is actually no jena-text config - I haven’t checked what 
>>>> happens when there is no TextIndex configured and the text:query is 
>>>> invoked, but may be a noop
>>>>
>>>> Thanks,
>>>> Chris
>>>>
>>>>
>>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen 
>>>>> <mi...@lingsoft.fi> wrote:
>>>>>
>>>>>
>>>>>
>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>> 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
>>>>>
>>> -- 
>>> 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: mikael.pesonen@lingsoft.fi
>>> 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
>>>
>>
>

Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
Hi,

we haven't made any configuration files, so configuration folder is 
empty. Everything is working fine except text search so are there some 
advances for doing custom config? I understand now that for text search 
we need the config and about that I asked for help.

On 21/01/2019 19:24, Chris Tomlinson wrote:
> Hi,
>
> You’ve presented your system service configuration. We need to see the configuration file <http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html> in:
>
>      $FUSEKI_BASE/configuration/text_svc.ttl
>
> It is a ttl file that is interpreted by the assembler system to build the endpoints and dataset components. This is where the jena-text configuration info will go. Here is a sample configuration based on info in your service defn:
>
>> # Fuseki configuration for BDRC, configures two endpoints:
>> #   - /bdrc is read-only
>> #   - /bdrcrw is read-write
>> #
>> # This was painful to come up with but the web interface basically allows no option
>> # and there is no subclass inference by default so such a configuration file is necessary.
>> #
>> # The main doc sources are:
>> #  - https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html
>> #  - https://jena.apache.org/documentation/assembler/assembler-howto.html
>> #  - https://jena.apache.org/documentation/assembler/assembler.ttl
>> #
>> # See https://jena.apache.org/documentation/fuseki2/fuseki-layout.html for the destination of this file.
>>
>> @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#> .
>> @prefix :        <http://base/#> .
>>
>> [] rdf:type fuseki:Server ;
>>     fuseki:services (
>>       :text_svc
>>     ) .
>>
>> :text_svc rdf:type fuseki:Service ;
>>      fuseki:name                       "text_svc" ;     # name of the dataset in the url
>>      fuseki:serviceQuery               "query" ;    # SPARQL query service
>>      fuseki:serviceUpdate              "update" ;   # SPARQL update service
>>      fuseki:serviceUpload              "upload" ;   # Non-SPARQL upload service
>>      fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph store protocol (read and write)
>>      fuseki:dataset                    :text_dataset ;
>>      .
>>
>> :text_dataset rdf:type     text:TextDataset ;
>>      text:dataset   :tdb_dataset ;
>>      text:index     :lucene_index ;
>>      .
>>
>> # using TDB
>> :tdb_dataset rdf:type tdb:DatasetTDB ;
>>       tdb:location "/home/text/tools/apache-jena-fuseki-3.9.0/run/tdb_dataset" ;
>>       tdb:unionDefaultGraph true ;
>>       .
>>
>> # Text index description
>> :lucene_index a text:TextIndexLucene ;
>>      text:directory <file:/home/text/tools/apache-jena-fuseki-3.9.0/run/lucene_index> ;
>>      text:storeValues true ;
>>      text:entityMap :entitymap ;
>>      .
>>
>> # Index mappings
>> :entitymap a text:EntityMap ;
>>      text:entityField      "uri" ;
>>      text:uidField         "uid" ;
>>      text:defaultField     "label" ;
>>      text:langField        "lang" ;
>>      text:graphField       "graph" ; ## enable graph-specific indexing
>>      text:map (
>>           [ text:field "label" ;
>>             text:predicate skos:prefLabel ]
>>           ) ;
>>      .
> hth,
> Chris
>
>
>
>
>> On Jan 21, 2019, at 5:21 AM, Mikael Pesonen <mi...@lingsoft.fi> wrote:
>>
>>
>> Hi,
>>
>>
>> On 18/01/2019 18:13, Chris Tomlinson wrote:
>>> Hi,
>>>
>>> 1) If you’re using a default config, it does not have a working jena-text configuration. The config will need to  include skos:prefLabel in the entity map.
>>>
>>> 2) when you change the jena-text in significant ways, such as changing what analyzer is used for a given property and so on, then you’ll need to rebuild the Lucene index via reloading the dataset or using the textIndexer <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. I don’t recall this being mentioned as part of your testing
>>>
>>> 3) Please indicate exactly which item you’re using jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and the config file itself. The error you’ve mentioned previously:
>> We are running Fuseki as service
>>
>> -----
>> [Unit]
>> Description=Apache Jena Fuseki
>>
>> [Service]
>> Type=simple
>> User=fuseki
>> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
>> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
>> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
>> ExecStart=/usr/bin/java -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties -Xmx5600M -jar /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar --update --port 3030  --loc=/home/text/tools/jena_data_test/ /ds
>>
>> [Install]
>> WantedBy=multi-user.target
>> -----
>>
>> All settings are default otherwise, we haven't changed any config file.
>>
>> Are there some minimal settings to this example config so that I could get skos:prefLabel working?
>>
>> https://jena.apache.org/documentation/query/text-query.html#configuration
>>
>> So when we have a working configuration/assembler file, all is needed is to build the index
>>
>> java  -cp  $FUSEKI_HOME/fuseki-server.jar  jena.textindexer  --desc=assembler_file ?
>>
>>
>> Thank everyone for the help
>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] Config     INFO  Load configuration: file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>>>> Jan 17 17:00:28 semantic-dev java[16800]:         at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>>> suggests to me that something in the config file is confusing the readAssemblerFile. It doesn’t look like it’s failing in the reading the jena-text portion of the config.
>>>
>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then can you cut it down to just a small test case with some concepts with “medi” and a few without? That along with the other information should help move this further along..
>>>
>>> 4) Your query:
>>>
>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core# <http://www.w3.org/2004/02/skos/core#>>
>>>> PREFIX text: <http://jena.apache.org/text# <http://jena.apache.org/text#>>
>>>> SELECT *
>>>> WHERE
>>>> {
>>>>    GRAPH <http://www.yso.fi/onto/mesh/ <http://www.yso.fi/onto/mesh/>>
>>>>    {
>>>>      ?concept text:query (skos:prefLabel "medi") .
>>>>      ?concept skos:prefLabel ?prefLabel .
>>>>
>>>>      # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>>    }
>>>> }
>>>> limit 10
>>> might effectively just be executing:
>>>
>>>> ?concept skos:prefLabel ?prefLabel .
>>> if there is actually no jena-text config - I haven’t checked what happens when there is no TextIndex configured and the text:query is invoked, but may be a noop
>>>
>>> Thanks,
>>> Chris
>>>
>>>
>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen <mi...@lingsoft.fi> wrote:
>>>>
>>>>
>>>>
>>>> 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: mikael.pesonen@lingsoft.fi
>>>> 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
>>>>
>> -- 
>> 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: mikael.pesonen@lingsoft.fi
>> 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
>>
>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by Chris Tomlinson <ch...@gmail.com>.
Hi,

You’ve presented your system service configuration. We need to see the configuration file <http://jena.apache.org/documentation/fuseki2/fuseki-configuration.html> in:

    $FUSEKI_BASE/configuration/text_svc.ttl

It is a ttl file that is interpreted by the assembler system to build the endpoints and dataset components. This is where the jena-text configuration info will go. Here is a sample configuration based on info in your service defn:

> # Fuseki configuration for BDRC, configures two endpoints:
> #   - /bdrc is read-only
> #   - /bdrcrw is read-write
> #
> # This was painful to come up with but the web interface basically allows no option
> # and there is no subclass inference by default so such a configuration file is necessary.
> #
> # The main doc sources are:
> #  - https://jena.apache.org/documentation/fuseki2/fuseki-configuration.html
> #  - https://jena.apache.org/documentation/assembler/assembler-howto.html
> #  - https://jena.apache.org/documentation/assembler/assembler.ttl
> #
> # See https://jena.apache.org/documentation/fuseki2/fuseki-layout.html for the destination of this file.
> 
> @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#> .
> @prefix :        <http://base/#> .
> 
> [] rdf:type fuseki:Server ;
>    fuseki:services (
>      :text_svc
>    ) .
> 
> :text_svc rdf:type fuseki:Service ;
>     fuseki:name                       "text_svc" ;     # name of the dataset in the url
>     fuseki:serviceQuery               "query" ;    # SPARQL query service
>     fuseki:serviceUpdate              "update" ;   # SPARQL update service
>     fuseki:serviceUpload              "upload" ;   # Non-SPARQL upload service
>     fuseki:serviceReadWriteGraphStore "data" ;     # SPARQL Graph store protocol (read and write)
>     fuseki:dataset                    :text_dataset ;
>     .
> 
> :text_dataset rdf:type     text:TextDataset ;
>     text:dataset   :tdb_dataset ;
>     text:index     :lucene_index ;
>     .
> 
> # using TDB
> :tdb_dataset rdf:type tdb:DatasetTDB ;
>      tdb:location "/home/text/tools/apache-jena-fuseki-3.9.0/run/tdb_dataset" ;
>      tdb:unionDefaultGraph true ;
>      .
> 
> # Text index description
> :lucene_index a text:TextIndexLucene ;
>     text:directory <file:/home/text/tools/apache-jena-fuseki-3.9.0/run/lucene_index> ;
>     text:storeValues true ;
>     text:entityMap :entitymap ;
>     .
> 
> # Index mappings
> :entitymap a text:EntityMap ;
>     text:entityField      "uri" ;
>     text:uidField         "uid" ;
>     text:defaultField     "label" ;
>     text:langField        "lang" ;
>     text:graphField       "graph" ; ## enable graph-specific indexing
>     text:map (
>          [ text:field "label" ; 
>            text:predicate skos:prefLabel ]
>          ) ;
>     .

hth,
Chris




> On Jan 21, 2019, at 5:21 AM, Mikael Pesonen <mi...@lingsoft.fi> wrote:
> 
> 
> Hi,
> 
> 
> On 18/01/2019 18:13, Chris Tomlinson wrote:
>> Hi,
>> 
>> 1) If you’re using a default config, it does not have a working jena-text configuration. The config will need to  include skos:prefLabel in the entity map.
>> 
>> 2) when you change the jena-text in significant ways, such as changing what analyzer is used for a given property and so on, then you’ll need to rebuild the Lucene index via reloading the dataset or using the textIndexer <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. I don’t recall this being mentioned as part of your testing
>> 
>> 3) Please indicate exactly which item you’re using jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and the config file itself. The error you’ve mentioned previously:
> We are running Fuseki as service
> 
> -----
> [Unit]
> Description=Apache Jena Fuseki
> 
> [Service]
> Type=simple
> User=fuseki
> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
> ExecStart=/usr/bin/java -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties -Xmx5600M -jar /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar --update --port 3030  --loc=/home/text/tools/jena_data_test/ /ds
> 
> [Install]
> WantedBy=multi-user.target
> -----
> 
> All settings are default otherwise, we haven't changed any config file.
> 
> Are there some minimal settings to this example config so that I could get skos:prefLabel working?
> 
> https://jena.apache.org/documentation/query/text-query.html#configuration
> 
> So when we have a working configuration/assembler file, all is needed is to build the index
> 
> java  -cp  $FUSEKI_HOME/fuseki-server.jar  jena.textindexer  --desc=assembler_file ?
> 
> 
> Thank everyone for the help
>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] Config     INFO  Load configuration: file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>>> Jan 17 17:00:28 semantic-dev java[16800]:         at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>> suggests to me that something in the config file is confusing the readAssemblerFile. It doesn’t look like it’s failing in the reading the jena-text portion of the config.
>> 
>> If http://api.finto.fi/download/mesh/mesh-skos.ttl <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then can you cut it down to just a small test case with some concepts with “medi” and a few without? That along with the other information should help move this further along..
>> 
>> 4) Your query:
>> 
>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core# <http://www.w3.org/2004/02/skos/core#>>
>>> PREFIX text: <http://jena.apache.org/text# <http://jena.apache.org/text#>>
>>> SELECT *
>>> WHERE
>>> {
>>>   GRAPH <http://www.yso.fi/onto/mesh/ <http://www.yso.fi/onto/mesh/>>
>>>   {
>>>     ?concept text:query (skos:prefLabel "medi") .
>>>     ?concept skos:prefLabel ?prefLabel .
>>> 
>>>     # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>   }
>>> }
>>> limit 10
>> might effectively just be executing:
>> 
>>> ?concept skos:prefLabel ?prefLabel .
>> if there is actually no jena-text config - I haven’t checked what happens when there is no TextIndex configured and the text:query is invoked, but may be a noop
>> 
>> Thanks,
>> Chris
>> 
>> 
>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen <mi...@lingsoft.fi> wrote:
>>> 
>>> 
>>> 
>>> 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: mikael.pesonen@lingsoft.fi
>>> 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
>>> 
>> 
> 
> -- 
> 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: mikael.pesonen@lingsoft.fi
> 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
> 


Re: Text search from sparql

Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
Well I started Fuseki with the path of the config file, i.e.

./fuseki-server --config=/PATH/TO/CONFIG/FILE


Does this not work for you? For me it does using Fuseki 3.10.0

>
> Hi,
>
> there is still this error and it comes only when ANYTHING is placed on
> configuration folder:
>
> WebAppContext WARN  Failed startup of context
> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki
> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
>
> That folder is as in default install package, but maybe some setting
> is missing, referring to UNAVAILABLE?
> Entire log:
>
> Jan 22 16:01:21 semantic-dev systemd[1]: Started Apache Jena Fuseki.
> Jan 22 16:01:22 semantic-dev java[26606]: [2019-01-22 16:01:22]
> Server     INFO  Apache Jena Fuseki 3.9.0
> Jan 22 16:01:22 semantic-dev java[26606]: [2019-01-22 16:01:22]
> Config     INFO FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
> Jan 22 16:01:22 semantic-dev java[26606]: [2019-01-22 16:01:22]
> Config     INFO FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
> Jan 22 16:01:22 semantic-dev java[26606]: [2019-01-22 16:01:22]
> Config     INFO  Shiro file:
> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/shiro.ini
> Jan 22 16:01:23 semantic-dev java[26606]: [2019-01-22 16:01:23]
> Config     INFO  Load configuration:
> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl
> Jan 22 16:01:23 semantic-dev java[26606]: [2019-01-22 16:01:23]
> WebAppContext WARN  Failed startup of context
> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki
> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
> Jan 22 16:01:23 semantic-dev java[26606]:         at
> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
> Jan 22 16:01:23 semantic-dev java[26606]:         at
> org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178)
> Jan 22 16:01:23 semantic-dev java[26606]:         at
> org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226)
> Jan 22 16:01:23 semantic-dev java[26606]:         at
> org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98)
> Jan 22 16:01:23 semantic-dev java[26606]:         at
> org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
> Jan 22 16:01:23 semantic-dev java[26606]:         at
> org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
> Jan 22 16:01:23 semantic-dev java[26606]:         at
> org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
> Jan 22 16:01:23 semantic-dev java[26606]:         at
> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
> Jan 22 16:01:23 semantic-dev java[26606]:         at
> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
> Jan 22 16:01:23 semantic-dev java[26606]:         at
> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
> Jan 22 16:01:48 semantic-dev sudo[26629]:   mikael : TTY=pts/0 ;
> PWD=/home/text/tools/apache-jena-fuseki-3.9.0 ; USER=root ;
> COMMAND=/bin/journalctl
>
> On 21/01/2019 19:17, Lorenz B. wrote:
>> @prefix :<http://localhost/jena_example/#>  .
>> @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#>
>> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>>
>> ## Example of a TDB dataset and text index
>> ## Initialize TDB
>> [] ja:loadClass "org.apache.jena.tdb.TDB" .
>> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
>> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>>
>> ## Initialize text query
>> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
>> # A TextDataset is a regular dataset with a text index.
>> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
>> # Lucene index
>> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>>
>>
>> ## ---------------------------------------------------------------
>>
>>
>> :text_dataset rdf:type     text:TextDataset ;
>>      text:dataset   :my_dataset ;
>>      text:index     <#indexLucene> ;
>>      .
>>
>> # A TDB dataset used for RDF storage
>> :my_dataset rdf:type      tdb:DatasetTDB ;
>>      tdb:location "/tmp/tdb-dataset/" ;
>> #    tdb:unionDefaultGraph true ; # Optional
>>      .
>>
>> # Text index description
>> <#indexLucene> a text:TextIndexLucene ;
>>      text:directory<file:/tmp/tdb-lucene-index>  ;
>>      text:entityMap <#entMap> ;
>>      text:storeValues true ;
>>      text:analyzer [ a text:StandardAnalyzer ] ;
>>      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>>      text:queryParser text:AnalyzingQueryParser ;
>>      text:multilingualSupport true ;
>>   .
>>
>> <#entMap> a text:EntityMap ;
>>      text:defaultField     "label" ;
>>      text:entityField      "uri" ;
>>      text:uidField         "uid" ;
>>      text:langField        "lang" ;
>>      text:graphField       "graph" ;
>>      text:map (
>>           [ text:field "label" ;
>>             text:predicate skos:prefLabel ]
>>           ) .
>>
>> <#service> rdf:type fuseki:Service ;
>>      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
>>      fuseki:serviceQuery             "query" ;    # SPARQL query service
>>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
>> protocol (read only)
>>      fuseki:dataset           :text_dataset ;
>>      .
>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center


Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
Hi,

there is still this error and it comes only when ANYTHING is placed on 
configuration folder:

WebAppContext WARN  Failed startup of context 
o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}

That folder is as in default install package, but maybe some setting is 
missing, referring to UNAVAILABLE?
Entire log:

Jan 22 16:01:21 semantic-dev systemd[1]: Started Apache Jena Fuseki.
Jan 22 16:01:22 semantic-dev java[26606]: [2019-01-22 16:01:22] 
Server     INFO  Apache Jena Fuseki 3.9.0
Jan 22 16:01:22 semantic-dev java[26606]: [2019-01-22 16:01:22] 
Config     INFO FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
Jan 22 16:01:22 semantic-dev java[26606]: [2019-01-22 16:01:22] 
Config     INFO FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
Jan 22 16:01:22 semantic-dev java[26606]: [2019-01-22 16:01:22] 
Config     INFO  Shiro file: 
file:///home/text/tools/apache-jena-fuseki-3.9.0/run/shiro.ini
Jan 22 16:01:23 semantic-dev java[26606]: [2019-01-22 16:01:23] 
Config     INFO  Load configuration: 
file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl
Jan 22 16:01:23 semantic-dev java[26606]: [2019-01-22 16:01:23] 
WebAppContext WARN  Failed startup of context 
o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
Jan 22 16:01:23 semantic-dev java[26606]:         at 
org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
Jan 22 16:01:23 semantic-dev java[26606]:         at 
org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178)
Jan 22 16:01:23 semantic-dev java[26606]:         at 
org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226)
Jan 22 16:01:23 semantic-dev java[26606]:         at 
org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98)
Jan 22 16:01:23 semantic-dev java[26606]:         at 
org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
Jan 22 16:01:23 semantic-dev java[26606]:         at 
org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
Jan 22 16:01:23 semantic-dev java[26606]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
Jan 22 16:01:23 semantic-dev java[26606]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
Jan 22 16:01:23 semantic-dev java[26606]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
Jan 22 16:01:23 semantic-dev java[26606]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
Jan 22 16:01:48 semantic-dev sudo[26629]:   mikael : TTY=pts/0 ; 
PWD=/home/text/tools/apache-jena-fuseki-3.9.0 ; USER=root ; 
COMMAND=/bin/journalctl

On 21/01/2019 19:17, Lorenz B. wrote:
> @prefix :<http://localhost/jena_example/#>  .
> @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#>
> @prefix fuseki:<http://jena.apache.org/fuseki#>  .
>
> ## Example of a TDB dataset and text index
> ## Initialize TDB
> [] ja:loadClass "org.apache.jena.tdb.TDB" .
> tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
> tdb:GraphTDB    rdfs:subClassOf  ja:Model .
>
> ## Initialize text query
> [] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
> # A TextDataset is a regular dataset with a text index.
> text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
> # Lucene index
> text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .
>
>
> ## ---------------------------------------------------------------
>
>
> :text_dataset rdf:type     text:TextDataset ;
>      text:dataset   :my_dataset ;
>      text:index     <#indexLucene> ;
>      .
>
> # A TDB dataset used for RDF storage
> :my_dataset rdf:type      tdb:DatasetTDB ;
>      tdb:location "/tmp/tdb-dataset/" ;
> #    tdb:unionDefaultGraph true ; # Optional
>      .
>
> # Text index description
> <#indexLucene> a text:TextIndexLucene ;
>      text:directory<file:/tmp/tdb-lucene-index>  ;
>      text:entityMap <#entMap> ;
>      text:storeValues true ;
>      text:analyzer [ a text:StandardAnalyzer ] ;
>      text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
>      text:queryParser text:AnalyzingQueryParser ;
>      text:multilingualSupport true ;
>   .
>
> <#entMap> a text:EntityMap ;
>      text:defaultField     "label" ;
>      text:entityField      "uri" ;
>      text:uidField         "uid" ;
>      text:langField        "lang" ;
>      text:graphField       "graph" ;
>      text:map (
>           [ text:field "label" ;
>             text:predicate skos:prefLabel ]
>           ) .
>
> <#service> rdf:type fuseki:Service ;
>      fuseki:name                     "/ds" ;   # http://host:port/ds-ro
>      fuseki:serviceQuery             "query" ;    # SPARQL query service
>      fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
> protocol (read only)
>      fuseki:dataset           :text_dataset ;
>      .

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by "Lorenz B." <bu...@informatik.uni-leipzig.de>.
Hello Mikael,

attachments to not work so I'll post a config that works for me at the
end of the message. You have to adopt the path for

tdb:location

and

text:directory

And as said before, you have to create the text index once.

Note, as I also said in my previous response, your query will work only
for labels that contain the whole word (modulo what the Lucene analyzer
will do during indexing and query parsing). Substring search needs
things like "*" e.g. "Lei*" should also return labels like "Leipzig" and
"Leibnitz"



@prefix :        <http://localhost/jena_example/#> .
@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#>
@prefix fuseki:  <http://jena.apache.org/fuseki#> .

## Example of a TDB dataset and text index
## Initialize TDB
[] ja:loadClass "org.apache.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .

## Initialize text query
[] ja:loadClass       "org.apache.jena.query.text.TextQuery" .
# A TextDataset is a regular dataset with a text index.
text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
# Lucene index
text:TextIndexLucene  rdfs:subClassOf   text:TextIndex .


## ---------------------------------------------------------------


:text_dataset rdf:type     text:TextDataset ;
    text:dataset   :my_dataset ;
    text:index     <#indexLucene> ;
    .

# A TDB dataset used for RDF storage
:my_dataset rdf:type      tdb:DatasetTDB ;
    tdb:location "/tmp/tdb-dataset/" ;
#    tdb:unionDefaultGraph true ; # Optional
    .

# Text index description
<#indexLucene> a text:TextIndexLucene ;
    text:directory <file:/tmp/tdb-lucene-index> ;
    text:entityMap <#entMap> ;
    text:storeValues true ;
    text:analyzer [ a text:StandardAnalyzer ] ;
    text:queryAnalyzer [ a text:KeywordAnalyzer ] ;
    text:queryParser text:AnalyzingQueryParser ;
    text:multilingualSupport true ;
 .

<#entMap> a text:EntityMap ;
    text:defaultField     "label" ;
    text:entityField      "uri" ;
    text:uidField         "uid" ;
    text:langField        "lang" ;
    text:graphField       "graph" ;
    text:map (
         [ text:field "label" ;
           text:predicate skos:prefLabel ]
         ) .

<#service> rdf:type fuseki:Service ;
    fuseki:name                     "/ds" ;   # http://host:port/ds-ro
    fuseki:serviceQuery             "query" ;    # SPARQL query service
    fuseki:serviceReadGraphStore    "data" ;     # SPARQL Graph store
protocol (read only)
    fuseki:dataset           :text_dataset ;
    .

 





>
> Hi,
>
>
> On 18/01/2019 18:13, Chris Tomlinson wrote:
>> Hi,
>>
>> 1) If you’re using a default config, it does not have a working
>> jena-text configuration. The config will need to  include
>> skos:prefLabel in the entity map.
>>
>> 2) when you change the jena-text in significant ways, such as
>> changing what analyzer is used for a given property and so on, then
>> you’ll need to rebuild the Lucene index via reloading the dataset or
>> using the textIndexer
>> <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>.
>> I don’t recall this being mentioned as part of your testing
>>
>> 3) Please indicate exactly which item you’re using
>> jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and
>> the config file itself. The error you’ve mentioned previously:
> We are running Fuseki as service
>
> -----
> [Unit]
> Description=Apache Jena Fuseki
>
> [Service]
> Type=simple
> User=fuseki
> #Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
> Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
> Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
> ExecStart=/usr/bin/java
> -Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties
> -Xmx5600M -jar
> /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar --update
> --port 3030  --loc=/home/text/tools/jena_data_test/ /ds
>
> [Install]
> WantedBy=multi-user.target
> -----
>
> All settings are default otherwise, we haven't changed any config file.
>
> Are there some minimal settings to this example config so that I could
> get skos:prefLabel working?
>
> https://jena.apache.org/documentation/query/text-query.html#configuration
>
> So when we have a working configuration/assembler file, all is needed
> is to build the index
>
> java  -cp  $FUSEKI_HOME/fuseki-server.jar  jena.textindexer 
> --desc=assembler_file ?
>
>
> Thank everyone for the help
>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>> Config     INFO  Load configuration:
>>> file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl
>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>>>
>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28]
>>> WebAppContext WARN  Failed startup of context
>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki
>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE
>>> <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>>> Jan 17 17:00:28 semantic-dev java[16800]:         at
>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>> suggests to me that something in the config file is confusing the
>> readAssemblerFile. It doesn’t look like it’s failing in the reading
>> the jena-text portion of the config.
>>
>> If http://api.finto.fi/download/mesh/mesh-skos.ttl
>> <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then
>> can you cut it down to just a small test case with some concepts with
>> “medi” and a few without? That along with the other information
>> should help move this further along..
>>
>> 4) Your query:
>>
>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core#
>>> <http://www.w3.org/2004/02/skos/core#>>
>>> PREFIX text: <http://jena.apache.org/text#
>>> <http://jena.apache.org/text#>>
>>> SELECT *
>>> WHERE
>>> {
>>>    GRAPH <http://www.yso.fi/onto/mesh/ <http://www.yso.fi/onto/mesh/>>
>>>    {
>>>      ?concept text:query (skos:prefLabel "medi") .
>>>      ?concept skos:prefLabel ?prefLabel .
>>>
>>>      # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>    }
>>> }
>>> limit 10
>> might effectively just be executing:
>>
>>> ?concept skos:prefLabel ?prefLabel .
>> if there is actually no jena-text config - I haven’t checked what
>> happens when there is no TextIndex configured and the text:query is
>> invoked, but may be a noop
>>
>> Thanks,
>> Chris
>>
>>
>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen
>>> <mi...@lingsoft.fi> wrote:
>>>
>>>
>>>
>>> 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: mikael.pesonen@lingsoft.fi
>>> 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
>>>
>>
>
-- 
Lorenz Bühmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center


Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
Hi,


On 18/01/2019 18:13, Chris Tomlinson wrote:
> Hi,
>
> 1) If you’re using a default config, it does not have a working jena-text configuration. The config will need to  include skos:prefLabel in the entity map.
>
> 2) when you change the jena-text in significant ways, such as changing what analyzer is used for a given property and so on, then you’ll need to rebuild the Lucene index via reloading the dataset or using the textIndexer <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. I don’t recall this being mentioned as part of your testing
>
> 3) Please indicate exactly which item you’re using jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and the config file itself. The error you’ve mentioned previously:
We are running Fuseki as service

-----
[Unit]
Description=Apache Jena Fuseki

[Service]
Type=simple
User=fuseki
#Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
ExecStart=/usr/bin/java 
-Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
-Xmx5600M -jar 
/home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar --update 
--port 3030  --loc=/home/text/tools/jena_data_test/ /ds

[Install]
WantedBy=multi-user.target
-----

All settings are default otherwise, we haven't changed any config file.

Are there some minimal settings to this example config so that I could 
get skos:prefLabel working?

https://jena.apache.org/documentation/query/text-query.html#configuration

So when we have a working configuration/assembler file, all is needed is 
to build the index

java  -cp  $FUSEKI_HOME/fuseki-server.jar  jena.textindexer  --desc=assembler_file ?


Thank everyone for the help
>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] Config     INFO  Load configuration: file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>> Jan 17 17:00:28 semantic-dev java[16800]:         at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
> suggests to me that something in the config file is confusing the readAssemblerFile. It doesn’t look like it’s failing in the reading the jena-text portion of the config.
>
> If http://api.finto.fi/download/mesh/mesh-skos.ttl <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then can you cut it down to just a small test case with some concepts with “medi” and a few without? That along with the other information should help move this further along..
>
> 4) Your query:
>
>> PREFIX skos: <http://www.w3.org/2004/02/skos/core# <http://www.w3.org/2004/02/skos/core#>>
>> PREFIX text: <http://jena.apache.org/text# <http://jena.apache.org/text#>>
>> SELECT *
>> WHERE
>> {
>>    GRAPH <http://www.yso.fi/onto/mesh/ <http://www.yso.fi/onto/mesh/>>
>>    {
>>      ?concept text:query (skos:prefLabel "medi") .
>>      ?concept skos:prefLabel ?prefLabel .
>>
>>      # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>    }
>> }
>> limit 10
> might effectively just be executing:
>
>> ?concept skos:prefLabel ?prefLabel .
> if there is actually no jena-text config - I haven’t checked what happens when there is no TextIndex configured and the text:query is invoked, but may be a noop
>
> Thanks,
> Chris
>
>
>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen <mi...@lingsoft.fi> wrote:
>>
>>
>>
>> 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: mikael.pesonen@lingsoft.fi
>> 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
>>
>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by vincent ventresque <vi...@ens-lyon.fr>.
Hi Tom


 > I’ll be happy to review the changes also.

Thank you!

 > Best to have a user that has recent experience with the deficits in 
the current docs

-- My experience is not that recent : I installed a Lucene index in 2017 
(and haven't tried TDB2 yet, so it's a limited experience!). I 
subscribed to jena-users in 2018 due to difficulties to set the 
tokenizers, filters, analyzers, etc. Maybe this part of documentation 
should also be completed, but I'm not able to do it (thanks to Osma's 
answers I solved my problems, but it's more trial and errors than clear 
understanding!)

-- The deficits are not so important! it was just difficult for me to 
understand the logics of the assembler's triples, and had never used 
this kind of notation : "<#dataset>". So, for beginners like me, it 
should help saving time to give more detail about the values to provide 
(uris & paths).


Le 18/01/2019 à 20:58, Chris Tomlinson a écrit :
> Hi Vincent,
>
> I’ll be happy to review the changes also. Best to have a user that has recent experience with the deficits in the current docs make changes that clarify their issues.
>
> Thanks,
> Chris
>
>
>> On Jan 18, 2019, at 12:09 PM, vincent ventresque <vi...@ens-lyon.fr> wrote:
>>
>> Hi ajs6f
>>
>> Thank you for your proposal, I'd be glad to contribute (as soon as I find a moment, maybe next week).
>>
>> By the way, I wrote a small tutorial (in french) for our project, and some PHP code to use with Fuseki + a sample dataset (data from french national library). I consider translating the tuto into English, because I think Fuseki is great to learn RDF and LOD : do you think s.o could be interested in reviewing the tuto?
>>
>> Vincent
>>
>> Le 18/01/2019 à 18:30, ajs6f a écrit :
>>> Hi, Vincent--
>>>
>>> As mentioned in a recent thread, you needn't be a committer or have any other official role to improve that page. Just use the link in the upper right to submit your suggested changes, and I promise to review/commit them! (Probably with some help from Chris or Osma, who know the text-indexing machinery much much better than do I.)
>>>
>>> ajs6f
>>>
>>>> On Jan 18, 2019, at 11:32 AM, Vincent Ventresque <vi...@ens-lyon.fr> wrote:
>>>>
>>>> Hi Chris,
>>>>
>>>> I'd like to add sthg about the documentation page : it's a bit laconic, and I spent a few hours to understand that values have to be provided in config file for dataset uri.
>>>>
>>>> Furthermore, I had to search on Stackoverflow, and saw other users had the same problem with jena-text config)
>>>>
>>>> Maybe s.o. could add some explanations on this page?
>>>>
>>>> -- give a value for dataset URI (replace <#dataset> with sthg like :my_dataset)
>>>>
>>>> -- give a path for Lucene index files => this will create a directory
>>>>
>>>> -- give a path for TDB (tdb:location "/home/.../fuseki/run/databases/My_dataset")
>>>>
>>>> -- if you don't set environment variables, run fuseki after changing directory ("cd My_Fuseki_install) and give relative paths for command arguments (" --config=run/my_config.ttl ").
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> Le 18/01/2019 à 17:13, Chris Tomlinson a écrit :
>>>>> Hi,
>>>>>
>>>>> 1) If you’re using a default config, it does not have a working jena-text configuration. The config will need to  include skos:prefLabel in the entity map.
>>>>>
>>>>> 2) when you change the jena-text in significant ways, such as changing what analyzer is used for a given property and so on, then you’ll need to rebuild the Lucene index via reloading the dataset or using the textIndexer <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. I don’t recall this being mentioned as part of your testing
>>>>>
>>>>> 3) Please indicate exactly which item you’re using jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and the config file itself. The error you’ve mentioned previously:
>>>>>
>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] Config     INFO  Load configuration: file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>>>>>> Jan 17 17:00:28 semantic-dev java[16800]:         at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>>>>> suggests to me that something in the config file is confusing the readAssemblerFile. It doesn’t look like it’s failing in the reading the jena-text portion of the config.
>>>>>
>>>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then can you cut it down to just a small test case with some concepts with “medi” and a few without? That along with the other information should help move this further along..
>>>>>
>>>>> 4) Your query:
>>>>>
>>>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core# <http://www.w3.org/2004/02/skos/core#>>
>>>>>> PREFIX text: <http://jena.apache.org/text# <http://jena.apache.org/text#>>
>>>>>> SELECT *
>>>>>> WHERE
>>>>>> {
>>>>>>    GRAPH <http://www.yso.fi/onto/mesh/ <http://www.yso.fi/onto/mesh/>>
>>>>>>    {
>>>>>>      ?concept text:query (skos:prefLabel "medi") .
>>>>>>      ?concept skos:prefLabel ?prefLabel .
>>>>>>
>>>>>>      # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>>>>    }
>>>>>> }
>>>>>> limit 10
>>>>> might effectively just be executing:
>>>>>
>>>>>> ?concept skos:prefLabel ?prefLabel .
>>>>> if there is actually no jena-text config - I haven’t checked what happens when there is no TextIndex configured and the text:query is invoked, but may be a noop
>>>>>
>>>>> Thanks,
>>>>> Chris
>>>>>
>>>>>
>>>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen <mi...@lingsoft.fi> wrote:
>>>>>>
>>>>>>
>>>>>>
>>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>>> 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
>>>>>>

Re: Text search from sparql

Posted by Chris Tomlinson <ch...@gmail.com>.
Hi Vincent,

I’ll be happy to review the changes also. Best to have a user that has recent experience with the deficits in the current docs make changes that clarify their issues.

Thanks,
Chris


> On Jan 18, 2019, at 12:09 PM, vincent ventresque <vi...@ens-lyon.fr> wrote:
> 
> Hi ajs6f
> 
> Thank you for your proposal, I'd be glad to contribute (as soon as I find a moment, maybe next week).
> 
> By the way, I wrote a small tutorial (in french) for our project, and some PHP code to use with Fuseki + a sample dataset (data from french national library). I consider translating the tuto into English, because I think Fuseki is great to learn RDF and LOD : do you think s.o could be interested in reviewing the tuto?
> 
> Vincent
> 
> Le 18/01/2019 à 18:30, ajs6f a écrit :
>> Hi, Vincent--
>> 
>> As mentioned in a recent thread, you needn't be a committer or have any other official role to improve that page. Just use the link in the upper right to submit your suggested changes, and I promise to review/commit them! (Probably with some help from Chris or Osma, who know the text-indexing machinery much much better than do I.)
>> 
>> ajs6f
>> 
>>> On Jan 18, 2019, at 11:32 AM, Vincent Ventresque <vi...@ens-lyon.fr> wrote:
>>> 
>>> Hi Chris,
>>> 
>>> I'd like to add sthg about the documentation page : it's a bit laconic, and I spent a few hours to understand that values have to be provided in config file for dataset uri.
>>> 
>>> Furthermore, I had to search on Stackoverflow, and saw other users had the same problem with jena-text config)
>>> 
>>> Maybe s.o. could add some explanations on this page?
>>> 
>>> -- give a value for dataset URI (replace <#dataset> with sthg like :my_dataset)
>>> 
>>> -- give a path for Lucene index files => this will create a directory
>>> 
>>> -- give a path for TDB (tdb:location "/home/.../fuseki/run/databases/My_dataset")
>>> 
>>> -- if you don't set environment variables, run fuseki after changing directory ("cd My_Fuseki_install) and give relative paths for command arguments (" --config=run/my_config.ttl ").
>>> 
>>> 
>>> 
>>> 
>>> 
>>> 
>>> Le 18/01/2019 à 17:13, Chris Tomlinson a écrit :
>>>> Hi,
>>>> 
>>>> 1) If you’re using a default config, it does not have a working jena-text configuration. The config will need to  include skos:prefLabel in the entity map.
>>>> 
>>>> 2) when you change the jena-text in significant ways, such as changing what analyzer is used for a given property and so on, then you’ll need to rebuild the Lucene index via reloading the dataset or using the textIndexer <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. I don’t recall this being mentioned as part of your testing
>>>> 
>>>> 3) Please indicate exactly which item you’re using jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and the config file itself. The error you’ve mentioned previously:
>>>> 
>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] Config     INFO  Load configuration: file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>>>>> Jan 17 17:00:28 semantic-dev java[16800]:         at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>>>> suggests to me that something in the config file is confusing the readAssemblerFile. It doesn’t look like it’s failing in the reading the jena-text portion of the config.
>>>> 
>>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then can you cut it down to just a small test case with some concepts with “medi” and a few without? That along with the other information should help move this further along..
>>>> 
>>>> 4) Your query:
>>>> 
>>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core# <http://www.w3.org/2004/02/skos/core#>>
>>>>> PREFIX text: <http://jena.apache.org/text# <http://jena.apache.org/text#>>
>>>>> SELECT *
>>>>> WHERE
>>>>> {
>>>>>   GRAPH <http://www.yso.fi/onto/mesh/ <http://www.yso.fi/onto/mesh/>>
>>>>>   {
>>>>>     ?concept text:query (skos:prefLabel "medi") .
>>>>>     ?concept skos:prefLabel ?prefLabel .
>>>>> 
>>>>>     # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>>>   }
>>>>> }
>>>>> limit 10
>>>> might effectively just be executing:
>>>> 
>>>>> ?concept skos:prefLabel ?prefLabel .
>>>> if there is actually no jena-text config - I haven’t checked what happens when there is no TextIndex configured and the text:query is invoked, but may be a noop
>>>> 
>>>> Thanks,
>>>> Chris
>>>> 
>>>> 
>>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen <mi...@lingsoft.fi> wrote:
>>>>> 
>>>>> 
>>>>> 
>>>>> 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: mikael.pesonen@lingsoft.fi
>>>>> 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
>>>>> 


Re: Text search from sparql

Posted by vincent ventresque <vi...@ens-lyon.fr>.
Hi ajs6f

Thank you for your proposal, I'd be glad to contribute (as soon as I 
find a moment, maybe next week).

By the way, I wrote a small tutorial (in french) for our project, and 
some PHP code to use with Fuseki + a sample dataset (data from french 
national library). I consider translating the tuto into English, because 
I think Fuseki is great to learn RDF and LOD : do you think s.o could be 
interested in reviewing the tuto?

Vincent

Le 18/01/2019 à 18:30, ajs6f a écrit :
> Hi, Vincent--
>
> As mentioned in a recent thread, you needn't be a committer or have any other official role to improve that page. Just use the link in the upper right to submit your suggested changes, and I promise to review/commit them! (Probably with some help from Chris or Osma, who know the text-indexing machinery much much better than do I.)
>
> ajs6f
>
>> On Jan 18, 2019, at 11:32 AM, Vincent Ventresque <vi...@ens-lyon.fr> wrote:
>>
>> Hi Chris,
>>
>> I'd like to add sthg about the documentation page : it's a bit laconic, and I spent a few hours to understand that values have to be provided in config file for dataset uri.
>>
>> Furthermore, I had to search on Stackoverflow, and saw other users had the same problem with jena-text config)
>>
>> Maybe s.o. could add some explanations on this page?
>>
>> -- give a value for dataset URI (replace <#dataset> with sthg like :my_dataset)
>>
>> -- give a path for Lucene index files => this will create a directory
>>
>> -- give a path for TDB (tdb:location "/home/.../fuseki/run/databases/My_dataset")
>>
>> -- if you don't set environment variables, run fuseki after changing directory ("cd My_Fuseki_install) and give relative paths for command arguments (" --config=run/my_config.ttl ").
>>
>>
>>
>>
>>
>>
>> Le 18/01/2019 à 17:13, Chris Tomlinson a écrit :
>>> Hi,
>>>
>>> 1) If you’re using a default config, it does not have a working jena-text configuration. The config will need to  include skos:prefLabel in the entity map.
>>>
>>> 2) when you change the jena-text in significant ways, such as changing what analyzer is used for a given property and so on, then you’ll need to rebuild the Lucene index via reloading the dataset or using the textIndexer <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. I don’t recall this being mentioned as part of your testing
>>>
>>> 3) Please indicate exactly which item you’re using jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and the config file itself. The error you’ve mentioned previously:
>>>
>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] Config     INFO  Load configuration: file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>>>> Jan 17 17:00:28 semantic-dev java[16800]:         at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>>> suggests to me that something in the config file is confusing the readAssemblerFile. It doesn’t look like it’s failing in the reading the jena-text portion of the config.
>>>
>>> If http://api.finto.fi/download/mesh/mesh-skos.ttl <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then can you cut it down to just a small test case with some concepts with “medi” and a few without? That along with the other information should help move this further along..
>>>
>>> 4) Your query:
>>>
>>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core# <http://www.w3.org/2004/02/skos/core#>>
>>>> PREFIX text: <http://jena.apache.org/text# <http://jena.apache.org/text#>>
>>>> SELECT *
>>>> WHERE
>>>> {
>>>>    GRAPH <http://www.yso.fi/onto/mesh/ <http://www.yso.fi/onto/mesh/>>
>>>>    {
>>>>      ?concept text:query (skos:prefLabel "medi") .
>>>>      ?concept skos:prefLabel ?prefLabel .
>>>>
>>>>      # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>>    }
>>>> }
>>>> limit 10
>>> might effectively just be executing:
>>>
>>>> ?concept skos:prefLabel ?prefLabel .
>>> if there is actually no jena-text config - I haven’t checked what happens when there is no TextIndex configured and the text:query is invoked, but may be a noop
>>>
>>> Thanks,
>>> Chris
>>>
>>>
>>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen <mi...@lingsoft.fi> wrote:
>>>>
>>>>
>>>>
>>>> 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: mikael.pesonen@lingsoft.fi
>>>> 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
>>>>

Re: Text search from sparql

Posted by ajs6f <aj...@apache.org>.
Hi, Vincent--

As mentioned in a recent thread, you needn't be a committer or have any other official role to improve that page. Just use the link in the upper right to submit your suggested changes, and I promise to review/commit them! (Probably with some help from Chris or Osma, who know the text-indexing machinery much much better than do I.)

ajs6f

> On Jan 18, 2019, at 11:32 AM, Vincent Ventresque <vi...@ens-lyon.fr> wrote:
> 
> Hi Chris,
> 
> I'd like to add sthg about the documentation page : it's a bit laconic, and I spent a few hours to understand that values have to be provided in config file for dataset uri.
> 
> Furthermore, I had to search on Stackoverflow, and saw other users had the same problem with jena-text config)
> 
> Maybe s.o. could add some explanations on this page?
> 
> -- give a value for dataset URI (replace <#dataset> with sthg like :my_dataset)
> 
> -- give a path for Lucene index files => this will create a directory
> 
> -- give a path for TDB (tdb:location "/home/.../fuseki/run/databases/My_dataset")
> 
> -- if you don't set environment variables, run fuseki after changing directory ("cd My_Fuseki_install) and give relative paths for command arguments (" --config=run/my_config.ttl ").
> 
> 
> 
> 
> 
> 
> Le 18/01/2019 à 17:13, Chris Tomlinson a écrit :
>> Hi,
>> 
>> 1) If you’re using a default config, it does not have a working jena-text configuration. The config will need to  include skos:prefLabel in the entity map.
>> 
>> 2) when you change the jena-text in significant ways, such as changing what analyzer is used for a given property and so on, then you’ll need to rebuild the Lucene index via reloading the dataset or using the textIndexer <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. I don’t recall this being mentioned as part of your testing
>> 
>> 3) Please indicate exactly which item you’re using jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and the config file itself. The error you’ve mentioned previously:
>> 
>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] Config     INFO  Load configuration: file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>>> Jan 17 17:00:28 semantic-dev java[16800]:         at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>> suggests to me that something in the config file is confusing the readAssemblerFile. It doesn’t look like it’s failing in the reading the jena-text portion of the config.
>> 
>> If http://api.finto.fi/download/mesh/mesh-skos.ttl <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then can you cut it down to just a small test case with some concepts with “medi” and a few without? That along with the other information should help move this further along..
>> 
>> 4) Your query:
>> 
>>> PREFIX skos: <http://www.w3.org/2004/02/skos/core# <http://www.w3.org/2004/02/skos/core#>>
>>> PREFIX text: <http://jena.apache.org/text# <http://jena.apache.org/text#>>
>>> SELECT *
>>> WHERE
>>> {
>>>   GRAPH <http://www.yso.fi/onto/mesh/ <http://www.yso.fi/onto/mesh/>>
>>>   {
>>>     ?concept text:query (skos:prefLabel "medi") .
>>>     ?concept skos:prefLabel ?prefLabel .
>>> 
>>>     # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>>   }
>>> }
>>> limit 10
>> might effectively just be executing:
>> 
>>> ?concept skos:prefLabel ?prefLabel .
>> if there is actually no jena-text config - I haven’t checked what happens when there is no TextIndex configured and the text:query is invoked, but may be a noop
>> 
>> Thanks,
>> Chris
>> 
>> 
>>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen <mi...@lingsoft.fi> wrote:
>>> 
>>> 
>>> 
>>> 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: mikael.pesonen@lingsoft.fi
>>> 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
>>> 
>> 


Re: Text search from sparql

Posted by Vincent Ventresque <vi...@ens-lyon.fr>.
Hi Chris,

I'd like to add sthg about the documentation page : it's a bit laconic, 
and I spent a few hours to understand that values have to be provided in 
config file for dataset uri.

Furthermore, I had to search on Stackoverflow, and saw other users had 
the same problem with jena-text config)

Maybe s.o. could add some explanations on this page?

-- give a value for dataset URI (replace <#dataset> with sthg like 
:my_dataset)

-- give a path for Lucene index files => this will create a directory

-- give a path for TDB (tdb:location 
"/home/.../fuseki/run/databases/My_dataset")

-- if you don't set environment variables, run fuseki after changing 
directory ("cd My_Fuseki_install) and give relative paths for command 
arguments (" --config=run/my_config.ttl ").





  

Le 18/01/2019 à 17:13, Chris Tomlinson a écrit :
> Hi,
>
> 1) If you’re using a default config, it does not have a working jena-text configuration. The config will need to  include skos:prefLabel in the entity map.
>
> 2) when you change the jena-text in significant ways, such as changing what analyzer is used for a given property and so on, then you’ll need to rebuild the Lucene index via reloading the dataset or using the textIndexer <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. I don’t recall this being mentioned as part of your testing
>
> 3) Please indicate exactly which item you’re using jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and the config file itself. The error you’ve mentioned previously:
>
>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] Config     INFO  Load configuration: file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
>> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
>> Jan 17 17:00:28 semantic-dev java[16800]:         at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
> suggests to me that something in the config file is confusing the readAssemblerFile. It doesn’t look like it’s failing in the reading the jena-text portion of the config.
>
> If http://api.finto.fi/download/mesh/mesh-skos.ttl <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then can you cut it down to just a small test case with some concepts with “medi” and a few without? That along with the other information should help move this further along..
>
> 4) Your query:
>
>> PREFIX skos: <http://www.w3.org/2004/02/skos/core# <http://www.w3.org/2004/02/skos/core#>>
>> PREFIX text: <http://jena.apache.org/text# <http://jena.apache.org/text#>>
>> SELECT *
>> WHERE
>> {
>>    GRAPH <http://www.yso.fi/onto/mesh/ <http://www.yso.fi/onto/mesh/>>
>>    {
>>      ?concept text:query (skos:prefLabel "medi") .
>>      ?concept skos:prefLabel ?prefLabel .
>>
>>      # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>>    }
>> }
>> limit 10
> might effectively just be executing:
>
>> ?concept skos:prefLabel ?prefLabel .
> if there is actually no jena-text config - I haven’t checked what happens when there is no TextIndex configured and the text:query is invoked, but may be a noop
>
> Thanks,
> Chris
>
>
>> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen <mi...@lingsoft.fi> wrote:
>>
>>
>>
>> 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: mikael.pesonen@lingsoft.fi
>> 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
>>
>

Re: Text search from sparql

Posted by Chris Tomlinson <ch...@gmail.com>.
Hi,

1) If you’re using a default config, it does not have a working jena-text configuration. The config will need to  include skos:prefLabel in the entity map.

2) when you change the jena-text in significant ways, such as changing what analyzer is used for a given property and so on, then you’ll need to rebuild the Lucene index via reloading the dataset or using the textIndexer <https://jena.apache.org/documentation/query/text-query.html#building-a-text-index>. I don’t recall this being mentioned as part of your testing

3) Please indicate exactly which item you’re using jena-fuseki-war-3.9.0.war or jena-fuseki-webapp-3.9.0.jar etc, and the config file itself. The error you’ve mentioned previously:

> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] Config     INFO  Load configuration: file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl <file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl>
> Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] WebAppContext WARN  Failed startup of context o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE <file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE>}
> Jan 17 17:00:28 semantic-dev java[16800]:         at org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)

suggests to me that something in the config file is confusing the readAssemblerFile. It doesn’t look like it’s failing in the reading the jena-text portion of the config.

If http://api.finto.fi/download/mesh/mesh-skos.ttl <http://api.finto.fi/download/mesh/mesh-skos.ttl> the dataset, then can you cut it down to just a small test case with some concepts with “medi” and a few without? That along with the other information should help move this further along..

4) Your query: 

> PREFIX skos: <http://www.w3.org/2004/02/skos/core# <http://www.w3.org/2004/02/skos/core#>>
> PREFIX text: <http://jena.apache.org/text# <http://jena.apache.org/text#>>
> SELECT *
> WHERE
> {
>   GRAPH <http://www.yso.fi/onto/mesh/ <http://www.yso.fi/onto/mesh/>>
>   {
>     ?concept text:query (skos:prefLabel "medi") .
>     ?concept skos:prefLabel ?prefLabel .
> 
>     # FILTER (  REGEX(?prefLabel, "\\bmedi", "i"))
>   }
> }
> limit 10

might effectively just be executing:

> ?concept skos:prefLabel ?prefLabel .

if there is actually no jena-text config - I haven’t checked what happens when there is no TextIndex configured and the text:query is invoked, but may be a noop

Thanks,
Chris


> On Jan 18, 2019, at 8:08 AM, Mikael Pesonen <mi...@lingsoft.fi> wrote:
> 
> 
> 
> 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: mikael.pesonen@lingsoft.fi
> 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
> 


Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.

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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by Andy Seaborne <an...@apache.org>.

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?

     Andy

Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.

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".

>
>
>> Adding filter FILTER (  REGEX(?prefLabel, "\\bmedi", "i")) works as 
>> expected.
>
>
>
>>
>>>
>>>>
>>>> Then copied Text Dataset Assembler from 
>>>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>>>> into apache-jena-fuseki-3.9.0/run/configuration
>>>> With that fuseki start fails:
>>>>
>>>> Jan 16 14:40:03 semantic-dev java[17961]: [2019-01-16 14:40:03] 
>>>> WebAppContext WARN  Failed startup of context 
>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE} 
>>>>
>>>
>>> Looks like it can't find the UI code.
>>>
>>> Is file:///home/text/tools/apache-jena-fuseki-3.9.0 correct?
>> /home/text/tools/apache-jena-fuseki-3.9.0/webapp contains the default 
>> install files:
>>
>> -rw-r--r-- 1 fuseki 3485 Sep 28 20:15 admin-logs.html
>> drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 css
>> -rw-r--r-- 1 fuseki 12441 Sep 28 20:15 dataset.html
>> -rw-r--r-- 1 fuseki 3756 Sep 28 20:15 documentation.html
>> drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 fonts
>> drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 images
>> -rw-r--r-- 1 fuseki 4283 Sep 28 20:15 index.html
>> drwxr-xr-x 4 fuseki 4096 Nov 26 11:32 js
>> -rw-r--r-- 1 fuseki 4434 Sep 28 20:15 manage.html
>> -rw-r--r-- 1 fuseki 3159 Sep 28 20:15 services.html
>> drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 test
>> -rw-r--r-- 1 fuseki 7318 Sep 28 20:15 validate.html
>> drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 WEB-INF
>>
>>>
>>>>
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148) 
>>>>
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178) 
>>>>
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226) 
>>>>
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98) 
>>>>
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56) 
>>>>
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356) 
>>>>
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104) 
>>>>
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
>>>>
>>>> Otherwise all settings are default. Any tips what to try next?
>>>>
>>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by Andy Seaborne <an...@apache.org>.

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"


> Adding filter FILTER (  REGEX(?prefLabel, "\\bmedi", "i")) works as 
> expected.



> 
>>
>>>
>>> Then copied Text Dataset Assembler from 
>>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>>> into apache-jena-fuseki-3.9.0/run/configuration
>>> With that fuseki start fails:
>>>
>>> Jan 16 14:40:03 semantic-dev java[17961]: [2019-01-16 14:40:03] 
>>> WebAppContext WARN  Failed startup of context 
>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE} 
>>>
>>
>> Looks like it can't find the UI code.
>>
>> Is file:///home/text/tools/apache-jena-fuseki-3.9.0 correct?
> /home/text/tools/apache-jena-fuseki-3.9.0/webapp contains the default 
> install files:
> 
> -rw-r--r-- 1 fuseki 3485 Sep 28 20:15 admin-logs.html
> drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 css
> -rw-r--r-- 1 fuseki 12441 Sep 28 20:15 dataset.html
> -rw-r--r-- 1 fuseki 3756 Sep 28 20:15 documentation.html
> drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 fonts
> drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 images
> -rw-r--r-- 1 fuseki 4283 Sep 28 20:15 index.html
> drwxr-xr-x 4 fuseki 4096 Nov 26 11:32 js
> -rw-r--r-- 1 fuseki 4434 Sep 28 20:15 manage.html
> -rw-r--r-- 1 fuseki 3159 Sep 28 20:15 services.html
> drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 test
> -rw-r--r-- 1 fuseki 7318 Sep 28 20:15 validate.html
> drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 WEB-INF
> 
>>
>>>
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148) 
>>>
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178) 
>>>
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226) 
>>>
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98) 
>>>
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56) 
>>>
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356) 
>>>
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104) 
>>>
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
>>>
>>> Otherwise all settings are default. Any tips what to try next?
>>>
> 

Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.

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?
Adding filter FILTER (  REGEX(?prefLabel, "\\bmedi", "i")) works as 
expected.

>
>>
>> Then copied Text Dataset Assembler from 
>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>> into apache-jena-fuseki-3.9.0/run/configuration
>> With that fuseki start fails:
>>
>> Jan 16 14:40:03 semantic-dev java[17961]: [2019-01-16 14:40:03] 
>> WebAppContext WARN  Failed startup of context 
>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
>
> Looks like it can't find the UI code.
>
> Is file:///home/text/tools/apache-jena-fuseki-3.9.0 correct?
/home/text/tools/apache-jena-fuseki-3.9.0/webapp contains the default 
install files:

-rw-r--r-- 1 fuseki 3485 Sep 28 20:15 admin-logs.html
drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 css
-rw-r--r-- 1 fuseki 12441 Sep 28 20:15 dataset.html
-rw-r--r-- 1 fuseki 3756 Sep 28 20:15 documentation.html
drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 fonts
drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 images
-rw-r--r-- 1 fuseki 4283 Sep 28 20:15 index.html
drwxr-xr-x 4 fuseki 4096 Nov 26 11:32 js
-rw-r--r-- 1 fuseki 4434 Sep 28 20:15 manage.html
-rw-r--r-- 1 fuseki 3159 Sep 28 20:15 services.html
drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 test
-rw-r--r-- 1 fuseki 7318 Sep 28 20:15 validate.html
drwxr-xr-x 2 fuseki 4096 Nov 26 11:32 WEB-INF

>
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
>>
>> Otherwise all settings are default. Any tips what to try next?
>>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
This error comes what ever I put in the config file. So if 
run/configuration is empty, everything works except text search. If I 
put anything there, following error occurs.

Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] 
Config     INFO  Load configuration: 
file:///home/text/tools/apache-jena-fuseki-3.9.0/run/configuration/text_index.ttl
Jan 17 17:00:28 semantic-dev java[16800]: [2019-01-17 17:00:28] 
WebAppContext WARN  Failed startup of context 
o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
Jan 17 17:00:28 semantic-dev java[16800]:         at 
org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
Jan 17 17:00:28 semantic-dev java[16800]:         at 
org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178)
Jan 17 17:00:28 semantic-dev java[16800]:         at 
org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226)
Jan 17 17:00:28 semantic-dev java[16800]:         at 
org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98)
Jan 17 17:00:28 semantic-dev java[16800]:         at 
org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
Jan 17 17:00:28 semantic-dev java[16800]:         at 
org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
Jan 17 17:00:28 semantic-dev java[16800]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
Jan 17 17:00:28 semantic-dev java[16800]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
Jan 17 17:00:28 semantic-dev java[16800]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
Jan 17 17:00:28 semantic-dev java[16800]:         at 
org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)


On 17/01/2019 16:40, Andy Seaborne wrote:
> Just on this point:
>
>>
>> Is that path file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/ 
>> correct, should it be 
>> file:/home/text/tools/apache-jena-fuseki-3.9.0/webapp/ ?
>
> file:/// is correct
>
> An absolute URI is scheme://authority/path (RFC3986).
>
> file:/ is what Java produces - strictly, it's not an absolute URI.
> Jena copes with file:/ internally.
>
> (Not that the file: URI scheme is that well defined.)
>
>>
>> Where does that setting come from?
>
> Jena converts file paths to file: URIs
>
>     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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by Andy Seaborne <an...@apache.org>.
Just on this point:

> 
> Is that path file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/ 
> correct, should it be 
> file:/home/text/tools/apache-jena-fuseki-3.9.0/webapp/ ?

file:/// is correct

An absolute URI is scheme://authority/path (RFC3986).

file:/ is what Java produces - strictly, it's not an absolute URI.
Jena copes with file:/ internally.

(Not that the file: URI scheme is that well defined.)

> 
> Where does that setting come from?

Jena converts file paths to file: URIs

     Andy

Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
Fuseki is run as service (if helps any):

[Unit]
Description=Apache Jena Fuseki

[Service]
Type=simple
User=fuseki
#Environment=JAVA_HOME=/usr/lib/jvm/java-8-oracle/
Environment=FUSEKI_HOME=/home/text/tools/apache-jena-fuseki-3.9.0
Environment=FUSEKI_BASE=/home/text/tools/apache-jena-fuseki-3.9.0/run
ExecStart=/usr/bin/java 
-Dlog4j.configuration=file:/home/text/tools/apache-jena-fuseki-3.9.0/log4j.properties 
-Xmx5600M
-jar /home/text/tools/apache-jena-fuseki-3.9.0/fuseki-server.jar 
--update --port 3030  --loc=/home/text/tools/jena_data_test/ /ds

[Install]
WantedBy=multi-user.target




Is that path file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/ 
correct, should it be 
file:/home/text/tools/apache-jena-fuseki-3.9.0/webapp/ ?

Where does that setting come from?

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.
>
>>
>> Then copied Text Dataset Assembler from 
>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>> into apache-jena-fuseki-3.9.0/run/configuration
>> With that fuseki start fails:
>>
>> Jan 16 14:40:03 semantic-dev java[17961]: [2019-01-16 14:40:03] 
>> WebAppContext WARN  Failed startup of context 
>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
>
> Looks like it can't find the UI code.
>
> Is file:///home/text/tools/apache-jena-fuseki-3.9.0 correct?
>
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104) 
>>
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
>>
>> Otherwise all settings are default. Any tips what to try next?
>>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by Andy Seaborne <an...@apache.org>.

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.

> 
> Then copied Text Dataset Assembler from 
> https://jena.apache.org/documentation/query/text-query.html#configuration into 
> apache-jena-fuseki-3.9.0/run/configuration
> With that fuseki start fails:
> 
> Jan 16 14:40:03 semantic-dev java[17961]: [2019-01-16 14:40:03] 
> WebAppContext WARN  Failed startup of context 
> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}

Looks like it can't find the UI code.

Is file:///home/text/tools/apache-jena-fuseki-3.9.0 correct?

> 
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148) 
> 
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178) 
> 
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226) 
> 
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98) 
> 
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56) 
> 
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356) 
> 
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104) 
> 
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
> 
> Otherwise all settings are default. Any tips what to try next?
> 

Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
Ok sorry just learning this configuration stuff. Changing that value 
didn't help.

Also tried giving the ttl file from command line parameter --config but 
same error. So something must be wrong with the config file.


On 16/01/2019 16:57, Vincent Ventresque wrote:
> the relevant part is in the config file (pasted on the page) but I 
> thought the links on the page could be useful too.
>
> In the code I used I had to replace "<#dataset>" with 
> ":tdb_dataset_readwrite||||
>
>
>
> Le 16/01/2019 à 15:47, Mikael Pesonen a écrit :
>>
>> Thanks for reply. Didn't find any info on fixed Uri on that page, it 
>> seemed to be about timeouts?
>>
>> On 16/01/2019 15:07, Vincent Ventresque wrote:
>>> Hello
>>>
>>> I'm not sure if your problem is the same I had encountered when 
>>> configuring Lucene, but you might have to modify the config file to 
>>> set a fixed Uri for the dataset (see my question here : 
>>> https://stackoverflow.com/questions/48318966/fuseki-config-for-2-datasets-text-index-how-to-use-turtle-files)
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Le 16/01/2019 à 13:50, Mikael Pesonen a écrit :
>>>>
>>>> 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 "mdi") .
>>>>   ?concept skos:prefLabel ?prefLabel
>>>>
>>>> That returns all concepts so I guess it's not enabled.
>>>>
>>>> Then copied Text Dataset Assembler from 
>>>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>>>> into apache-jena-fuseki-3.9.0/run/configuration
>>>> With that fuseki start fails:
>>>>
>>>> Jan 16 14:40:03 semantic-dev java[17961]: [2019-01-16 14:40:03] 
>>>> WebAppContext WARN  Failed startup of context 
>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
>>>>
>>>> Otherwise all settings are default. Any tips what to try next?
>>>>
>>
>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
That change didn't help. Also checked that folder 
/home/text/tools/apache-jena-fuseki-3.9.0/webapp is found and contains 
the default files from the package.


On 16/01/2019 16:57, Vincent Ventresque wrote:
> the relevant part is in the config file (pasted on the page) but I 
> thought the links on the page could be useful too.
>
> In the code I used I had to replace "<#dataset>" with 
> ":tdb_dataset_readwrite||||
>
>
>
> Le 16/01/2019 à 15:47, Mikael Pesonen a écrit :
>>
>> Thanks for reply. Didn't find any info on fixed Uri on that page, it 
>> seemed to be about timeouts?
>>
>> On 16/01/2019 15:07, Vincent Ventresque wrote:
>>> Hello
>>>
>>> I'm not sure if your problem is the same I had encountered when 
>>> configuring Lucene, but you might have to modify the config file to 
>>> set a fixed Uri for the dataset (see my question here : 
>>> https://stackoverflow.com/questions/48318966/fuseki-config-for-2-datasets-text-index-how-to-use-turtle-files)
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Le 16/01/2019 à 13:50, Mikael Pesonen a écrit :
>>>>
>>>> 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 "mdi") .
>>>>   ?concept skos:prefLabel ?prefLabel
>>>>
>>>> That returns all concepts so I guess it's not enabled.
>>>>
>>>> Then copied Text Dataset Assembler from 
>>>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>>>> into apache-jena-fuseki-3.9.0/run/configuration
>>>> With that fuseki start fails:
>>>>
>>>> Jan 16 14:40:03 semantic-dev java[17961]: [2019-01-16 14:40:03] 
>>>> WebAppContext WARN  Failed startup of context 
>>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
>>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
>>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>>> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
>>>>
>>>> Otherwise all settings are default. Any tips what to try next?
>>>>
>>
>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by Vincent Ventresque <vi...@ens-lyon.fr>.
the relevant part is in the config file (pasted on the page) but I 
thought the links on the page could be useful too.

In the code I used I had to replace "<#dataset>" with 
":tdb_dataset_readwrite||||

  

Le 16/01/2019 à 15:47, Mikael Pesonen a écrit :
>
> Thanks for reply. Didn't find any info on fixed Uri on that page, it 
> seemed to be about timeouts?
>
> On 16/01/2019 15:07, Vincent Ventresque wrote:
>> Hello
>>
>> I'm not sure if your problem is the same I had encountered when 
>> configuring Lucene, but you might have to modify the config file to 
>> set a fixed Uri for the dataset (see my question here : 
>> https://stackoverflow.com/questions/48318966/fuseki-config-for-2-datasets-text-index-how-to-use-turtle-files)
>>
>>
>>
>>
>>
>>
>>
>> Le 16/01/2019 à 13:50, Mikael Pesonen a écrit :
>>>
>>> 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 "mdi") .
>>>   ?concept skos:prefLabel ?prefLabel
>>>
>>> That returns all concepts so I guess it's not enabled.
>>>
>>> Then copied Text Dataset Assembler from 
>>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>>> into apache-jena-fuseki-3.9.0/run/configuration
>>> With that fuseki start fails:
>>>
>>> Jan 16 14:40:03 semantic-dev java[17961]: [2019-01-16 14:40:03] 
>>> WebAppContext WARN  Failed startup of context 
>>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
>>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178)
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226)
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98)
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
>>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>>> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
>>>
>>> Otherwise all settings are default. Any tips what to try next?
>>>
>

Re: Text search from sparql

Posted by Mikael Pesonen <mi...@lingsoft.fi>.
Thanks for reply. Didn't find any info on fixed Uri on that page, it 
seemed to be about timeouts?

On 16/01/2019 15:07, Vincent Ventresque wrote:
> Hello
>
> I'm not sure if your problem is the same I had encountered when 
> configuring Lucene, but you might have to modify the config file to 
> set a fixed Uri for the dataset (see my question here : 
> https://stackoverflow.com/questions/48318966/fuseki-config-for-2-datasets-text-index-how-to-use-turtle-files)
>
>
>
>
>
>
>
> Le 16/01/2019 à 13:50, Mikael Pesonen a écrit :
>>
>> 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 "mdi") .
>>   ?concept skos:prefLabel ?prefLabel
>>
>> That returns all concepts so I guess it's not enabled.
>>
>> Then copied Text Dataset Assembler from 
>> https://jena.apache.org/documentation/query/text-query.html#configuration 
>> into apache-jena-fuseki-3.9.0/run/configuration
>> With that fuseki start fails:
>>
>> Jan 16 14:40:03 semantic-dev java[17961]: [2019-01-16 14:40:03] 
>> WebAppContext WARN  Failed startup of context 
>> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
>> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
>> Jan 16 14:40:03 semantic-dev java[17961]:         at 
>> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
>>
>> Otherwise all settings are default. Any tips what to try next?
>>

-- 
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: mikael.pesonen@lingsoft.fi
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


Re: Text search from sparql

Posted by Vincent Ventresque <vi...@ens-lyon.fr>.
Hello

I'm not sure if your problem is the same I had encountered when 
configuring Lucene, but you might have to modify the config file to set 
a fixed Uri for the dataset (see my question here : 
https://stackoverflow.com/questions/48318966/fuseki-config-for-2-datasets-text-index-how-to-use-turtle-files)





  

Le 16/01/2019 à 13:50, Mikael Pesonen a écrit :
>
> 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 "mdi") .
>   ?concept skos:prefLabel ?prefLabel
>
> That returns all concepts so I guess it's not enabled.
>
> Then copied Text Dataset Assembler from 
> https://jena.apache.org/documentation/query/text-query.html#configuration 
> into apache-jena-fuseki-3.9.0/run/configuration
> With that fuseki start fails:
>
> Jan 16 14:40:03 semantic-dev java[17961]: [2019-01-16 14:40:03] 
> WebAppContext WARN  Failed startup of context 
> o.e.j.w.WebAppContext@4159e81b{Apache Jena Fuseki 
> Server,/,file:///home/text/tools/apache-jena-fuseki-3.9.0/webapp/,UNAVAILABLE}
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.build.FusekiConfig.readAssemblerFile(FusekiConfig.java:148)
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:178)
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.webapp.FusekiSystem.initializeDataAccessPoints(FusekiSystem.java:226)
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:98)
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.cmd.JettyFuseki.start(JettyFuseki.java:138)
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
> Jan 16 14:40:03 semantic-dev java[17961]:         at 
> org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
>
> Otherwise all settings are default. Any tips what to try next?
>