Let's see some key usages; others will be seen in dedicated chapters, such as Chapter 8, Importing data into Neo4j.
First, we need to grant permissions to the APOC functions and procedures, so we need to add the following line to the end of the conf/neo4j.conf
file; otherwise, we would get an error message like this one--apoc.algo.pagerank
is not available due to having restricted access rights, check configuration:
dbms.security.procedures.unrestricted=apoc.*
Well, not so random graph generators, for there is an algorithm to choose and parameters to input. I call it random because it's meaningless:
CALL apoc.generate.ba(1000, 2, 'Person', 'FRIEND_OF')
This example uses the Barabasi-Albert (ba) model to generate a thousand nodes with the label Person
that have two FRIEND_OF
relations. As Person
is a common label, each node will have a name property, which looks as follows, added automatically:
A lot of friends, connected
Be aware that this can create...