Timelime graph modeling

Hello. guys
I'm newbie in graph. I'm trying to make event timeline graph.

the CSV file has columns like this

eventId , dateTime(ISO8601), timeType(create / modify / delete / etc), eventType, eventValue, sub values, sourceFile ...

and I want to make my graph with the above CSV like this..

(eventId)-[HAS_TIME]-(DateTime)-[HAS_TIMEATTR}-(timeType)
(eventId)-[HAS_TYPE]-(eventType)-[HAS_VALUE]-(eventValue)-[HAS_SUBVALUE]-(subValues 1, 2, 3..)

I wanted my graph to be 'path' but they comes out the shape of 'Trees' which have null node chains..

I wonder. that modeling is possible.. if then how to do..

Best Regards.

image

Hi @giannisong

This is my sample data.

"eventId","dateTime","timeType","eventType","eventValue","subValues"
10,"2024-04-20T10:50:35.556+0100","create","a",11,1
20,"2024-04-21T10:50:35.556+0100","modify","b",22,2
30,"2024-04-22T10:50:35.556+0100","modify","c",33,3
40,"2024-04-23T10:50:35.556+0100","modify","d",44,4
50,"2024-04-24T10:50:35.556+0100","delete","e",55,5

Cypher

LOAD CSV WITH HEADERS FROM 'file:///sample1.csv' AS row
CREATE (e:EventId {id: row.eventId})-[:HAS_TIME]->(:DateTime {datetime: datetime(row.dateTime)})-[:HAS_TIMEATTR]->(:TimeType {type: row.timeType})
CREATE (e)-[:HAS_TYPE]->(:EventType {type: row.eventType})-[:HAS_VALUE]->(:EventValue {value: row.eventValue})-[:HAS_SUBVALUE]->(:SubValues {value: row.subValues});

Is this the answer you were hoping for?

1 Like

Thank you. gentleman

Your cypher works!!
I used merge / set syntax. but it has error
I think I have to study more.

Thanks again!! Have a good one.