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.

Getting Error in Louvain community detection algorithm

mochalla
Node Clone

My Query

CALL gds.louvain.stream({
nodeProjection: 'Provider',
relationshipProjection: {
REFERRED: {
type: 'REFERRED',
orientation: 'UNDIRECTED'
},
HEALTHCARE_PROVIDED_BY: {
type: 'HEALTHCARE_PROVIDED_BY',
orientation: 'UNDIRECTED'
}
},
graph:'cypher',
direction: 'UNDIRECTED',
concurrency: 4
})
YIELD nodeId, communityId
RETURN gds.util.asNode(nodeId).name AS Provider, communityId
ORDER BY communityId

 

Error I am getting:

Screenshot 2023-01-25 170808.jpg

Can anyone comment to solve this!

3 REPLIES 3

that is the incorrect syntax for that procedure. It is expecting a string for the first parameter that specifies the projected graph to execute the algorithm against. 

You need to create a map projection first. 
https://neo4j.com/docs/graph-data-science/current/management-ops/projections/graph-project/

then call the procedure https://neo4j.com/docs/graph-data-science/current/algorithms/louvain/

mochalla
Node Clone

Thank you @glilienfield .

I tried projecting with native graph. And then using louvian, but my question now is , how to set seedproperty and relationshipweightproperty?

After that, In this query, I see they used seedproperty.

CALL gds.louvain.stream('myGraph', { seedProperty: 'seed' })
YIELD nodeId, communityId, intermediateCommunityIds
RETURN gds.util.asNode(nodeId).name AS name, communityId, intermediateCommunityIds
ORDER BY name ASC

and here relationshipWeightProperty

CALL gds.louvain.stream('myGraph', { relationshipWeightProperty: 'weight' })
YIELD nodeId, communityId, intermediateCommunityIds
RETURN gds.util.asNode(nodeId).name AS name, communityId, intermediateCommunityIds
ORDER BY name ASC

Hello @mochalla 😊

CALL gds.louvain.stream(
    'myGraph', 
    {
        relationshipWeightProperty: 'weight', 
        seedProperty: 'seed'
    })
YIELD 
    nodeId, 
    communityId, 
    intermediateCommunityIds 
RETURN 
    gds.util.asNode(nodeId).name AS name, 
    communityId, intermediateCommunityIds 
ORDER BY name ASC

Regards,
Cobra