我在dotNetRDF C#中运行SPARQL查询,得到以下错误:
VDS.RDF.Query.RdfQueryTimeoutException
HResult=0x80131500
Message=Query Execution Time exceeded the Timeout of 180000ms; query aborted after 366471ms
Source=dotNetRDF而在Apache Jena和Python(rdflib)上相同的查询性能分别为25.60秒和179.94秒。
那么,有没有什么方法可以增加对dotNetRDF的查询超时时间,这里我将从LinkedMovie dataset获取的查询包含在内。
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发布于 2020-09-16 20:59:18
查询超时设置通过静态VDS.RDF.Options.QueryExecutionTimeout属性以及各个SparqlQuery实例的Timeout属性进行控制。但是,通过VDS.RDF.Options设置的全局超时始终提供一个上限(除非将其设置为0,表示没有全局超时)。由于默认全局超时为3分钟(180,000ms),因此需要增加此全局设置才能执行更长时间的查询。
有关更改查询的超时值的详细信息,请参阅User Guide page on Global Options (在查询选项部分)。
有关在查询过程中应用哪些优化的详细信息,请参阅Developer Guide page on SPARQL optimisation。
https://stackoverflow.com/questions/63918078
复制相似问题