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.

Store communication notes between two people in a Relationship or a Node?

Hello. I'm a complete graph db newbie here. I am playing with keeping track of what I talk with my friends about. Here is an example of what I want to track and an idea of how to model it. How does this look? Thank you for any advice.

I called Dan. We talked about ABC.

  • what I would track in Neo4j:
    --I called Dan
    --description, or message: "We talked about ABC"
    --when this call took place

I texted Dan about 123.

  • what I would track in Neo4j:
    --I texted Dan
    --description, or message: "123"
    --when I texted Dan

I just remembered Dan is interested in learning photography.

  • what I would track in Neo4j:
    --Dan is interested in learning photography.
    --when this note was created

Julia called Sara.
-exploded: Julia placed a call on her phone to Sara.
--what I would track in Neo4j
---who communicated (Julia and Sara)
---when was the communication
---what was discussed (“XYZ“)

Julia told me she and Sara both talked on the phone about XYZ
-exploded: Julia spoke to me in person and conveyed that Julia placed a call on her phone to Sara and Julia and Sara both talked about XYZ
-what I would track in Neo4j
--who communicated (Julia and I)
--when was the communication
--what was discussed:
---Julia spoke to Sara on the phone
---when was the communication
---what Julia and Sara discussed ("XYZ")

One idea is…
Person: Me
Relationship: CALLED which will have a property 'notes' where I can write what we talked about.
Person: Dan

MATCH (a:Person),(b:Person)
WHERE a.full_name = “Me” AND b.full_name = "Dan Smith"
CREATE (a)-[r:CALLED{
node_created_timestamp: datetime(),
UUID: apoc.create.uuid(),
notes: “Dan “& I talked today about ABC"
}]->(b)
RETURN r

MATCH (a:Person),(b:Person)
WHERE a.full_name = “Me” AND b.full_name = "Dan Smith"
CREATE (a)-[r:TEXTED{
node_created_timestamp: datetime(),
UUID: apoc.create.uuid(),
notes: “I texted Dan about 123"
}]->(b)
RETURN r

2 REPLIES 2

shan
Graph Buddy

So for every communication between two people you will add a new edge between them?

Thanks for the reply. Yes, I think my model indicates every time I want to write down what a friend and I talked about, I would make a new relationship between my node and their node and use a property in that relationship to write what we spoke about.
I would be happy to hear any advice on that from folks with more experience.
Thank you