Требует ли модуль text-query-es «ограничения» в синтаксисе SPARQL? - PullRequest
0 голосов
/ 18 октября 2019

Я хотел переключиться наasticsearch (6.4.2), но не смог заставить его работать с выпущенной версией Fuseki (3.12.0), просто включив jar-файл jena-text-es с java -cp. Поэтому я создал Fuseki после добавления его в качестве зависимости в файлах pom.xml в jena-fuseki-core и jena-fuseki-webapp.

Это сработало, но я столкнулся с некоторыми проблемами при попытке запустить text: querySPARQL-запросы без передачи аргумента limit.

Документация перечисляет его как необязательный входной аргумент, но когда я его не включаю, он возвращает параметр [size]не может быть отрицательным, найдено [-1] (# 500) сообщение об ошибке. Требуется ли это в реализации es?

Я попытался изменить версию Fuseki на 3.10.0 (версия указана в таблице совместимости), но все равно выдает ту же ошибку.

(Для следующих примеров запросов я загрузил data-es.ttl в график по умолчанию.)

Следующий запрос возвращает мне ожидаемый результат :

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

, но следующее выдает вышеупомянутую ошибку :

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