I am using Neo4j to implement a social network. The model of the timeline of a user is like the following.
A user can have two activities: Publish and Share, each is created as a node with corresponding labels. All activity nodes are connected through an edge with type NEXT one by one ordered by created time. The model is like:
(:User)-[:TIMELINE]->(:Publish)-[:NEXT]->(:Share)-[:NEXT]->(:Share)->[:NEXT]->(:Publish)->...
Now the problem is, when I want to fetch the nodes, I don't know how to perform queries according to the label of nodes.
For example, when the node is Publish, I have to do something; and when the node is Share, I have to do some other completely different stuff.
Is there a way to achieve this?