cancel
Showing results for 
Search instead for 
Did you mean: 

Update graph from json file.

Xhensila
Node

Hello guys

I have an existing graph database and a JSON file that gets updated daily. The update consists of new records being added or existing records that are updated and the file can have like thousands of records.  On each update of the JSON file, I have to understand: 

  • which of the records from the JSON has been updated and update the corresponding node on the graph
  • which of the records from the JSON are added and add these nodes on the graph.

So I think the main problem is how to understand which records are updated and added in the JSON file compared to the graph(take into consideration that we cant modify the structure of the JSON file)

Is there a way I can do this on Neo4j? Can you suggest some helpful materials that could help me solve this?

Thanks in advance

1 ACCEPTED SOLUTION

glilienfield
Ninja
Ninja

Personally, I would write a utility that takes the previous json and the current json and determine which nodes are new and which existing nodes have a property change. This should be very simple in Java using a json library, such as Jackson. 
The result of the utility is a new json file with only the new and changed nodes in it. You can import them using ‘merge’ so it handles new and existing nodes.

View solution in original post

2 REPLIES 2

glilienfield
Ninja
Ninja

Personally, I would write a utility that takes the previous json and the current json and determine which nodes are new and which existing nodes have a property change. This should be very simple in Java using a json library, such as Jackson. 
The result of the utility is a new json file with only the new and changed nodes in it. You can import them using ‘merge’ so it handles new and existing nodes.

Thank you for your answer. 

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.