使用 dbpedia 作为终点向 jena (对于 sparql)添加超时?
我想知道是否有办法使用 Jena 通过 dbpedia 进行 sparql 查询并使用 http: 中给出的超时设置: //dbpedia.org/sparql(如果您看到此页面,您可以看到有一种方法可以在那里设置超时),这是需要的,因为我想做一个大查询并且我已经尝试了几次有时(通过页面)不设置超时,我无法得到结果(它始终是事务超时异常)
编辑:我使用java.lang.
I would like to know whether there is a way to use Jena to do a sparql query through dbpedia and using the timeout setting given in http://dbpedia.org/sparql (if you see this page, you could see that there is a way to set the timeout there), this is needed since I would like to make a big query and I have tried several times (via the page) that without setting the timeout, I cannot get the result (it is always a transaction timeout exception)
edited: I use java.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要执行您的查询,我猜您正在使用:
您可以尝试的一件事是:
似乎
QueryEngineHTTP
实现了QueryExecution
,它有一个addParam
方法。没有对该方法的描述,但我假设它会向 HTTP 请求添加一个参数。让我知道它是否有效!
已编辑
要修复错误,实际上是相反的...
QueryEngineHTTP
实现QueryExecution
To execute your query, I guess you're using :
One thing you could try is:
It seems that
QueryEngineHTTP
implementsQueryExecution
which has anaddParam
method. There's no description of that method but I'd assume that adds a parameter to the HTTP request.Let me know if it works !!
Edited
to fix error actually it was the other way around ...
QueryEngineHTTP
implementsQueryExecution
我会这样做:
如果达到超时限制,则抛出 org.apache.jena.query.QueryCancelledException 。
I would do it like this:
If if the timeout limit it reached then a org.apache.jena.query.QueryCancelledException is thrown.