VDS.RDF.Query.RdfQueryTimeoutException on dotnetRDF



我正在dotNetRDF C#中运行SPARQL查询,并得到以下错误:

VDS.RDF.Query.RdfQueryTimeoutException
HResult=0x80131500
Message=Query Execution Time exceeded the Timeout of 180000ms; query aborted after 366471ms
Source=dotNetRDF

而在ApacheJena和Python(rdflib(上相同的查询性能分别为25.60秒和179.94秒。

所以,有什么方法可以增加dotNetRDF上查询的超时时间吗?这里我附上了从LinkedMovie数据集获取的查询。

PREFIX linkedmdb: <http://data.linkedmdb.org/movie/>
PREFIX dc: <http://purl.org/dc/terms/>
SELECT ?movie1 ?actor1 ?movie2 ?actor2 ?movie3 ?actor3 ?movie4 ?actor4 ?movie5
WHERE {
# select the source and target nodes
?s linkedmdb:actor_name "Hugh Jackman" .
?t linkedmdb:actor_name "Kevin Bacon" .
# find the five movies and the connecting actors between (make sure to filter out dupes)
?m1 dc:title ?movie1 ; linkedmdb:actor ?s ; linkedmdb:actor ?a1 .
FILTER(?s != ?a1 && ?t != ?a1)
?m2 dc:title ?movie2 ; linkedmdb:actor ?a1 ; linkedmdb:actor ?a2 .
FILTER(?m1 != ?m2)
FILTER(?a1 != ?a2)
FILTER(?s != ?a2 && ?t != ?a2)
?m3 dc:title ?movie3 ; linkedmdb:actor ?a2 ; linkedmdb:actor ?a3 .
FILTER(?m1 != ?m3 && ?m2 != ?m3)
FILTER(?a1 != ?a3 && ?a2 != ?a3)
FILTER(?s != ?a3 && ?t != ?a3)
?m4 dc:title ?movie4 ; linkedmdb:actor ?a3 ; linkedmdb:actor ?a4 .
FILTER(?m1 != ?m4 && ?m2 != ?m4 && ?m3 != ?m4)
FILTER(?a1 != ?a4 && ?a2 != ?a4 && ?a3 != ?a4)
FILTER(?s != ?a4 && ?t != ?a4)
?m5 dc:title ?movie5 ; linkedmdb:actor ?a4 ; linkedmdb:actor ?t .
FILTER(?m1 != ?m5 && ?m2 != ?m5 && ?m3 != ?m5 && ?m4 != ?m5)
# grab the actor names - much friendlier than the URIs
?a1 linkedmdb:actor_name ?actor1 .
?a2 linkedmdb:actor_name ?actor2 .
?a3 linkedmdb:actor_name ?actor3 .
?a4 linkedmdb:actor_name ?actor4 .
}
LIMIT 1

查询超时设置通过静态VDS.RDF.Options.QueryExecutionTimeout属性以及单个SparqlQuery实例的Timeout属性进行控制但是通过VDS.RDF.Options设置的全局超时总是提供一个上限(除非设置为0表示没有全局超时(。由于默认的全局超时为3分钟(18000ms(,您需要增加此全局设置才能执行更长时间的查询。

有关更改查询超时值的详细信息,请参阅"全局选项"上的"用户指南"页面(在"查询选项"部分(。

有关在查询过程中应用哪些优化的详细信息,请参阅SPARQL优化的开发人员指南页面。

最新更新