I have this code:
G, result = gds.graph.project(
"communities", # Graph name
"__Entity__", # Node projection
{
"_ALL_": {
"type": "*",
"orientation": "UNDIRECTED",
"properties": {"weight": {"property": "*", "aggregation": "COUNT"}},
}
},
)
And I want to port this to gds.graph.cypher.project. So far I did this:
G, result = gds.graph.cypher.project(
"""
MATCH (n:__Entity__)--(m:__Entity__)
WHERE n.node_embedding IS NOT NULL
AND m.node_embedding IS NOT NULL
AND n.docID = $doc
AND m.docID = $doc
RETURN gds.graph.project($graph_name, n, m,
{
sourceNodeLabels: $label,
targetNodeLabels: $label,
sourceNodeProperties: n { .weight },
targetNodeProperties: m { .weight }
},
{
undirectedRelationshipTypes: ['*']
})
""",
database='neo4j',
graph_name='communities',
label='__Entity__',
doc='Gasification'
)
But I'm stuck since my nodes don't have the weight property. I'm not sure if in the initial code the weights are calculated temporarily so they are used for the aggregation. Any help will be greatly appreciated.