Hello all, I have a use case wherein a process for resolving a issue is represented as graph. Below is the data which I have used.
Operator ID, Activity Done, path
14, enter, 1
12, open, 2
13, change, 3
14, update, 4
15, close, 5
16, view, 6
14, update, 7
11, Note, 8
I have used the below query:
LOAD CSV WITH HEADERS from "file:///C:/Process.csv" AS line
WITH collect(line.Operator ID
) AS ids, collect(line.Activity Done
) AS activities, collect(line.path) AS path
UNWIND ids AS id
MERGE (n:Operator {id: id})
WITH DISTINCT ids, activities, path
UNWIND range(0, size(ids)-1) AS i
WITH ids[i] AS a, ids[i+1] AS b, i, activities, path
WHERE a IS NOT null AND b IS NOT null
MATCH (n:Operator {id: a})
MATCH (m:Operator {id: b})
CALL apoc.merge.relationship(n, activities[i], {path: path[i]}, {path: path[i]}, m, {path: path[i]})
YIELD rel
RETURN rel
Output in Neo4j is as below:
My question is:
How can "only" the first node (in this case first node is Operator ID=14) and last node (in this case last node is Operator ID=11) have different colors , other nodes can have same color.
I have gone through K-1 Coloring algorithm, but it assigns different color to all nodes present. And I have also tried in neo4j bloom but there I had manually changed the color for a particular node but that is not I want.
Is this possible? How can we implement it in the given query so as to get different colors for just First & last Node?
The purpose for asking this question was to, Identify where the process starts & end by looking at the graph.
Thank you.
(P.S- Thanks @cobra for helping with the query)