我正在使用SPARQLWrapper,并且我正在遵循文档。下面是我的代码:
queryString = "SELECT * WHERE { ?s ?p ?o. }"
sparql = SPARQLWrapper("http://example.org/sparql")# I replaced this line with
sparql = SPARQLWrapper("file:///thelocation of my file in my computer")
sparql.setQuery(queryString)
try :
ret = sparql.query()
# ret is a stream with the results in XML, see <http://www.w3.org/TR/rdf-sparql-XMLres/>
except :
deal_with_the_exception() 我收到以下两个错误: 1-系统找不到指定的路径2- NameError:未定义名称'deal_with_the_exception‘
发布于 2020-06-10 04:16:47
您需要一个SPARQL端点才能使其工作。考虑在本地计算机上设置Apache Fuseki。请参阅https://jena.apache.org/documentation/fuseki2/jena
https://stackoverflow.com/questions/62289450
复制相似问题