Skip to main content

froGQL — embedded GQL graph database with ISO GQL path patterns (Rust core, Python bindings)

Project description

froGQL

Embedded GQL graph database with single-file storage. Rust core, Python bindings via PyO3.

froGQL implements ISO GQL path pattern matching: MATCH, comma-joins, unions, repetitions ({n,m}), OPTIONAL MATCH, EXISTS / NOT EXISTS, WHERE, RETURN, LIMIT. The runtime uses Leapfrog Triejoin (CompactLTJ) as its primary join strategy — worst-case-optimal for multi-way joins, with measured 14×–4000× speedups over pairwise hash-join on social-graph workloads.

Install

pip install frogql

Wheels ship for CPython 3.8+ on Linux (x86_64, aarch64), macOS (x86_64, arm64), and Windows (x86_64).

Quick start

import frogql

# Open or create a .gdb database
conn = frogql.open("movies.gdb")

# Run a query — returns a list of {alias: value} dicts
rows = conn.execute(
    "MATCH (p:Person)-[:ACTED_IN]->(m:Movie) WHERE m.released = 1999 RETURN p.name, m.title",
    limit=10,
)
for row in rows:
    print(row["p.name"], "->", row["m.title"])

# Inspect the graph
print(conn.node_count, conn.edge_count)
print(conn.schema())

Data import

# From JSON
frogql.import_json("graph.gdb", "graph.json")

# From a CSV directory with spanner_import_config.json
frogql.import_csv("graph.gdb", "path/to/csv_dir/")

Graph types and indexes

The catalog persists inside the .gdb file. DDL is plain GQL:

conn.execute("CREATE GRAPH TYPE movies { (:Movie {title STRING, released INT}) }")
conn.execute("USE GRAPH TYPE movies")
conn.execute("VALIDATE GRAPH TYPE movies")
conn.execute("CREATE BTREE INDEX ON :Movie(released)")

A DEFAULT graph type is auto-inferred at import time. Auto-built secondary indexes (hash + btree) cover unique (label, prop) pairs and are picked up by the optimizer for constant-folding and range filters.

API surface

Call Returns
frogql.open(path) Connection
frogql.import_json(db_path, json_path) None
frogql.import_csv(db_path, csv_dir) None
Connection.execute(query, limit=100) list[dict]
Connection.schema() dict
Connection.graph_types() list[dict]
Connection.node_count / Connection.edge_count int

Connection is not thread-safe across Python threads (PyO3 unsendable).

License

MIT. See LICENSE in the source repository.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

frogql-0.1.0.tar.gz (16.9 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

frogql-0.1.0-cp38-abi3-win_amd64.whl (844.3 kB view details)

Uploaded CPython 3.8+Windows x86-64

frogql-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

frogql-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (963.5 kB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ ARM64

frogql-0.1.0-cp38-abi3-macosx_11_0_arm64.whl (890.0 kB view details)

Uploaded CPython 3.8+macOS 11.0+ ARM64

frogql-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl (942.1 kB view details)

Uploaded CPython 3.8+macOS 10.12+ x86-64

File details

Details for the file frogql-0.1.0.tar.gz.

File metadata

  • Download URL: frogql-0.1.0.tar.gz
  • Upload date:
  • Size: 16.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for frogql-0.1.0.tar.gz
Algorithm Hash digest
SHA256 09de273b741d7566a2083ee2d0e6ee3e57b47e03cd93e29d620a822bee9cba5d
MD5 6c878e26e3586478e69a5abf9f86228a
BLAKE2b-256 bb460e77b52b4c5c2cdeed0e7bf5cf4666b127a88f3ac43ba06e9dea4e7d616a

See more details on using hashes here.

File details

Details for the file frogql-0.1.0-cp38-abi3-win_amd64.whl.

File metadata

  • Download URL: frogql-0.1.0-cp38-abi3-win_amd64.whl
  • Upload date:
  • Size: 844.3 kB
  • Tags: CPython 3.8+, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: maturin/1.13.1

File hashes

Hashes for frogql-0.1.0-cp38-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 f9c92f7508386b1c95b2a33fc2f5dd5738b2c2e79ffd1f0c1978db08b6be8104
MD5 2549cd0ed48f0e86c1737ca81680e319
BLAKE2b-256 a8a471de3b69e61e997d68c903fab07970a1f5f2fe9c77737969546a17dd96ff

See more details on using hashes here.

File details

Details for the file frogql-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for frogql-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 f84ace4f15adedacc60f680bb62c77b831d396e2f593925265c0c1715d51f898
MD5 f8b1276fa6d4305e855cb4da117fefc2
BLAKE2b-256 f5704fdbfdd333e8194e9665927d7257097650d326f642b6e08a532209146ad9

See more details on using hashes here.

File details

Details for the file frogql-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for frogql-0.1.0-cp38-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5239960a7bbd4f4635873fa0b254a8b51566b4ca73bceea1a0e464f72c74ebfe
MD5 d28bf5eadb4a6ba7c23f01919ffbd941
BLAKE2b-256 2ad230c0408bceaf1e8ef3ed2ddfafdda3c136dd962cba2b93ffaad77a797a9a

See more details on using hashes here.

File details

Details for the file frogql-0.1.0-cp38-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for frogql-0.1.0-cp38-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ab927ac83af4d42b91ab8ee7fde2aa326059d7c990a0f79496a202b17bf53710
MD5 1d76eeefe2fbea53909fcd4d8aeec693
BLAKE2b-256 5e69f6a37d76c23c373e107d6afcbef36b3c1c234b1430ebf1c30bfe3b061e79

See more details on using hashes here.

File details

Details for the file frogql-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for frogql-0.1.0-cp38-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 fc9e3073c02067f35cba6db493eec3b2a5af85d9dda3997bf78fcf9782e34943
MD5 68a10e4d4a019e150bc624e00b9996a0
BLAKE2b-256 df70a33e2c8dd1af8127decb15af93b052dd3f83316c458e194378ad39d9ef3b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page