neo4j / graph-data-science

Source code for the Neo4j Graph Data Science library of graph algorithms.
https://neo4j.com/docs/graph-data-science/current/
Other
597 stars 157 forks source link

Mutate properties on subgraph projection #207

Closed tomasonjo closed 2 years ago

tomasonjo commented 2 years ago

GDS version: 2.1.3 (desktop downloaded it even though it's not on GH yet) and also 2.1.2 Neo4j version: 4.4.8 Operating system: Ubuntu 20.04

Steps to reproduce the behavior:

Create graph:

CREATE (n1:Node), (n2:Node), (n3:Node)
CREATE (n1)-[:REL]->(n2);

Project graph:

CALL gds.graph.project('test', 'Node', 'REL')

Run WCC

CALL gds.wcc.mutate('test', {mutateProperty:'wcc'})

Subgraph projection:

CALL gds.beta.graph.project.subgraph('lg', 'test', 'n.wcc=0', '*')

Mutate degree:

CALL gds.degree.mutate('lg', {mutateProperty:'outdegree'})

Drop subgraph:

CALL gds.graph.drop('lg')

Project the subgraph again:

CALL gds.beta.graph.project.subgraph('lg', 'test', 'n.wcc=0', '*')

Inspect node properties:

CALL gds.graph.list('lg')

this returns ->

"Node": { "wcc": "Integer (DefaultValue(-9223372036854775808), TRANSIENT)", "outdegree": "Float (DefaultValue(NaN), TRANSIENT)" } }

The outdegree mutated property shouldn't be there as the outdegree was ran on the subgraph projection lg and not the original graph test. Tested it also on GDS 2.0.1 that is sandbox, and there is no problem there.

tomasonjo commented 2 years ago

error persists in 2.1.4

soerenreichardt commented 2 years ago

Hello @tomasonjo, thanks for raising this, it was indeed a bug that was hiding for a long while and appeared because we changed how we compute the graph store schema. It should be fixed with the next release.