Skip to content

Commit

Permalink
refactor: updated examples to compare objects
Browse files Browse the repository at this point in the history
  • Loading branch information
anubhuti24 committed Apr 25, 2024
1 parent f67dcc1 commit c25d4bd
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions examples/pythonic_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,13 @@ def main(url, token):
)
logging.info(graph.visualize_graph(kg))

# Personal Graph to NetworkX
networkx = to_networkx(graph, post_visualize=True)
logging.info("Personal Graph to NetworkX Graph")
logging.info(networkx)

# NetworkX to Personal Graph
personal_graph = from_networkx(networkx, post_visualize=True, override=False)
logging.info("NetworkX Graph to Personal Graph")
logging.info(personal_graph)
# Transforms to and from networkx do not alter the graph
g2 = from_networkx(
to_networkx(graph, post_visualize=True), post_visualize=True, override=False
)
if graph == g2:
logging.info("TRUE")
assert graph == g2

graph.save()

Expand Down

0 comments on commit c25d4bd

Please sign in to comment.