How to project nodes properties with nodeProperties configuration?

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:
https://neo4j.com/docs/graph-data-science/current/management-ops/native-projection/

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

1 Like

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