cancel
Showing results forΒ
Did you mean:Β

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

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).

1 ACCEPTED SOLUTION
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

5 REPLIES 5
Ninja

Hello @Kevin6482

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

Regards,
Cobra

Node Clone

@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).

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

Node Clone

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

Neo4j Resources