{ "cells": [ { "cell_type": "code", "execution_count": 1, "id": "b4499af9-f198-4e4b-8c21-fdd8920b4bc9", "metadata": { "execution": { "iopub.execute_input": "2024-03-27T19:24:50.755645Z", "iopub.status.busy": "2024-03-27T19:24:50.755170Z", "iopub.status.idle": "2024-03-27T19:24:51.824852Z", "shell.execute_reply": "2024-03-27T19:24:51.824598Z", "shell.execute_reply.started": "2024-03-27T19:24:50.755615Z" }, "tags": [] }, "outputs": [], "source": [ "from graph_fmt import *\n", "\n", "# Connect to Aerospike Graph\n", "g = traversal().withRemote(DriverRemoteConnection('ws://0.0.0.0:8182/gremlin','g'))" ] }, { "cell_type": "code", "execution_count": 2, "id": "317486e7-2b30-433b-8b55-79dbb2806680", "metadata": { "execution": { "iopub.execute_input": "2024-03-27T19:24:53.999130Z", "iopub.status.busy": "2024-03-27T19:24:53.998364Z", "iopub.status.idle": "2024-03-27T19:24:59.994749Z", "shell.execute_reply": "2024-03-27T19:24:59.993801Z", "shell.execute_reply.started": "2024-03-27T19:24:53.999107Z" }, "tags": [] }, "outputs": [ { "data": { "text/plain": [ "'Success'" ] }, "execution_count": 2, "metadata": {}, "output_type": "execute_result" } ], "source": [ "g.V().drop().iterate()\n", "g.with_(\"evaluationTimeout\", 86400000)\\\n", " .call(\"bulk-load\")\\\n", " .with_(\"aerospike.graphloader.vertices\", \"data/fraud/vertices\")\\\n", " .with_(\"aerospike.graphloader.edges\", \"data/fraud/edges\")\\\n", " .next()" ] }, { "cell_type": "code", "execution_count": 3, "id": "24cc5c6a-5e2d-4723-995e-5074de99439e", "metadata": { "execution": { "iopub.execute_input": "2024-03-27T19:25:12.320534Z", "iopub.status.busy": "2024-03-27T19:25:12.320012Z", "iopub.status.idle": "2024-03-27T19:25:12.549908Z", "shell.execute_reply": "2024-03-27T19:25:12.549399Z", "shell.execute_reply.started": "2024-03-27T19:25:12.320503Z" }, "tags": [] }, "outputs": [ { "data": { "application/vnd.jupyter.widget-view+json": { "model_id": "edad3e975f2145c9a3330f566c805e36", "version_major": 2, "version_minor": 0 }, "text/plain": [ "CytoscapeWidget(cytoscape_layout={'name': 'cola'}, cytoscape_style=[{'selector': 'any', 'style': {'content': '…" ] }, "metadata": {}, "output_type": "display_data" }, { "data": { "text/html": [ "
| \n", " | vertex_count_per_label | \n", "edge_properties_per_label | \n", "edge_count | \n", "vertex_count | \n", "vertex_properties_per_label | \n", "edge_count_per_label | \n", "
|---|---|---|---|---|---|---|
| 0 | \n", "[{'Email': 30, 'Device': 30, 'IP': 30, 'BrowserAgent': 30, 'MailingAddress': 30, 'Member': 30, 'Toolbar': 30}] | \n", "[{'used_mailing_address': {'weight'}, 'used_email_for_account': {'weight'}, 'used_toolbar': {'weight'}, 'used_browser_agent': {'weight'}, 'invited_email': {'weight'}, 'used_device': {'weight'}, 'referred_by': {'weight'}, 'used_ip': {'weight'}}] | \n", "[329] | \n", "[210] | \n", "[{'Email': {'email_valid', 'handle_suspicious', 'graph_object_status', 'graph_object_modified_ts', 'graph_object_created_by', 'created_ts', 'graph_object_modified_by', 'region_id'}, 'Device': {'region_id', 'graph_object_status', 'graph_object_modified_ts', 'graph_object_created_by', 'created_ts', 'graph_object_modified_by', 'device_type'}, 'IP': {'graph_object_status', 'ip_likely_city', 'graph_object_modified_ts', 'graph_object_created_by', 'ip_likely_country', 'created_ts', 'graph_object_modified_by', 'region_id'}, 'BrowserAgent': {'graph_object_status', 'graph_object_modified_ts', 'graph_object_created_by', 'created_ts', 'graph_object_modified_by', 'browser_family', 'region_id'}, 'MailingAddress': {'address1', 'graph_object_status', 'graph_object_modified_ts', 'graph_object_created_by', 'address2', 'country', 'zipcode', 'city', 'created_ts', 'graph_object_modified_by', 'avs_state', 'region_id', 'state'}, 'Member': {'first_name', 'graph_object_status', 'graph_object_modified_ts', 'graph_object_created_by', 'signup_date', 'over3_fraud_score', 'last_name', 'account_modified_ts', 'graph_object_modified_by', 'member_status', 'region_id'}, 'Toolbar': {'graph_object_status', 'graph_object_modified_ts', 'graph_object_created_by', 'created_ts', 'graph_object_modified_by', 'region_id'}}] | \n", "[{'used_mailing_address': 32, 'used_email_for_account': 30, 'used_toolbar': 30, 'used_browser_agent': 29, 'invited_email': 65, 'used_device': 33, 'referred_by': 74, 'used_ip': 36}] | \n", "