|
109 | 109 | "cell_type": "markdown",
|
110 | 110 | "metadata": {},
|
111 | 111 | "source": [
|
112 |
| - "Next, we load this data (nodes and edges) into a Graph Database and a GDS graph." |
| 112 | + "Since this graph is very small, a straight-forward Cypher `UNWIND` query is the simplest way to create our graph in the database.\n", |
| 113 | + "\n", |
| 114 | + "Larger graphs may need a more sophisticated importing technique like batching, `neo4j-admin import` or Arrow `CREATE DATABASE`." |
113 | 115 | ]
|
114 | 116 | },
|
115 | 117 | {
|
|
145 | 147 | "\n",
|
146 | 148 | "# We can use convenience methods on `G` to check if the projection looks correct\n",
|
147 | 149 | "print(f\"Graph '{G.name()}' node count: {G.node_count()}\")\n",
|
148 |
| - "print(f\"Graph '{G.name()}' node labels: {G.node_labels()}\")" |
| 150 | + "print(f\"Graph '{G.name()}' node labels: {G.node_labels()}\")\n", |
| 151 | + "print(f\"Graph '{G.name()}' relationship count: {G.relationship_count()}\")" |
149 | 152 | ]
|
150 | 153 | },
|
151 | 154 | {
|
|
215 | 218 | "eigenvector_centrality_result.centralityDistribution"
|
216 | 219 | ]
|
217 | 220 | },
|
| 221 | + { |
| 222 | + "cell_type": "markdown", |
| 223 | + "metadata": {}, |
| 224 | + "source": [ |
| 225 | + "We will now write our results back to the database." |
| 226 | + ] |
| 227 | + }, |
218 | 228 | {
|
219 | 229 | "cell_type": "code",
|
220 | 230 | "execution_count": null,
|
|
302 | 312 | "betweenness_centrality_result.centralityDistribution"
|
303 | 313 | ]
|
304 | 314 | },
|
| 315 | + { |
| 316 | + "cell_type": "markdown", |
| 317 | + "metadata": {}, |
| 318 | + "source": [ |
| 319 | + "We will now write our results back to the database." |
| 320 | + ] |
| 321 | + }, |
305 | 322 | {
|
306 | 323 | "cell_type": "code",
|
307 | 324 | "execution_count": null,
|
|
373 | 390 | "degree_centrality_result.centralityDistribution"
|
374 | 391 | ]
|
375 | 392 | },
|
| 393 | + { |
| 394 | + "cell_type": "markdown", |
| 395 | + "metadata": {}, |
| 396 | + "source": [ |
| 397 | + "We will now write our results back to the database." |
| 398 | + ] |
| 399 | + }, |
376 | 400 | {
|
377 | 401 | "cell_type": "code",
|
378 | 402 | "execution_count": null,
|
|
438 | 462 | "- For the city metadata (metropolitan population, latitude, and longitude):\n",
|
439 | 463 | "Austin R. Benson, David F. Gleich, and Jure Leskovec. \"Higher-order Organization of Complex Networks.\" Science, 353.6295 (2016): 163–166.\n",
|
440 | 464 | "\n",
|
| 465 | + "- Link to the dataset: https://snap.stanford.edu/data/reachability.html\n", |
| 466 | + "\n", |
441 | 467 | "- Notebook contributed by [Kedar Ghule](https://github.com/kedarghule)"
|
442 | 468 | ]
|
443 | 469 | }
|
444 | 470 | ],
|
445 | 471 | "metadata": {
|
| 472 | + "kernelspec": { |
| 473 | + "display_name": "Python 3 (ipykernel)", |
| 474 | + "language": "python", |
| 475 | + "name": "python3" |
| 476 | + }, |
446 | 477 | "language_info": {
|
447 |
| - "name": "python" |
| 478 | + "codemirror_mode": { |
| 479 | + "name": "ipython", |
| 480 | + "version": 3 |
| 481 | + }, |
| 482 | + "file_extension": ".py", |
| 483 | + "mimetype": "text/x-python", |
| 484 | + "name": "python", |
| 485 | + "nbconvert_exporter": "python", |
| 486 | + "pygments_lexer": "ipython3", |
| 487 | + "version": "3.10.11" |
448 | 488 | }
|
449 | 489 | },
|
450 | 490 | "nbformat": 4,
|
|
0 commit comments