Relationship Projection with bridge node

I am trying to write a configuration map for gds.wcc.write that goes through a bridge node, with specified relationships.

I think that I need cypher projection, because native projection didnt seem to be able to handle the jump, but potentially I am missing something.

Here is the schema, I need to identify all Equipment connected by a leg
Screen Shot 2021-03-25 at 4.56.10 PM

Here is what I have

    nodeQuery: "MATCH (n) WHERE n:Equipment OR n:Leg OR n:OPCODE RETURN id(n) as id",
	relationshipQuery: "MATCH (s:Equipment)-[r1:DRAINS]->(l:Leg)-[r2:FEEDS]->(t:Equipment) RETURN id(s) AS source, id(t) AS target, id(l) as leg, id(r1) as feed, id(r2) as prod"}

Originally I was connecting Equipment directly next to Equipment with a different relationship, but now I need to add this Leg in the middle of things. Originally I could just execute this:

CALL gds.wcc.write({nodeProjection: "Equipment", relationshipProjection: "CONNECTS_TO",writeProperty: "community_id"}

Thanks for any help!

Actually I think that this did what I was looking for!

CALL gds.wcc.write({nodeProjection: ["Equipment", "Leg"], relationshipProjection: ["FEEDS", "DRAINS"],writeProperty: "community_id"})

It doesn't really specify the order of the connection though, so I am not sure if its 100% correct.

Hello Keith,

This will indeed create a projection with all your :Equipment and :Leg nodes, with the FEEDS and DRAINS relationships between them.

As for the orientation, this is configurable, and it maintains the original orientation by default. See the docs here.
This parameter only allows you to define the relationship orientation to its original orientation, or reverse it, or add both directions ; if you need a filter like "I only want the FEEDS rels that go from a Leg to an Equipment", then Cypher projection is the way to go. If you relationship is uni-directional anyway, then your solution is the right one.

Cheers !