A target node is the ending node of a directed relationship. Its counterpart is the source node, where the relationship begins. In Neo4j Graph Data Science, both nodes help define relationships loaded into an in-memory graph. section 5.2.1
Cypher projection identifies source and target nodes with a pattern such as MATCH (sourceNode)-[relationship]->(targetNode), then passes them to gds.graph.project. This can project existing relationships or define virtual connections while filtering or transforming the projected graph. section 6.1.1
Projecting retweet relationships
MATCH (source:User)-[:PUBLISH]->()-[:RETWEETS]->()<-[:PUBLISH]-(target:User) identifies users as source and target nodes. The query then projects source and target with a weight property, creating the named amplify graph. section 6.1.1
Listing 6.2 Cypher projection syntax
MATCH (sourceNode)-[relationship]->(targetNode) #1
RETURN gds.graph.project(
'graph', #2
sourceNode, #3
targetNode, #4
{dataConfig}, #5
{configuration} #6
) YIELD
graphName,
nodeCount,
relationshipCount
Use the syntax listing to trace how a directed relationship's sourceNode and targetNode become arguments to gds.graph.project. section 6.1.1
