VB.NET 中带有节点标签的 Neo4j 批量插入

Neo4j Batch Insert with node Labels in VB.NET

我有一个现有数据库,其中节点标记为“人”并发布此批量插入有效(例如,节点显示属性),但未将节点标记为 "Person"

[{"method":"POST","to":"/node","body":{"RN":"2","fullname":"Herman Allen Slumpff","surname":"Slumpff", 
"name":"Herman Allen","sex":"M","union_id":"309","mn":"1","bd":"19161207","dd":"19901127", 
"bp_id":"56","dp_id":"4441"},"ID":0}]

其实用这个方法我可以迭代很多节点,快速插入。但是,它们是未标记的笔记。

Neo4j 文档建议下面的请求应该有效,但它不起作用:

[{"method":"POST","to":"/node","body":{"RN":"2","fullname":"Herman Allen Slumpff", 
"surname":"Slumpff","name":"Herman Allen","sex":"M","union_id":"309","mn":"1","bd":"19161207","dd":"19901127", 
"bp_id":"56","dp_id":"4441","ID":0},{"method":"POST","to":"{0}/labels","body":"Person"}]

我正在使用 Neo4j 2.1.6。也许存在版本控制问题?

WebException 错误:远程服务器返回错误:(500) 内部服务器错误。

7

{
  "message" : "Unexpected character ('{' (code 123)): was expecting double-quote to start field name\n  
  at [Source: org.eclipse.jetty.server.HttpConnection$Input@1ffc119{HttpChannelOverHttp@1de8fe8 
  {r=2,a=DISPATCHED,uri=/db/data/batch},HttpConnection@b9f35c{FILLING},g=HttpGenerator{s=START}, 
   p=HttpParser{s=END,280 of 280}}; line: 1, column: 230]",
  "exception" : "JsonParseException",
  "fullname" : "org.codehaus.jackson.JsonParseException",
  "stacktrace" : [ "org.codehaus.jackson.JsonParser._constructError(JsonParser.java:1433)", 
  "org.codehaus.jackson.impl.JsonParserMinimalBase._reportError(JsonParserMinimalBase.java:521)", 
  "org.codehaus.jackson.impl.JsonParserMinimalBase._reportUnexpectedChar(JsonParserMinimalBase.java:442)",   
  "org.codehaus.jackson.impl.Utf8StreamParser._handleUnusualFieldName(Utf8StreamParser.java:1537)",   
  "org.codehaus.jackson.impl.Utf8StreamParser._parseFieldName(Utf8StreamParser.java:1227)",   
  "org.codehaus.jackson.impl.Utf8StreamParser.nextToken(Utf8StreamParser.java:495)", 
  "org.neo4j.server.rest.batch.BatchOperations.parseAndPerform(BatchOperations.java:152)", 
  "org.neo4j.server.rest.batch.NonStreamingBatchOperations.performBatchJobs(NonStreamingBatchOperations.java:49)", 
  "org.neo4j.server.rest.web.BatchOperationService.batchProcess(BatchOperationService.java:128)", 
  "org.neo4j.server.rest.web.BatchOperationService.performBatchOperations(BatchOperationService.java:77)", 
  "java.lang.reflect.Method.invoke(Unknown Source)", 
  "org.neo4j.server.rest.transactional.TransactionalRequestDispatcher.dispatch(TransactionalRequestDispatcher.java:139)", 
  "java.lang.Thread.run(Unknown Source)" ]
}

谢谢!

戴夫

您可能不小心将 "id":0 从 node-属性-body 外部移动到节点 属性 body 内部?然后 {0} 不能再引用作业 ID 0。

[{"method":"POST","to":"/node",
  "body":{"RN":"2","fullname":"Herman Allen Slumpff","surname":"Slumpff","name":"Herman Allen", 
  "sex":"M","union_id":"309","mn":"1","bd":"19161207","dd":"19901127","bp_id":"56","dp_id":"4441"},
  "id":0},
 {"method":"POST","to":"{0}/labels","body":"Person"}]

请尝试一下以确保安全。