cancel
Showing results for 
Search instead for 
Did you mean: 

Join the community at Nodes 2022, our free virtual event on November 16 - 17.

Is it possible to construct a graph model using Padgett's data on marriage ties using Neo4j?

Kevin6482
Node Clone

I was just wondering whether it is possible to construct a graph model using Florentine Families dataset in Neo4j using below image. Relationship type and direction( which are mandatory in neo4j graph model) were missing in this data, only family nodes are provided. Is there a way to construct a graph model? (Please refer below image).

3X_4_8_486cc5e6cabed026f66709e719fadaf4e9e30059.jpeg

1 ACCEPTED SOLUTION

Cobra
Ninja
Ninja

You could create Person nodes and undirected KNOWS relationships. To created undirected relationships, you just need to don't specify a direction and that's all.

Little example to create two nodes:

MERGE (:Person {name: "PAZZI", eid: 0})
MERGE (:Person {name: "SALVIATI", eid: 1})

Little example to create one relationship:

MATCH (a:Person {eid: 0}), (b:Person {eid: 1})
MERGE (a)-[:KNOWS]-(b)

After you could use a cypher projection and GDS Centrality Algorithms to get the information you want.

I hope it helps you to get you started

Regards,
Cobra

View solution in original post

5 REPLIES 5

Cobra
Ninja
Ninja

Hello @Kevin6482

I'm not sure about what you would like to get as result?

Regards,
Cobra

@Cobra Thanks for responding. I would like to construct a graph model and compute the centrality measures for each node (Degree Centrality, Betweenness Centrality, Closeness Centrality, etc).

Cobra
Ninja
Ninja

You could create Person nodes and undirected KNOWS relationships. To created undirected relationships, you just need to don't specify a direction and that's all.

Little example to create two nodes:

MERGE (:Person {name: "PAZZI", eid: 0})
MERGE (:Person {name: "SALVIATI", eid: 1})

Little example to create one relationship:

MATCH (a:Person {eid: 0}), (b:Person {eid: 1})
MERGE (a)-[:KNOWS]-(b)

After you could use a cypher projection and GDS Centrality Algorithms to get the information you want.

I hope it helps you to get you started

Regards,
Cobra

Many thanks @Cobra. I created the graph model and also created a named graph with orientation : UNDIRECTED to compute measures of centrality (please correct me if I'm wrong).

Good job, I don't see anything wrong

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit - November 16 - 17, 2022.


Free NODES Training Series


October 19th -

Intro to Neo4j


October 20th -

Healthcare Analytics Using Neo4j


October 25th -

Handling Neo4j data with Apache Hop


October 26th -

Blazing Fast Graphs: Hands-on with Apache Arrow and Neo4j


November 2nd -

Graph EDA Using the Neo4j GDS Client