Hello

Thanks for your remark.

Maybe it would be relevant to improve the documentation page. I had suggested a few clarifications and the changes were reviewed and accepted : see this thread https://mail-archives.apache.org/mod_mbox/jena-users/201901.mbox/browser

This is what Ajs6f said about contributing :

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

VV


On 25/07/2019 10:45, Scarlet Remilia wrote:
Hello,

According to turtle syntax document(https://www.w3.org/TR/turtle)
“:My_index_ES” with prefix
“@prefix :        
<http://localhost/jena_example/#<http://localhost/jena_example/>> .” will be 
parsed as
“<http://localhost/jena_example/#My_index_ES>”

But ,
Relative IRIs like <#indexES> are resolved relative to the current base IRI. A new 
base IRI can be defined using the '@base' or 'BASE' directive. If <#indexES> is used, 
it should be defined as follow:
@base <http://localhost/jena_example/#> .
<#indexES> a text:TextIndexES ;

Sent from Mail<https://go.microsoft.com/fwlink/?LinkId=550986> for Windows 10

From: vincent ventresque<mailto:[email protected]>
Sent: Thursday, July 25, 2019 14:48
To: [email protected]<mailto:[email protected]>
Subject: Re: Can't use ES in jena's text_dataset

Hello


I've spent hours with a similar problem (with Lucene, not ES).

Maybe you should provide a fixed uri for your index ?

:My_index_ES instead of <#indexES>

It worked for me.

I wrote a small tuto where you can find working examples of assembler
files and text queries (for Lucene)

https://sourceforge.net/projects/ffl-misc/files/TUTORIEL_Fuseki_BnF.pdf

The tuto is in French but you will find code samples and commands.



On 25/07/2019 05:02, 刑天 wrote:
Actually, even using text-config-es.ttl in jena-text-es module wouldn't work...








At 2019-07-25 09:50:30, "刑天" <[email protected]> wrote:
I followed the instruction in wiki and example in text-es module. The 
assembler's source code is here:
@prefix :        
<http://localhost/jena_example/#<http://localhost/jena_example/>> .
@prefix rdf:     
<http://www.w3.org/1999/02/22-rdf-syntax-ns#<http://www.w3.org/1999/02/22-rdf-syntax-ns>>
 .
@prefix rdfs:    
<http://www.w3.org/2000/01/rdf-schema#<http://www.w3.org/2000/01/rdf-schema>> .
@prefix tdb:     
<http://jena.hpl.hp.com/2008/tdb#<http://jena.hpl.hp.com/2008/tdb>> .
@prefix ja:      
<http://jena.hpl.hp.com/2005/11/Assembler#<http://jena.hpl.hp.com/2005/11/Assembler>>
 .
@prefix text:    <http://jena.apache.org/text#<http://jena.apache.org/text>> .
@prefix skos:    
<http://www.w3.org/2004/02/skos/core#<http://www.w3.org/2004/02/skos/core>>
@prefix fuseki:  
<http://jena.apache.org/fuseki#<http://jena.apache.org/fuseki>> .


:service_tdb_all  a                   fuseki:Service ;
         rdfs:label                    "TDB music" ;
         fuseki:dataset                :text_dataset ;
         fuseki:name                   "movie_entities_es" ;
         fuseki:serviceQuery           "query" , "sparql" ;
         fuseki:serviceReadGraphStore  "get" ;
         fuseki:serviceReadWriteGraphStore
                 "data" ;
         fuseki:serviceUpdate          "update" ;
         fuseki:serviceUpload          "upload" .




# TDB
[] ja:loadClass "org.apache.jena.tdb.TDB" .
tdb:DatasetTDB  rdfs:subClassOf  ja:RDFDataset .
tdb:GraphTDB    rdfs:subClassOf  ja:Model .


# Text
[] ja:loadClass "org.apache.jena.query.text.TextQuery" .
text:TextDataset      rdfs:subClassOf   ja:RDFDataset .
text:TextIndexES      rdfs:subClassOf   text:TextIndex .


## ---------------------------------------------------------------
## This URI must be fixed - it's used to assemble the text dataset.


:text_dataset rdf:type     text:TextDataset ;
     text:dataset   :movie_entities_es ;
     text:index     <#indexES> ;
     .


<#indexES> a text:TextIndexES ;
     text:serverList "127.0.0.1:9300" ; # A comma-separated list of Host:Port 
values of the ElasticSearch Cluster nodes.
     text:clusterName "elasticsearch" ; # Name of the ElasticSearch Cluster. If 
not specified defaults to 'elasticsearch'
     text:shards "1" ;                  # The number of shards for the index. 
Defaults to 1
     text:replicas "1" ;                # The number of replicas for the index. 
Defaults to 1
     text:indexName "jena-text" ;       # Name of the Index. defaults to 
jena-text
     text:entityMap <#entMap> ;
     .


<#entMap> a text:EntityMap ;
     text:entityField      "uri" ; # Defines the Document Type in the ES Index
     text:defaultField     "text" ; ## Must be defined in the text:maps
     text:map (
        [ text:field "label" ;
          text:predicate <http://ai.sankuai.com/KnowledgeGraph/Property/name> ]
   ) .




:movie_entities_es
         a             tdb:DatasetTDB ;
         tdb:location  "/Users/gaozhixin/data/movie_entities_20190723" .


And it gives me this error:


[2019-07-24 19:06:18] WebAppContext WARN  Failed startup of context 
o.e.j.w.WebAppContext@5eeedb60{Apache Jena Fuseki 
Server,/,file:///Users/gaozhixin/Programs/apache-jena-fuseki-3.12.0/webapp/,UNAVAILABLE}
org.apache.jena.assembler.exceptions.NoSpecificTypeException: the root 
file:///Users/gaozhixin/Programs/apache-jena-fuseki-3.12.0/run/configuration/movie_entities_es.ttl#indexES
 has no most specific type that is a subclass of ja:Object
   doing:
     root: http://localhost/jena_example/#text_dataset with type: 
http://jena.apache.org/text#TextDataset assembler class: class 
org.apache.jena.query.text.assembler.TextDatasetAssembler


at 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:139)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
at 
org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at 
org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at 
org.apache.jena.query.text.assembler.TextDatasetAssembler.open(TextDatasetAssembler.java:62)
at 
org.apache.jena.query.text.assembler.TextDatasetAssembler.open(TextDatasetAssembler.java:42)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.openBySpecificType(AssemblerGroup.java:157)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$PlainAssemblerGroup.open(AssemblerGroup.java:144)
at 
org.apache.jena.assembler.assemblers.AssemblerGroup$ExpandingAssemblerGroup.open(AssemblerGroup.java:93)
at 
org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:39)
at 
org.apache.jena.assembler.assemblers.AssemblerBase.open(AssemblerBase.java:35)
at org.apache.jena.fuseki.build.FusekiConfig.getDataset(FusekiConfig.java:353)
at 
org.apache.jena.fuseki.build.FusekiConfig.buildDataService(FusekiConfig.java:303)
at 
org.apache.jena.fuseki.build.FusekiConfig.buildDataAccessPoint(FusekiConfig.java:292)
at 
org.apache.jena.fuseki.build.FusekiConfig.readConfiguration(FusekiConfig.java:275)
at 
org.apache.jena.fuseki.build.FusekiConfig.readConfigurationDirectory(FusekiConfig.java:254)
at 
org.apache.jena.fuseki.webapp.FusekiWebapp.initializeDataAccessPoints(FusekiWebapp.java:226)
at 
org.apache.jena.fuseki.webapp.FusekiServerListener.serverInitialization(FusekiServerListener.java:99)
at 
org.apache.jena.fuseki.webapp.FusekiServerListener.contextInitialized(FusekiServerListener.java:56)
at 
org.eclipse.jetty.server.handler.ContextHandler.callContextInitialized(ContextHandler.java:952)
at 
org.eclipse.jetty.servlet.ServletContextHandler.callContextInitialized(ServletContextHandler.java:558)
at 
org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:917)
at 
org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:370)
at org.eclipse.jetty.webapp.WebAppContext.startWebapp(WebAppContext.java:1497)
at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1459)
at 
org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:847)
at 
org.eclipse.jetty.servlet.ServletContextHandler.doStart(ServletContextHandler.java:287)
at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:545)
at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at 
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at 
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at 
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at 
org.eclipse.jetty.server.handler.gzip.GzipHandler.doStart(GzipHandler.java:410)
at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at 
org.eclipse.jetty.util.component.ContainerLifeCycle.start(ContainerLifeCycle.java:138)
at org.eclipse.jetty.server.Server.start(Server.java:416)
at 
org.eclipse.jetty.util.component.ContainerLifeCycle.doStart(ContainerLifeCycle.java:108)
at 
org.eclipse.jetty.server.handler.AbstractHandler.doStart(AbstractHandler.java:113)
at org.eclipse.jetty.server.Server.doStart(Server.java:383)
at 
org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:68)
at 
org.apache.jena.fuseki.cmd.JettyFusekiWebapp.start(JettyFusekiWebapp.java:138)
at org.apache.jena.fuseki.cmd.FusekiCmd.runFuseki(FusekiCmd.java:372)
at org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.exec(FusekiCmd.java:356)
at jena.cmd.CmdMain.mainMethod(CmdMain.java:93)
at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
at 
org.apache.jena.fuseki.cmd.FusekiCmd$FusekiCmdInner.innerMain(FusekiCmd.java:104)
at org.apache.jena.fuseki.cmd.FusekiCmd.main(FusekiCmd.java:67)
[2019-07-24 19:06:18] Server     INFO  Started 2019/07/24 19:06:18 CST on port 
3030


Is there anything wrong in my code?

Reply via email to