我有这个SPARQL query in python
sparql = SPARQLWrapper("http://dbpedia.org/sparql",returnFormat="json")
sparql.setQuery('''
SELECT DISTINCT *
where {
[] foaf:isPrimaryTopicOf ?wikiID.
FILTER (regex(?wikiID, "(\\W|^)World(\\W|$)","i")) .
}
ORDER BY ?wikiID
limit 50
''')
queryResult = sparql.query().convert()
print json.dumps (queryResult, indent= 2, separators=(',',':'))
但没有结果回来。在
^{pr2}$在http://dbpedia.org/sparql上,查询正常,错误在哪里?在
这就是解决办法
相关问题 更多 >
编程相关推荐