@sigloch/graph-cypher-wasm
v0.2.4
Published
Embedded Kuzu (WASM) adapter — Cypher execution and schema DDL for the graph engine
Downloads
995
Readme
@sigloch/graph-cypher-wasm
Browser- and Node-side Cypher engine for @sigloch/graph-api-core graphs.
Wraps kuzu-wasm behind a thin adapter so the underlying engine can be
swapped without breaking consumers.
Usage
import { GraphCypherEngine } from '@sigloch/graph-cypher-wasm';
import { ONTOAGENT_ONTOLOGY } from './ontology';
const engine = new GraphCypherEngine();
await engine.init(ONTOAGENT_ONTOLOGY);
await engine.loadGraph(graph);
const result = await engine.query(
"MATCH (m:MilestoneType {name:'GO'})-[:requires_document_of_type]->(dt:DocumentType) " +
"OPTIONAL MATCH (d:Document)-[:of_type]->(dt) " +
"WHERE d.status IN ['final','vollstaendig'] " +
"WITH dt, count(d) AS fulfilled WHERE fulfilled = 0 RETURN dt.name AS fehlend",
);
console.log(result.rows);Status
- Schema generator: maps
OntologyDescriptor→ kuzuCREATE NODE TABLE/CREATE REL TABLEDDL - Loader: full DROP/CREATE on
loadGraph(graph)(idempotent) - Engine: kuzu-wasm 0.11.x sync (Node) / async (browser)
- BigInt results from kuzu aggregates are coerced to
number
Why kuzu, not ruvector?
We probed @ruvector/graph-wasm: parser exists, executor does not — db.query()
returns empty silently. Verified by:
- Running 15 representative Cypher probes against
@ruvector/[email protected]: all returnedcount=0against seeded data. - Reading
crates/ruvector-graph/tests/cypher_execution_tests.rs— every test is marked// TODO: Implement. The Rust source hascypher/parser.rs,cypher/ast.rs,cypher/optimizer.rsbut nocypher/executor.rs.
[email protected] ships a complete executor. Bundle weighs ~15 MB in the browser (single-thread variant) — above ideal, but the only viable in-browser Cypher engine today. The adapter layer in this package isolates kuzu so a future swap (e.g. to a maintained kuzu fork) does not break consumers.
