4
我使用SPARQL通過Python查詢DBpedia。我正面臨着執行時間限制較高的問題。這是錯誤:如何更改DBpedia SPARQL查詢的執行時間限制? (Virtuoso 42000錯誤)
代碼:
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()
響應:
Virtuoso 42000 Error The estimated execution time 5286 (sec) exceeds the limit of 3000 (sec)
如何通過這個問題得到?