在尝试删除三元组时,我收到以下错误:
MALFORMED QUERY: Encountered " "delete" "DELETE
Was expecting one of:
"base" ...
"prefix" ...
"select" ...
"construct" ...
"describe" ...
"ask" ...
我的疑问是:
DELETE {
?s example:id 'Id' .
};
芝麻与Jetty是我正在使用的。我发送了一个HTTP请求。我还有另一个问题围绕这个
开启delete rest api to remove statements from global context
我可能会发送到错误的端点。我的端点看起来像:
http://example.com/openrdf-sesame/repositories/ $回购/
请帮忙。
编辑:
self.baseURLRepositories = storeUrl + "/openrdf-sesame/repositories/"
endpoint = self.getBaseURLForSesameRepositories() + "%s" % (self.getRepository())
params = { 'query': query }
headers = {
'content-type': 'application/x-www-form-urlencoded',
'accept': 'application/sparql-results+json'
}
(response, content) = httplib2.Http().request(endpoint, 'POST', urllib.urlencode(params), headers=headers)
results = json.loads(content)
其中query = DELETE ...
答案 0 :(得分:0)
您使用的端点位置不正确。 SPARQL更新请求应发送到openrdf-sesame/repository/<repid>/statements
。