How to create graph projections from json file

Hello everyone!!

I'm looking for a way to resolve this problem. I need run graph algorithms on a graph that is in json format, like this (not the real, but similar):

{

nodes: [

 {

   \_\_id: "some\_id",

   type: "NodeType",

  inE: \["node\_id1", "node\_id2", .....\],

  outE: \["node\_id100", "node\_id200", .....\]

 }, 

.......

]

}

The trouble is that I can't save this graph in Neo4j storage, is only for calculation. So my question, there is a way to create a Graph Projection from this json file??

@Cobra answer is valid for create graph, but i'm still facing issue of create a Graph Data Science graph projection for this virtual graph, as i need run GDS algorithms on this virtual graph

Hello @eddylara0929 :slightly_smiling_face:

You should have a look at Virtual Graph from the APOC plugin.

Regards,

Cobra

Thanks I'll try it and comment later if result

You can try the graph construct method in the python client: https://neo4j.com/docs/graph-data-science/current/python-client/graph-object/#_constructing_a_graph

You'd need to map your json to the correct pandas dataframe formatting, but that will let you convert your json file directly into a graph projection.

Thanks!!! This work!!!!

Can you share the JSON file and the query you used to create the virtual graph?