我通过灯泡使用 neo4j 的 REST API,并尝试通过密码删除一个节点以及所有关联的边缘,如下所示:
from bulbs.neo4jserver import Graph as Neo4jGraph
db = Graph()
query = '''START d=node(57)
MATCH d-[r]-()
DELETE d,r
'''
t = db.cypher.execute(query)
(db
neo4j-database-Handler 在哪里)。
......它似乎并不像那样工作。一个长的错误报告如下:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/tobias/Esk/Dev/liquidDemocracyLight/venv/local/lib/python2.7/site-packages/bulbs/neo4jserver/cypher.py", line 31, in execute
return self.client.cypher(query, params)
File "/home/tobias/Esk/Dev/liquidDemocracyLight/venv/local/lib/python2.7/site-packages/bulbs/neo4jserver/client.py", line 403, in cypher
resp = self.request.post(path, params)
File "/home/tobias/Esk/Dev/liquidDemocracyLight/venv/local/lib/python2.7/site-packages/bulbs/rest.py", line 126, in post
return self.request(POST, path, params)
File "/home/tobias/Esk/Dev/liquidDemocracyLight/venv/local/lib/python2.7/site-packages/bulbs/rest.py", line 181, in request
return self.response_class(http_resp, self.config)
File "/home/tobias/Esk/Dev/liquidDemocracyLight/venv/local/lib/python2.7/site-packages/bulbs/neo4jserver/client.py", line 217, in __init__
self.handle_response(response)
File "/home/tobias/Esk/Dev/liquidDemocracyLight/venv/local/lib/python2.7/site-packages/bulbs/neo4jserver/client.py", line 249, in handle_response
response_handler(response)
File "/home/tobias/Esk/Dev/liquidDemocracyLight/venv/local/lib/python2.7/site-packages/bulbs/rest.py", line 36, in bad_request
raise ValueError(http_resp)
ValueError: ({'status': '400', 'content-length': '3989', 'content-encoding': 'UTF-8', 'server': 'Jetty(6.1.25)', 'access-control-allow-origin': '*', 'content-type': 'application/json'}, '{\n "message" : "expected return clause\\n\\" DELETE d,r\\"\\n ^",\n "exception" : "org.neo4j.server.rest.repr.BadInputException: expected return clause\\n\\" DELETE d,r\\"\\n
难道我做错了什么?是否可以通过灯泡通过密码查询删除节点?