0
votes

I am creating a text file to then Bulk insert into Neo4j. This is working EXCEPT the nodes are not labeled. The file I am loading has this text:

[{"method":"POST","to":"/node","body":{"ICD9":"79409","NodeType":"Dx","ID":2},"metadata":{"labels":["Dx"]}}]

What should it look like to create the label "Dx"?

I can use set after creating the nodes but this is slow and may time out.

1

1 Answers

1
votes

According to the docs of the Neo4j REST API, there's no direct way to create a node with label(s). Since you're already using batches, it's fairly simple to add another call for adding a label to your request:

[
    {
        "method":"POST",
        "to":"/node",
        "id": 0,
        "body":{"ICD9":"79409","NodeType":"Dx","ID":2}
    },
    {
        "method":"POST",
        "to":"{0}/labels",
        "id": 1,
        "body": "Dx"
    }    
]

Since you've already put a label on the node, consider omitting the NodeType property - it seems to be redundant.