我已经有以下代码:
movie = "http://dbpedia.org/resource/Cannes_Man"
Q = "PREFIX dbo: <http://dbpedia.org/property/> PREFIX dbpedia: <http://dbpedia.org/resource/> SELECT ?actor WHERE {?actor dbo:starring <"+movie+">.} "
sparql = SPARQLWrapper("http://dbpedia.org/sparql")
sparql.setReturnFormat(JSON)
sparql.setQuery(Q) # the previous query as a literal string
activity_feed3 = sparql.query().convert()
print activity_feed3
for result5 in activity_feed3["results"]["bindings"]:
print result5
它返回空结果。我是扩展客户端和 dbpedia 的新手,我正在尝试了解如何运行简单的查询。任何帮助将不胜感激!