Skip to content

Getting Started with Graph OLAP SDK

Tutorial

Getting Started with Graph OLAP SDK

Install the SDK, connect to the platform, and run your first query

15 min Beginner
SDKSetupQuick Start

What You'll Learn

  • Installation - Install graph-olap SDK via pip
  • Connection - Connect to the Graph OLAP platform
  • First Query - Execute your first Cypher query
  • Quick Start - Use the quick_start() convenience method
1

Installation

Install the SDK package

# Install the SDK
# pip install graph-olap
# Verify installation
import graph_olap
print(f"SDK Version: {graph_olap.__version__}")
2

Connecting to the Platform

Create a client and authenticate

# Cell 1 — Parameters
USERNAME = "_FILL_ME_IN_" # Set your email before running
# Cell 2 — Connect
from graph_olap import GraphOLAPClient
client = GraphOLAPClient(username=USERNAME)
# Cell 3 — Provision
from notebook_setup import provision
personas, conn = provision(USERNAME)
analyst = personas["analyst"]
admin = personas["admin"]
ops = personas["ops"]
client = analyst
print(f"Connected! Graph has {conn.query_scalar('MATCH (n) RETURN count(n)')} nodes.")
3

Your First Query

Run a Cypher query and inspect the results

# Query the your customer graph
result = conn.query("MATCH (c:Customer) RETURN c.id AS name, c.bk_sectr AS sector LIMIT 5")
result.show()
4

Using Quick Start

One-line setup with quick_start()

from graph_olap_schemas import WrapperType
# quick_start() is a convenience method that combines mapping lookup + instance creation + connect
# conn = client.quick_start(mapping_id=mapping.id, wrapper_type=WrapperType.RYUGRAPH)
# Since we're already connected, let's count nodes
total = conn.query_scalar("MATCH (n) RETURN count(n)")
print(f"Total nodes in graph: {total}")

Key Takeaways

  • SDK installed via pip install graph-olap
  • Use GraphOLAPClient.from_env() to connect to the control plane
  • Use client.mappings.list() / client.mappings.create() to manage graph schemas
  • Use client.instances.create_and_wait() to deploy a queryable graph database
  • Use client.instances.connect() to get a connection for running Cypher queries
  • quick_start(mapping_id, wrapper_type) combines instance creation and connection in one call