TuringDB home pagelight logodark logo
  • Discord
  • GitHub
  • Website
TuringDB

Get Started

  • Introduction
  • Get Started
  • Claude Code Skill
  • Commands

Concepts

  • Overview
  • A Columnar Graph Database
  • Versioning System
  • The DataPart System
  • Zero-Locking Architecture
  • Snapshots Isolation

Benchmarks

  • Results Summary
  • Technical Report

Query Language

  • Overview
  • Matching
  • Paths
  • Results and Aggregation
  • NEXT and WHEN
  • Subqueries
  • Functions and Types
  • Writing Data
  • Procedures and Commands
  • CheatSheet

Importing data

  • JSONL
  • CSV
  • Neo4j
  • GML
  • Parquet

Graph Development

  • Create Graph
  • Load Graph
  • Load External data
  • Create a Change
  • List Changes
  • Create Nodes and Edges
  • Update Properties
  • Submit a Change
  • Time Travel
  • Graph Examples

Vector Search

  • Vector Search

Graph Algorithms

  • Shortest Path

Tutorials

  • Example Notebooks

Python SDK

  • Get Started
  • Reference

JavaScript SDK

  • Get Started
  • Reference

Release Notes

  • All Releases
  • TuringDB 3.1

Troubleshooting

  • Troubleshooting
Graph Development

Graph Examples in Python

Complete example on how to create and query a graph from scratch in Python

from turingdb import TuringDB

# Connect to the TuringDB server (default: localhost:6666)
client = TuringDB(host="localhost", port=6666)

# Create a new graph called my_graph
client.create_graph("mygraph")

# Set working graph
client.set_graph("mygraph")

# Create a new change on the graph
change = client.new_change()

# Checkout into the change
client.checkout(change=change)

# Create a node Person (Jane) - Edge (knows) - node (John)
client.query(
    "CREATE (n:Person {name: 'Jane'})"
    "-[e:KNOWS]->(m:Person {name: 'John'})"
)

# Commit the change
client.query("COMMIT")
client.query("CHANGE SUBMIT")

# Checkout back to main
client.checkout()

# Query graph
df = client.query(
    "MATCH (n:Person {name:'Jane'})-[e:KNOWS]-"
    "(m:Person {name:'John'}) RETURN n, e, m"
)
print(df)
Time TravelVector Search
githublinkedinyoutubediscord