Skip to content

Commit b7b31e7

Browse files
committed
feat: distance neo4j query
1 parent cdd4616 commit b7b31e7

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

‎src/neo4j-quickstart/quickstart.ipynb‎

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,20 @@
142142
" \"user_list\": [\"yousra-elbachir\", \"Victor2175\", \"williamaeberhard\"]\n",
143143
"}\n",
144144
"users_and_their_repos = downloader.run_custom_query(repos_of_users_query, parameters)\n",
145-
"print(\"RESULTS: users and their repositories: \", users_and_their_repos)"
145+
"print(\"RESULTS: users and their repositories: \", users_and_their_repos)\n",
146+
"\n",
147+
"# QUERY : Get the shortest paths between 2 organizations\n",
148+
"\n",
149+
"distance_orgs_query= \"\"\"\n",
150+
"MATCH (o1:org {name: \"DeepLabCut\"}), (o2:org {name: \"bethgelab\"})\n",
151+
"MATCH p = shortestPath((o1)-[*]-(o2))\n",
152+
"RETURN\n",
153+
" p AS full_path,\n",
154+
" nodes(p)[1..-1] AS nodes_in_between,\n",
155+
" length(p) AS number_of_hops;\n",
156+
"\"\"\"\n",
157+
"distance_orgs = downloader.run_custom_query(distance_orgs_query, parameters)\n",
158+
"print(\"RESULTS: shortest paths between organizations: \", distance_orgs)"
146159
]
147160
},
148161
{

0 commit comments

Comments
 (0)