在 dbpedia 上运行查询时超时事务
您好,有一个查询一直在工作,直到昨天:
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT DISTINCT(?film_link) ?film_abstract ?film_name ?wikipage
WHERE {
?film_link rdf:type <http://dbpedia.org/ontology/Film> .
?film_link rdfs:comment ?film_abstract
FILTER (langMatches( lang(?film_abstract), "EN")) .
?film_link foaf:name ?film_name .
?film_title foaf:page ?wikipage .
}
但今天它显示:Virtuoso 42000 错误估计执行时间 99232592(秒)超出了 1500(秒)的限制。 我之前也看到过这个错误,但是当我在一段时间后再次运行这样的查询时,它运行了.. 谁能解释一下错误的含义吗?
HI there is a query which was working untill yesterday :
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX foaf: <http://xmlns.com/foaf/0.1/>
SELECT DISTINCT(?film_link) ?film_abstract ?film_name ?wikipage
WHERE {
?film_link rdf:type <http://dbpedia.org/ontology/Film> .
?film_link rdfs:comment ?film_abstract
FILTER (langMatches( lang(?film_abstract), "EN")) .
?film_link foaf:name ?film_name .
?film_title foaf:page ?wikipage .
}
but today it is showing: Virtuoso 42000 Error The estimated execution time 99232592 (sec) exceeds the limit of 1500 (sec).
I have seen this error earlier also but when i ran such query again after some time it runs..
Could anyone explain the meaning of the error?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这意味着 Virtuoso 的查询规划器(Virtuoso 是 DBPedia 运行的三元组存储)已估计评估您的查询需要多长时间,并且它认为需要太长时间,因此拒绝运行查询。
我怀疑问题出在查询中的最后一个三元组模式:
在此之前您从未使用过这些变量中的任何一个,因此您要求 Virtuoso 做的是将每个可能的三元组与 foaf:page 进行叉积谓词位置与查询其余部分中的结果。
如果你将其更改为以下内容,它应该可以正常工作:
我怀疑这就是你想要写的内容,尽管它仍然很慢,但它仍然很慢,因为你的查询非常广泛,并且
FILTER
子句经常出现评价起来相当缓慢。It means that Virtuoso's query planner (Virtuoso is the triplestore that DBPedia runs on) has estimated how long it would take to evaluate your query and it thinks it will take too long so it has refused to run the query.
I suspect the problem is the last triple pattern in your query:
You never use either of those variables before that point so what you've asked Virtuoso to do is cross product every possible triple with
foaf:page
in the predicate position with the results in the rest of your query.If you change this to the following it should work fine:
I suspect this is what you meant to write anyway and this works for though it is still pretty slow because your query is pretty broad and
FILTER
clauses are often quite sluggish to evaluate.