Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
02-17-2021 09:00 PM
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?
02-17-2021 11:22 PM
Try with:
apoc.path.subgraphAll or apoc.path.spanningTree
02-18-2021 06:11 AM
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.
All the sessions of the conference are now available online