cytoscape / ipycytoscape

A Cytoscape Jupyter widget
https://ipycytoscape.readthedocs.io/en/master/
BSD 3-Clause "New" or "Revised" License
265 stars 62 forks source link

added add_graph_from_neo4j method and example notebook #245

Closed pwrose closed 3 years ago

pwrose commented 3 years ago

Simplified code and run black.

pwrose commented 3 years ago

Regarding tests, the example notebook is probably the best I can come up with. The problem with testing this functionality is that a running Neo4j Graph Database is required. The example notebook connects to our COVID Neo4j database. The repo https://github.com/sbl-sdsc/neo4j-ipycytoscape runs an instance of the Neo4j database on the Pangeo binder (doesn't work on mybinder.org because of blocked ports), but that cannot be integrated with this repo.

marimeireles commented 3 years ago

Don't worry about dealing with the conflicts if you don't want to, I can deal with them once the review is done :)

marimeireles commented 3 years ago

I can also finish this PR if @ianhi and @pwrose are okay :)

pwrose commented 3 years ago

@marimeireles please go ahead and finish this PR. Let me know if you have any questions. Thanks!

marimeireles commented 3 years ago

I think the neo4j example is not working anymore? @pwrose

I can't make it work locally. It gets stuck in the following cell:

graph = Graph("bolt://132.249.238.185:7687", user="reader", password="demo")

I can't access the logs, but I suppose it's the same issue. You have any ideas of what's up with this address?

pwrose commented 3 years ago

Our COVID-19-Net database update got stuck last night. It should work again.

From: Mariana Meireles @.> Reply-To: QuantStack/ipycytoscape @.> Date: Wednesday, April 21, 2021 at 4:40 AM To: QuantStack/ipycytoscape @.> Cc: Peter Rose @.>, Mention @.***> Subject: Re: [QuantStack/ipycytoscape] added add_graph_from_neo4j method and example notebook (#245)

I think the neo4j example is not working anymore? @pwrosehttps://urldefense.com/v3/__https:/github.com/pwrose__;!!Mih3wA!WcTo10cNgjCn8saOUfodh5s2wblEcL49niIPyGF6jpwqKcIjU94rG9OX2OtWxqI$

I can't make it work locally. It gets stuck in the following cell:

graph = Graph("bolt://132.249.238.185:7687", user="reader", password="demo")

I can't access the logs, but I suppose it's the same issue. You have any ideas of what's up with this address?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/QuantStack/ipycytoscape/pull/245*issuecomment-823994005__;Iw!!Mih3wA!WcTo10cNgjCn8saOUfodh5s2wblEcL49niIPyGF6jpwqKcIjU94rG9OX9zEdI6M$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AA53AEBWW53R7SIRRWKX3ILTJ22R7ANCNFSM4YMAZD6A__;!!Mih3wA!WcTo10cNgjCn8saOUfodh5s2wblEcL49niIPyGF6jpwqKcIjU94rG9OXV0d3Cv8$.

marimeireles commented 3 years ago

Funny, now I can load the graph locally but can't query it at all, I get stuck in this cell:

query1 = """
MATCH p=(:City{name:'San Francisco'})-[:IN*]->(:World) RETURN p
"""
subgraph1 = graph.run(query1).to_subgraph()

But apparently the CI can go further? But something goes wrong on the next query, because when it tries to use the graph queried it throws a NoneType error.

widget2.graph.add_graph_from_neo4j(subgraph2)

I'm thinking about removing this notebook from our tests because the server seems a bit unstable, but still keep it around so people can understand how to use the neo4j plug.

marimeireles commented 3 years ago

Thanks for the work @pwrose, the contribution and the patience for taking the time to create the PR and merge it :) Really appreciated, this is a really awesome addition!

pwrose commented 3 years ago

It’s a good idea to remove this notebook from the test. Our COVID database is under active development, so it’s not always available or data will be incomplete during our daily update around 7:00 – 10:00 UTC.

From: Mariana Meireles @.> Reply-To: QuantStack/ipycytoscape @.> Date: Thursday, April 22, 2021 at 2:39 AM To: QuantStack/ipycytoscape @.> Cc: Peter Rose @.>, Mention @.***> Subject: Re: [QuantStack/ipycytoscape] added add_graph_from_neo4j method and example notebook (#245)

Funny, now I can load the graph locally but can't query it at all, I get stuck in this cell:

query1 = """

MATCH p=(:City{name:'San Francisco'})-[:IN*]->(:World) RETURN p

"""

subgraph1 = graph.run(query1).to_subgraph()

But apparently the CI can go further? But something goes wrong on the next query, because when it tries to use the graph queried it throws a NoneType error.

widget2.graph.add_graph_from_neo4j(subgraph2)

I'm thinking about removing this notebook from our tests because the server seems a bit unstable, but still keep it around so people can understand how to use the neo4j plug.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://urldefense.com/v3/__https:/github.com/QuantStack/ipycytoscape/pull/245*issuecomment-824693790__;Iw!!Mih3wA!QC75OtFDPIaFV93qjSSy4EnA6Cwm9Jq5GFBeuCEl7uGcndCzxFg2UmfKD4F2of8$, or unsubscribehttps://urldefense.com/v3/__https:/github.com/notifications/unsubscribe-auth/AA53AEEQ27UN4R3CIMUTR7DTJ7VERANCNFSM4YMAZD6A__;!!Mih3wA!QC75OtFDPIaFV93qjSSy4EnA6Cwm9Jq5GFBeuCEl7uGcndCzxFg2UmfKzJ3OIVU$.