Showing results for 
Search instead for 
Did you mean: 

How to project nodes properties with nodeProperties configuration?

Graph Buddy

I found "nodeProperties" parameter in configuration map is simpler way than node mapping method to project node properties. But it looks like used for monopartite graph not for multipartite. Can this configuration be used also to project the properties of multiple node labels?
Then please show me the cypher example like this monopartite example:

CALL gds.graph.create('my-graph', 'City', '*', {
nodeProperties: ['population', 'stateId']
YIELD graphName, nodeCount, relationshipCount;


I have just tested this with GDS 1.6.1 and these are the results. If you have multipartite graph and only a single label has the properties you want to project, then it won't work.

Example graph:

CREATE (t:Node{weight:1}), (t1:Node2)

Project the graph:

CALL gds.graph.create('test', ['Node', 'Node2'], '*', {nodeProperties:'weight'})

returns an error.

However if both node labels have that property, then it will work:

CREATE (t:Node{weight:1}), (t1:Node2{weight:5})

and create the graph:

CALL gds.graph.create('test', ['Node', 'Node2'], '*', {nodeProperties:'weight'})

I know that in general properties are different between node labels, so you can generalize that nodeProperties key doesn't work well with multipartite graphs.

Hope this answers your question

Thank you for the explanation. I got confirmed it from your answer.

Nodes 2022
NODES 2022, Neo4j Online Education Summit

On November 16 and 17 for 24 hours across all timezones, you’ll learn about best practices for beginners and experts alike.