我經由燈泡使用的Neo4j的REST API,我試圖與所有相關的邊經由暗號一起刪除節點是這樣的:燈泡Neo4j的嵌入,並刪除在暗號
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-處理程序)。
...它似乎並沒有像那樣工作。長的錯誤報告如下:
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
我做錯了什麼?難道通過燈泡通過cypher-querys刪除節點是不可能的?
也不確定在其關係之前刪除節點是不會解析的。 – ulkas
只要它們在相同的刪除語句中,它就會。 –
你是對的 - 我運行版本1.7 ... – phynfo