Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
10-12-2018 08:31 AM
I have many groups in my graph , but I want to display only those which worked together more than n times .
And here is an example :
Solved! Go to Solution.
10-16-2018 02:43 AM
Apoc can be installed manually on the community version I'm fairly certain.
You'll you need to download the various apoc jars and copy them to the correct location and re-start Neo4j.
10-12-2018 09:51 AM
I am not quite sure what you are asking but ...
If you load the sample data in this article https://medium.com/@paul13thomas/graph-analytics-of-shareholder-data-6f6b5333bd1c then install apoc and use apoc's unionFind to find the clusters ...
CALL algo.unionFind(
'match (n) return id(n) as id',
'match (n1:Person)--(n2) return id(n1) as source, id(n2) as target',
{graph:'cypher', write:true, partitionProperty:"clusterId"})
YIELD nodes, setCount, loadMillis, computeMillis, writeMillis;
then to only show the big clusters run
match (n1)
with n1.clusterId as clusterId, count(n1) as clusterSize
where clusterSize > 10
match (n2) where n2.clusterId = clusterId
return n2
That will only bring back 1 cluster which has 15 nodes.
So a similar query to count the number of relationships
match (n1)-[r]-()
with n1.clusterId as clusterId, count(distinct r) as numberOfRels
where numberOfRels > 10
match (n2) where n2.clusterId = clusterId
return n2
again will only show the large cluster.
This would seem to work if this is what you are looking to do ...
10-15-2018 12:52 AM
I will try it and let you know . Btw there is no access to the link ! I am having 404 not found when I open it
10-15-2018 01:16 AM
I am using community version , I cannot apply the clustering algo !
10-15-2018 04:45 AM
What if I use this query ?
match (n1:attribfxplaf)-[r]-()
with n1.clusterId as clusterId, count(n1) as clusterSize,count(distinct r) as numberOfRels
where clusterSize > 10 AND numberOfRels > 10
match (n2) where n2.clusterId = clusterId
return n2,clusterId
10-16-2018 05:54 AM
yes that looks like it should work ...
10-16-2018 06:12 AM
Thanks Paul ! It works yes 🙂
10-16-2018 02:43 AM
Apoc can be installed manually on the community version I'm fairly certain.
You'll you need to download the various apoc jars and copy them to the correct location and re-start Neo4j.
02-17-2020 06:49 AM
Hello Paul!
I have read the Medium article and I foun it very helpful.
However, I would like to know one thing.
In the example, for plotting the relations between compnay and persons (the two labels) we have to write all the relations. Here you have it:
(p1)-[:OWNER {holding:45}]->(c1)<-[:OWNER {holding:55}]-(p2),
(p2)-[:OWNER {holding:70}]->(c2)<-[:OWNER {holding:30}]-(p3),
(p3)-[:OWNER {holding:60}]->(c3)<-[:OWNER {holding:40}]-(p1)
I was wondering if it could be possible to, instead of writting all this code, using a loop (foreach statement) as we could do with Python.
Thanks!!
All the sessions of the conference are now available online