-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Equijoins #38
Comments
Uh oh! Looks like a bug to me. Your intuition is totally right, we should only be returning |
@khoale88 sorry to bug you, wondering if you have thoughts on this one — I think the issue is here: grand-cypher/grandcypher/__init__.py Lines 434 to 463 in 31001b7
On line 470, |
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 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
The text was updated successfully, but these errors were encountered: