Open felix-boeseler opened 8 months ago
Uh oh! Looks like a bug to me. Your intuition is totally right, we should only be returning x
in your first example. Thank you for reporting!!
@khoale88 sorry to bug you, wondering if you have thoughts on this one — I think the issue is here:
On line 470, self._matches
is [{'n': 'x'}, {'n': 'y'}]
— so the issue is happening I guess at the pathwise where
filtering... wondering if you encountered anything like this while testing. I'm still poking at it and I'll report back here as I learn more!
Right, let me spend some time on this!
No pressure, but it would be super appreciated if you have time!! :)
I think there is an unexpected behavior in grandiso. After debugging, it drills down to grandiso.find_motif_iter yielding both x
and y
, Here is the test snippet.
def test_equijoins(self):
host = nx.DiGraph()
host.add_node("x")
host.add_node("y")
host.add_node("z")
host.add_edge("x", "y")
host.add_edge("y", "x")
host.add_edge("x", "x")
host.add_edge("z", "x")
motif = nx.DiGraph()
motif.add_edge("n", "n")
res = find_motifs(motif, host)
assert res == [{"n": "x"}]
The test fails with result
> assert res == [{"n": "x"}]
E AssertionError: assert [{'n': 'x'}, {'n': 'y'}] == [{'n': 'x'}]
E Left contains one more item: {'n': 'y'}
E Full diff:
E - [{'n': 'x'}]
E + [{'n': 'x'}, {'n': 'y'}]
What do you think?
Hello, thank you for the great project :)
In how far are equijoins exactly supported?
Given that I have the following NetworkX graph:
When I execute the following query:
I get the result:
However, if I execute the same query on the equivalent graph in neo4j, I only get the node x as result - which to my understanding of Cypher would be the correct result.
Therefore, to my understanding, equijoins are currently only supported in the project when they are distributed over multiple
match
clauses and do not recognizes self cycles on nodes. Is that correct?For instances, the following query correctly recognizes two loops in the graph:
While neo4j additionally returns n=x and m=x as a result.
Many regards, Felix