text-query-es模块是否需要SPARQL语法中的'limit'?

时间:2019-10-18 19:29:06

标签: jena fuseki

我想切换到elasticsearch(6.4.2),但仅通过在java -cp中包含jena-text-es jar文件,而无法使其与Fuseki的发行版(3.12.0)一起使用。因此,我在将fuseki作为依赖项添加到jena-fuseki-core和jena-fuseki-webapp的pom.xml文件中之后,构建了Fuseki。

这可行,但是在尝试运行text:query SPARQL查询而没有传递限制参数时遇到了一些问题。

documentation将其列为可选输入参数,但是当我不包含它时,它会返回一个 [size]参数不能为负,找到[-1](#500) 错误消息。 es实现中需要它吗?

我尝试将Fuseki版本更改为3.10.0(兼容性表中列出的版本),但仍会产生相同的错误。

(对于以下示例查询,我已将data-es.ttl加载到默认图形。)

以下查询将预期的result返回给我:

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX text: <http://jena.apache.org/text#>

SELECT ?subject ?object
WHERE {
?subject text:query ('Whatever' 1).
?subject rdfs:label ?object .
}

但以下内容会产生上述error

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX text: <http://jena.apache.org/text#>

SELECT ?subject ?object
WHERE {
?subject text:query ('Whatever').
?subject rdfs:label ?object .
}

Fuseki日志显示如下:

[2019-10-18 14:27:56] Fuseki     INFO  [31] Query = PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>   PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>   PREFIX text: <http://jena.apache.
org/text#>  SELECT ?subject ?object WHERE { ?subject text:query ('Whatever'). ?subject rdfs:label ?object . }
[2019-10-18 14:27:56] Fuseki     WARN  [31] RC = 500 : [size] parameter cannot be negative, found [-1]
java.lang.IllegalArgumentException: [size] parameter cannot be negative, found [-1]
        at org.elasticsearch.search.builder.SearchSourceBuilder.size(SearchSourceBuilder.java:382)
        at org.elasticsearch.action.search.SearchRequestBuilder.setSize(SearchRequestBuilder.java:204)
        at org.apache.jena.query.text.es.TextIndexES.query(TextIndexES.java:403)
        at org.apache.jena.query.text.es.TextIndexES.query(TextIndexES.java:378)
        at org.apache.jena.query.text.TextQueryPF.performQuery(TextQueryPF.java:346)
        at org.apache.jena.query.text.TextQueryPF.query(TextQueryPF.java:284)
        at org.apache.jena.query.text.TextQueryPF.variableSubject(TextQueryPF.java:247)
        at org.apache.jena.query.text.TextQueryPF.exec(TextQueryPF.java:211)
        at org.apache.jena.sparql.pfunction.PropertyFunctionBase$RepeatApplyIteratorPF.nextStage(PropertyFunctionBase.java:106)
        at org.apache.jena.sparql.engine.iterator.QueryIterRepeatApply.makeNextStage(QueryIterRepeatApply.java:108)
        at org.apache.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding(QueryIterRepeatApply.java:65)
        at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114)
        at org.apache.jena.sparql.engine.iterator.QueryIterProcedure.hasNextBinding(QueryIterProcedure.java:73)
        at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114)
        at org.apache.jena.sparql.engine.main.iterator.QueryIterGraph$QueryIterGraphInner.hasNextBinding(QueryIterGraph.java:121)
        at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114)
        at org.apache.jena.sparql.engine.iterator.QueryIterRepeatApply.hasNextBinding(QueryIterRepeatApply.java:74)
        at org.apache.jena.sparql.engine.iterator.QueryIteratorBase.hasNext(QueryIteratorBase.java:114)
        at org.apache.jena.tdb.solver.OpExecutorTDB1.optimizeExecuteQuads(OpExecutorTDB1.java:212)
        at org.apache.jena.tdb.solver.OpExecutorTDB1.execute(OpExecutorTDB1.java:148)
        at org.apache.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:66)
        at org.apache.jena.sparql.algebra.op.OpQuadPattern.visit(OpQuadPattern.java:92)
        at org.apache.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:46)
        at org.apache.jena.sparql.engine.main.OpExecutor.exec(OpExecutor.java:117)
        at org.apache.jena.tdb.solver.OpExecutorTDB1.exec(OpExecutorTDB1.java:87)
        at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:228)
        at org.apache.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:130)
        at org.apache.jena.sparql.algebra.op.OpSequence.visit(OpSequence.java:75)
        at org.apache.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:46)
        at org.apache.jena.sparql.engine.main.OpExecutor.exec(OpExecutor.java:117)
        at org.apache.jena.tdb.solver.OpExecutorTDB1.exec(OpExecutorTDB1.java:87)
        at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:389)
        at org.apache.jena.sparql.engine.main.ExecutionDispatch.visit(ExecutionDispatch.java:267)
        at org.apache.jena.sparql.algebra.op.OpProject.visit(OpProject.java:47)
        at org.apache.jena.sparql.engine.main.ExecutionDispatch.exec(ExecutionDispatch.java:46)
        at org.apache.jena.sparql.engine.main.OpExecutor.exec(OpExecutor.java:117)
        at org.apache.jena.tdb.solver.OpExecutorTDB1.exec(OpExecutorTDB1.java:87)
        at org.apache.jena.sparql.engine.main.OpExecutor.execute(OpExecutor.java:88)
        at org.apache.jena.sparql.engine.main.QC.execute(QC.java:52)
        at org.apache.jena.sparql.engine.main.QueryEngineMain.eval(QueryEngineMain.java:55)
        at org.apache.jena.tdb.solver.QueryEngineTDB.eval(QueryEngineTDB.java:102)
        at org.apache.jena.sparql.engine.QueryEngineBase.evaluate(QueryEngineBase.java:175)
        at org.apache.jena.sparql.engine.QueryEngineBase.createPlan(QueryEngineBase.java:131)
        at org.apache.jena.sparql.engine.QueryEngineBase.getPlan(QueryEngineBase.java:112)
        at org.apache.jena.tdb.solver.QueryEngineTDB$QueryEngineFactoryTDB.create(QueryEngineTDB.java:136)
        at org.apache.jena.sparql.engine.QueryEngineFactoryWrapper.create(QueryEngineFactoryWrapper.java:49)
        at org.apache.jena.sparql.engine.QueryExecutionBase.getPlan(QueryExecutionBase.java:600)
        at org.apache.jena.sparql.engine.QueryExecutionBase.startQueryIterator(QueryExecutionBase.java:556)
        at org.apache.jena.sparql.engine.QueryExecutionBase.execResultSet(QueryExecutionBase.java:588)
        at org.apache.jena.sparql.engine.QueryExecutionBase.execSelect(QueryExecutionBase.java:197)
        at org.apache.jena.fuseki.servlets.SPARQL_Query.executeQuery(SPARQL_Query.java:335)
        at org.apache.jena.fuseki.servlets.SPARQL_Query.execute(SPARQL_Query.java:290)
        at org.apache.jena.fuseki.servlets.SPARQL_Query.executeWithParameter(SPARQL_Query.java:239)
        at org.apache.jena.fuseki.servlets.SPARQL_Query.perform(SPARQL_Query.java:224)
        at org.apache.jena.fuseki.servlets.ActionService.executeLifecycle(ActionService.java:266)
        at org.apache.jena.fuseki.servlets.ActionService.execCommonWorker(ActionService.java:155)
        at org.apache.jena.fuseki.servlets.ActionBase.doCommon(ActionBase.java:74)
        at org.apache.jena.fuseki.servlets.FusekiFilter.doFilter(FusekiFilter.java:73)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
        at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61)
        at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108)
        at org.apache.shiro.web.servlet.AdviceFilter.doFilterInternal(AdviceFilter.java:137)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:66)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449)
        at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365)
        at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90)
        at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83)
        at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383)
        at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362)
        at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1642)
        at org.apache.jena.fuseki.servlets.CrossOriginFilter.handle(CrossOriginFilter.java:285)
        at org.apache.jena.fuseki.servlets.CrossOriginFilter.doFilter(CrossOriginFilter.java:248)
        at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1634)
        at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:533)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146)
        at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257)
        at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255)
        at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1340)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203)
        at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
        at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
        at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201)
        at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1242)
        at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144)
        at org.eclipse.jetty.server.handler.gzip.GzipHandler.handle(GzipHandler.java:690)
        at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
        at org.eclipse.jetty.server.Server.handle(Server.java:503)
        at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364)
        at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260)
        at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305)
        at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103)
        at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168)
        at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126)
        at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366)
        at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765)
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:748)
[2019-10-18 14:27:56] Fuseki     INFO  [31] 500 [size] parameter cannot be negative, found [-1] (27 ms)
``

0 个答案:

没有答案