How to get all the edges with any starting from a node


In the Graph above, I want to pull out all the edge nodes which match different criteria.

Starting at the STEMI Team, I should be able to traverse all paths and match on specific conditions on the relationships.

FORWARDING_TO and SCHEDULED_FOR are relationships which are datetime driven, so they should be traversed only when they have the datetime properties that should fall within the current time.

Inactive paths should not be traversed

So the result should be Hans, Erik( If the relationships times match), Ravi Kotha
How do I achieve this?

Try with:
apoc.path.subgraphAll or apoc.path.spanningTree

1 Like

Thanks for the direction, I seem to filter those nodes, but how do we extract only the edge nodes and not the path, also where do we specify the conditions on the relationship properties?

MATCH (p:TEAM {name: "STEMI Team"})
CALL apoc.path.subgraphAll(p, {
relationshipFilter: "ACTIVE>|FORWARDING_TO>|ATTENDED_BY>|NESTS>|SCHEDULED_FOR"
})
YIELD nodes, relationships
RETURN nodes;

I tried this, but does not seem to work:

WITH '2021-02-19' AS maxdate
MATCH (p:TEAM {name: "STEMI Team"})
CALL apoc.path.subgraphAll(p, {
relationshipFilter: "ACTIVE>|FORWARDING_TO>|ATTENDED_BY>|NESTS>|SCHEDULED_FOR"
})
YIELD nodes, relationships
WHERE ALL(r IN relationships WHERE r.forwardingEndTime < maxdate)
RETURN nodes;

forwardingEndTime exists only in the forwarding_to relationship.