Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/source/integration.rst
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ In this small example, we import a graph from a Neo4j query result.

.. code-block:: python

from neo4j import GraphDataScience
from neo4j import GraphDatabase, RoutingControl, Result
from neo4j_viz.gds import from_gds

# Modify this to match your Neo4j instance's URI and credentials
Expand All @@ -196,6 +196,7 @@ In this small example, we import a graph from a Neo4j query result.
result = driver.execute_query(
"MATCH (n)-[r]->(m) RETURN n,r,m",
database_="neo4j",
routing_=RoutingControl.READ,
result_transformer_=Result.graph,
)

Expand Down
7 changes: 5 additions & 2 deletions examples/neo4j-example.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,6 @@
"source": [
"import os\n",
"\n",
"from neo4j import GraphDatabase, Result\n",
"\n",
"URI = os.environ.get(\"NEO4J_URI\", \"bolt://localhost:7687\")\n",
"\n",
"auth = None\n",
Expand All @@ -68,6 +66,8 @@
"metadata": {},
"outputs": [],
"source": [
"from neo4j import GraphDatabase\n",
"\n",
"with GraphDatabase.driver(URI, auth=auth) as driver:\n",
" driver.verify_connectivity()\n",
" driver.execute_query(\n",
Expand Down Expand Up @@ -130,12 +130,15 @@
"metadata": {},
"outputs": [],
"source": [
"from neo4j import Result, RoutingControl\n",
"\n",
"with GraphDatabase.driver(URI, auth=auth) as driver:\n",
" driver.verify_connectivity()\n",
"\n",
" result = driver.execute_query(\n",
" \"MATCH (n)-[r]->(m) RETURN n,r,m\",\n",
" database_=\"neo4j\",\n",
" routing_=RoutingControl.READ,\n",
" result_transformer_=Result.graph,\n",
" )\n",
"\n",
Expand Down