Skip to content
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

expand() doesn't connect duplicated nodes #32

Closed
oneilsh opened this issue Aug 5, 2024 · 0 comments · Fixed by #33
Closed

expand() doesn't connect duplicated nodes #32

oneilsh opened this issue Aug 5, 2024 · 0 comments · Fixed by #33
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@oneilsh
Copy link
Collaborator

oneilsh commented Aug 5, 2024

If given a query graph with duplicate nodes by id (for example, two instances of HP:0100775, but with a source_disease attribute added with values "eds" and "marfan"), then expand() will only expand edges from one of them; it should do all.

The reason is because expand() (for both file engines and neo4j engines) uses tidygraph's graph_join() to join the query graph with the fetched result graph, and graph_join() does not add such edges (nor will it even when joining graphs with exactly duplicate nodes).

To fix this I propose adding a kg_join() function as a more-expansive version of tidygraph's graph_join() which replicates any edges (according to id) across all node pairs in the node and edge data, and using that in expand(). This would be a useful function anyway when working with more advanced use cases.

@oneilsh oneilsh added bug Something isn't working enhancement New feature or request labels Aug 5, 2024
@oneilsh oneilsh self-assigned this Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant