cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

How to create graph projections from json file

eddylara0929
Node Link

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?? 

1 ACCEPTED SOLUTION

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.

View solution in original post

6 REPLIES 6

Hello @eddylara0929 🙂

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

Regards,

Cobra

Thanks I'll try it and comment later if result

@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

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

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!!!!