我尝试使用其余API的批处理终结点插入带有标签的节点。
我点击的网址是:http://localhost:7474/db/data/batch
有效载荷是
[{"body": {"ConceptId": "78890", "Name": "This is a node"}, "to": "/node", "method": "POST"}, {"body": "Moo", "to": "{0}/labels", "method": "POST"}]
500响应机构是:
<html><head><title>Error</title></head><body><p><pre>Illegal character in path at index 2: ./{0}/labels</pre></p><p><pre>IllegalArgumentException
at java.net.URI.create(URI.java:859)
at java.net.URI.resolve(URI.java:1043)
at org.neo4j.server.rest.batch.BatchOperations.calculateTargetUri(BatchOperations.java:104)
at org.neo4j.server.rest.batch.BatchOperations.performRequest(BatchOperations.java:193)
at org.neo4j.server.rest.batch.BatchOperations.parseAndPerform(BatchOperations.java:171)
at org.neo4j.server.rest.batch.NonStreamingBatchOperations.performBatchJobs(NonStreamingBatchOperations.java:48)
at org.neo4j.server.rest.web.BatchOperationService.batchProcess(BatchOperationService.java:126)
at org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:76)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)
at java.lang.Thread.run(Thread.java:724)</pre></p></body></html>
据我所知,根据Neo4j documentation和StackOverflow question等来源,语法是正确的。
有人可以帮忙吗?我使用的是2.1.2,如果相关的话。
答案 0 :(得分:2)
大卫,
您缺少第一个操作的作业ID。试试这个:
[{"id":0, "body": {"ConceptId": "78890", "Name": "This is a node"}, "to": "/node", "method": "POST"}, {"body": "Moo", "to": "{0}/labels", "method": "POST"}]
如果第一个操作没有&#34; id&#34;:0,则第二个操作中的{0}无法解除引用。
恩典与和平,
吉姆