我正在使用Neo4j rest api创建一个具有更多节点和关系的图结构。我使用以下密码查询格式在单个发布请求中发送一批节点及其关系。通过Neo4j rest api发送的数据不会持久
UNWIND [[0,1], [0,6309]] AS pair
MATCH (n {name: pair[0]}), (m {name: pair[1]})
CREATE (n)-[:X]->(m)
我从1GB大小的文件中读取数据,并上传数据分批到Neo4j的。我发送的所有请求的响应码为200,但当我检查{$NEO4J_HOME}/data/databases/graph.db
大小时,它只显示244K大小。 graph.db中的du -hc *store.db*
命令显示所有nodestore.db,relationshipstore.db和propertystore.db大小均为0.为什么通过rest api上载的数据没有写入图形DB中的文件?任何帮助将不胜感激。从du -hc *store.db*
0 neostore.nodestore.db
4.0K neostore.nodestore.db.id
8.0K neostore.nodestore.db.labels
4.0K neostore.nodestore.db.labels.id
0 neostore.propertystore.db
8.0K neostore.propertystore.db.arrays
4.0K neostore.propertystore.db.arrays.id
4.0K neostore.propertystore.db.id
8.0K neostore.propertystore.db.index
4.0K neostore.propertystore.db.index.id
8.0K neostore.propertystore.db.index.keys
4.0K neostore.propertystore.db.index.keys.id
0 neostore.relationshipstore.db
输出这是发送使用球衣客户端的Neo4j REST API完整的请求。
Client client = Client.create();
client.addFilter(new HTTPBasicAuthFilter(user, password));
WebResource cypherResource = client.resource("http://localhost:7474/db/data/cypher");
ClientResponse cypherResponse = cypherResource.accept(MediaType.APPLICATION_JSON)
.type(MediaType.APPLICATION_JSON_TYPE).entity(query).post(ClientResponse.class);
样品查询设置为实体:
{"query":"UNWIND [[0,1], [0,6309]] AS pair
MATCH (n {name: pair[0]}), (m {name: pair[1]}) CREATE (n)-[:X]->(m)"}
向我们展示发送给Neo4j的完整查询(方法,路径,标头,正文)。也许你从不承诺交易? –
我已经用发送给Neo4j的完整查询更新了问题。谢谢你的帮助。 – sathya