How to change upper execution time limit for a DBpedia SPARQL query? (Virtuoso 42000 error)

不打扰是莪最后的温柔 提交于 2020-01-02 06:30:22

问题


I am querying DBpedia using SPARQL through Python. I am facing issues with the upper execution time limit. This is the error :

Code :

sparql = SPARQLWrapper("http://dbpedia.org/sparql")
newquery = "DEFINE input:inference "skos-trans" PREFIX dcterms: <http://purl.org/dc/terms/> 
select distinct ?cat1 ?cat2 ?cat3 ?cat4  where { 
<http://dbpedia.org/resource/Pulp_Fiction> dcterms:subject ?cat1 . 
?cat1  skos:broaderTransitive   ?cat2. 
?cat2  skos:broaderTransitive   ?cat3. 
?cat3  skos:broaderTransitive   ?cat4. 
 } "

sparql.setQuery( newquery)
sparql.setReturnFormat(JSON)
results = sparql.query().convert()

Response:
Virtuoso 42000 Error The estimated execution time 5286 (sec) exceeds the limit of 3000 (sec)

How to get through this problem ??


回答1:


You can't using the public DBPedia endpoint, because the endpoint is very well known it is also heavily used so they have to limit how complex a query they allow people to run.

If you need to run queries that run into issues like this timeout consider using one of the available database dumps and running them in a local copy of Virtuoso or a triple store of your choice.



来源:https://stackoverflow.com/questions/11967785/how-to-change-upper-execution-time-limit-for-a-dbpedia-sparql-query-virtuoso-4

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!