LDBC Datasets
Status: Backlog — not shipped in v0.5.0 (see Datasets overview).
Planned support for LDBC (Linked Data Benchmark Council) benchmark datasets.
Overview
Section titled “Overview”The LDBC Social Network Benchmark (SNB) is a comprehensive benchmark for graph databases, featuring realistic social network data with complex queries.
Dataset Source
Section titled “Dataset Source”- URL: https://ldbcouncil.org/resources/datasets/
- License: Varies by dataset
- Category: Benchmark, Social Network
Available Datasets
Section titled “Available Datasets”LDBC SNB (Social Network Benchmark)
Section titled “LDBC SNB (Social Network Benchmark)”Realistic social network data with various scale factors:
| Scale Factor | Nodes | Edges | Size | Description |
|---|---|---|---|---|
| SF0.001 | ~3K | ~17K | ~2 MB | Tiny (testing) |
| SF0.003 | ~9K | ~52K | ~5 MB | Small (development) |
| SF0.01 | ~30K | ~177K | ~17 MB | Medium (testing) |
| SF0.1 | ~328K | ~1.8M | ~180 MB | Standard (benchmarking) |
| SF1 | ~3.2M | ~18M | ~1.8 GB | Large (performance testing) |
Schema
Section titled “Schema”The LDBC SNB schema includes:
Node Labels:
Person- Social network usersPost- User postsComment- Comments on postsForum- Discussion forumsOrganisation- Companies and universitiesPlace- Cities and countriesTag- Content tagsTagClass- Tag categories
Relationship Types:
KNOWS- Person to person connectionsLIKES- Likes on posts/commentsHAS_CREATOR- Content authorshipREPLY_OF- Comment repliesHAS_TAG- Content taggingIS_LOCATED_IN- Location relationships- And more…
from graphforge import GraphForgefrom graphforge.datasets import load_dataset
# Load a small LDBC datasetgf = GraphForge()load_dataset(gf, "ldbc-snb-sf001")
# Explore the social networkresults = gf.execute(""" MATCH (p:Person)-[:KNOWS]->(friend:Person) RETURN p.firstName, p.lastName, count(friend) AS friendCount ORDER BY friendCount DESC LIMIT 10""")Example Queries
Section titled “Example Queries”Find Popular Posts
Section titled “Find Popular Posts”MATCH (post:Post)<-[:LIKES]-(liker:Person)RETURN post.content, count(liker) AS likesORDER BY likes DESCLIMIT 10Community Detection
Section titled “Community Detection”MATCH (p:Person)-[:KNOWS*2]-(friend:Person)WHERE p <> friendRETURN p.firstName, p.lastName, count(DISTINCT friend) AS secondDegreeConnectionsORDER BY secondDegreeConnections DESCLIMIT 20Content Analysis
Section titled “Content Analysis”MATCH (tag:Tag)<-[:HAS_TAG]-(post:Post)RETURN tag.name, count(post) AS postCountORDER BY postCount DESCLIMIT 15Benchmarking
Section titled “Benchmarking”LDBC SNB is designed for benchmarking with standardized queries:
from graphforge import GraphForgefrom graphforge.datasets import load_datasetimport time
gf = GraphForge()load_dataset(gf, "ldbc-snb-sf01")
# Benchmark query executionstart = time.time()results = gf.execute(""" MATCH (person:Person)-[:KNOWS*1..2]-(friend:Person) WHERE person.id = 123 RETURN DISTINCT friend.firstName, friend.lastName""")elapsed = time.time() - start
print(f"Query executed in {elapsed:.3f} seconds")print(f"Results: {len(results)} friends found")CLI Usage
Section titled “CLI Usage”# List available LDBC datasetsgraphforge list-datasets --source ldbc
# Load a specific scale factorgraphforge load-dataset ldbc-snb-sf001
# Show dataset informationgraphforge dataset-info ldbc-snb-sf01Performance Notes
Section titled “Performance Notes”- SF0.001-0.01: Suitable for development and testing
- SF0.1: Standard benchmarking scale
- SF1+: Requires significant RAM (8GB+ recommended)
- Use a Parquet-backed project directory for large scale factors