Calculate cloness centrality with Graph Database Service on all nodes and relationships

Hi all !
I try to run a closness centrality algorithm with the gds plug-in but I can't figure out how to make the query.
I have understood that the query needs a node and relationship projection to be run.
I have good results with this query for SYSTEM_VARIABLE nodes linked with STRUCTURAL_AND_OPERATIONAL_DEPENDENCY relationship:

CALL gds.alpha.closeness.stream({
  nodeProjection: 'SYSTEM_VARIABLE',
  relationshipProjection: 'STRUCTURAL_AND_OPERATIONAL_DEPENDENCY'
})
YIELD nodeId, centrality
RETURN gds.util.asNode(nodeId).name AS user, centrality
ORDER BY centrality DESC

But now I would like to perform this algorithm on all my nodes, whatever the relationships are.
How can I specify "all nodes" and "all relationship" in these projections ?
Thanks for your help.

You can use the * syntax to specify all nodes and all relationships:

CALL gds.alpha.closeness.stream({
  nodeProjection: '*',
  relationshipProjection: '*'
})
YIELD nodeId, centrality
RETURN gds.util.asNode(nodeId).name AS user, centrality
ORDER BY centrality DESC
1 Like

Thanks Alicia ! It's perfect