Skip to content

Adds notebooks for Telco-Network application with GNN and LLM. #587

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 19, 2024
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: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ Starting with v1.31.6, this file will contain a record of major features and upd

## Upcoming

- New notebooks showing Telco examples leveraging GNN and LLM ([Link to PR](https://github.com/aws/graph-notebook/pull/587))
- Path: 02-Neptune-ML > 03-Sample-Applications > 04-Telco-Networks

## Release 4.2.0 (April 4, 2024)

- New Neptune Analytics notebooks - SBOM ([Link to PR](https://github.com/aws/graph-notebook/pull/566))
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "21451344-eff7-4c5b-b75d-046fbde1c9a2",
"metadata": {},
"source": [
"# Loading the Graph data\n",
"\n",
"The data that we use is adapted from the [Stanford Network Analysis Project (SNAP) public Telecom dataset](https://snap.stanford.edu/data/#tcn)\n",
"\n",
"The relationships between users and cells in dataset were extracted and was augmented to add gnodeb nodes and edges between cells and gnodebs to make it similar to a 5G cell network.\n",
"\n",
"The data transformation implementation with AWS Glue can be found in the script `Transform2Neptune.py`\n",
"\n",
"The final dataset used in this application contains Users, Cells, gnodeb, etc. and the known links in between\n",
"\n",
"- s3://neptuneml-data/telcograph/data/node_users.csv\n",
"\n",
"- s3://neptuneml-data/telcograph/node_cell.csv\n",
"\n",
"- s3://neptuneml-data/telcograph/gnodeb_node.csv\n",
"\n",
"- s3://neptuneml-data/telcograph/edge_all.csv\n",
"\n",
"- s3://neptuneml-data/telcograph/edge_gnodeb.csv\n"
]
},
{
"cell_type": "code",
"execution_count": 1,
"id": "960dfe5d-67ce-43fd-85a4-6b1593790581",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# #load command for loading the graph from S3 to Neptunedb\n",
"%load -s s3://neptuneml-data/telco-graph/data -f csv -p OVERSUBSCRIBE"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.9.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,216 @@
{
"cells": [
{
"cell_type": "markdown",
"source": [
"# Querying the Graph data\n",
"\n",
"Once the data has been loaded into the database, we can run some gremlin queries to query the data in the graph database.\n",
"\n",
"Below we have examples of a few Gremlin queries to get the count of vertices and edges in the graph as well as to get the counts by vertex label and edge label."
],
"metadata": {
"collapsed": false
}
},
{
"cell_type": "code",
"execution_count": null,
"id": "cd27cae0-9aad-47cc-a1fa-46ea561d4e1e",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.V().count().next()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "7f434bc3-ddca-4979-a580-f1f416a1443a",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.E().count().next()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8f22769f-1f97-4e03-b3a3-aa62e44f4b42",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.V().groupCount().by(label).unfold().order().by(keys)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ae383337-74bb-4105-8c4a-6acf93edde42",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.E().groupCount().by(label).unfold().order().by(keys)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4240519a-2dba-401c-81f2-4860848672f0",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.V().values('user_attr_1').mean().next()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "13b6adf4-5d33-4957-8e32-db897a0d4a6e",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.V().values('user_attr_1').min().next()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "ededeb32-e1f5-4b29-bf03-e7dc557ad960",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"# Find the distinct values of a property in vertices\n",
"distinct_values = g.V().values('user_attr_1').dedup().toList()\n",
"#print(\"Distinct values:\", distinct_values)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "76a5b6da-e855-49d2-b120-374dd7a8ea2e",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.V().hasLabel('user').properties().count()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f99bb270-0d9c-4b44-bef2-332306bab4fb",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.V().hasLabel('user').properties().key().dedup().count()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "c1fd63ad-f0ad-4f38-9e5c-4832d2d7fc51",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.V().hasLabel('cell').properties().key().dedup().count() "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "4b96732c-f6fa-4c60-a0a9-a15610885b6b",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.V().hasLabel('cell').properties().count()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "f23d18bb-1ee8-4374-8197-1d0b8dc1e62b",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.E().hasLabel('user_live_cell').properties().key().dedup().count() "
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "13594594-0ff0-42d5-a5b2-205c8a39860c",
"metadata": {
"tags": []
},
"outputs": [],
"source": [
"%%gremlin\n",
"g.E().hasLabel('user_live_cell').properties().count()"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "8a705292-849d-4a55-98ca-f75dd7b3892b",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.8"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Loading