cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Need help setting up graph projection for GDS community detection algorithm

andy_hegedus
Graph Fellow

Hi,
Newbie - here.
Attached is the schema I am working on. I have been working on community detection algorithms focusing on the patent nodes and how they are connected. That seems to be going well.
The extension I am working on now is looking how the cpc nodes cluster to the patent nodes.
Each patent will have at least 1 and often several (5-10) Classified_as relationships with various cpc nodes. I am interested in seeing if there are clusters of cpc nodes that are often attached to a patent.
3X_d_e_de5f19d1eca59a37bb58990f5230fb95c7e9dfb0.png

The first thing I am working on is creating the appropriate graph projection in gds and this is where I think I am going wrong. Here is my starting point. Note: the validateRelationships was added because I was getting an error on a node and was suggested it.

call gds.graph.create.cypher('test3',
'MATCH (a:cpc) return id(a) as id',
'MATCH (:company{name:"name1"})-[:Assigned_to]-(b:patent)-[:Classified_as]-(a:cpc) return id(a) AS source, id(b) AS target',{validateRelationships:FALSE});

A graph is created but without any relationships

So I don't think I am going down the right path. What guidance is there to do this analysis?
Andy

1 REPLY 1

Hello @andy.hegedus

CALL gds.graph.create.cypher(
    "test3",
    "MATCH (n) WHERE n:cpc OR n:company OR n:patent RETURN id(n) AS id, labels(n) AS labels",
    "MATCH (:company {name: 'name1'})<-[:Assigned_to]-(b:patent)-[:Classified_as]->(a:cpc) return id(a) AS source, id(b) AS target",
    {validateRelationships: FALSE})
)

Regards,
Cobra