Fortunately, closeness centrality is implemented as a standalone algorithm within GDS. We can directly get closeness centralities for each node with the following query:
CALL gds.alpha.closeness.stream("projected_graph_undirected_weight", {})
YIELD nodeId, centrality as score
RETURN gds.util.asNode(nodeId).name as nodeName, score
ORDER BY score DESC
Contrary to the other centrality algorithms we studied in this chapter, the return value of the closeness and betweenness centrality algorithms is called centrality (and not score).