In Chapter 4, The Graph Data Science Library and Path Finding, we introduced the write feature of the GDS, allowing us to store the results of an algorithm in Neo4j. This feature is available for almost all algorithms implemented in the GDS. Basically, the algorithms that do not offer this option are the algorithms returning matrices, such as the All Pairs shortest path algorithms or the some similarity algorithms we are going to cover at the end of this chapter.
Let's see an application of the write procedure with the connected components algorithms.
The syntax of the write procedure is pretty similar to the stream one. The main difference is that it accepts another configuration parameter, writeProperty, which allows us to configure the name of the property that will be added to each node.
The following query will write the result of the weakly connected component algorithm into a wcc property for each node:
CALL gds.wcc.write(
"...