This walks the core loop end to end: define a schema, initialize a graph, load
data, query it, and use a branch. It uses a local file-backed graph; swap the
path for an s3://… URI to run the same flow against object storage.
Install the omnigraph CLI first.
A schema (.pg) declares your node and edge types. Save this as schema.pg:
node Person {
name: String
title: String?
}
See the schema language for types, constraints, and edges.
omnigraph init --schema schema.pg graph.omniinit creates an empty graph at the given URI with your schema applied.
load is the single bulk-write command. --mode is required
(overwrite | append | merge):
omnigraph load --data people.jsonl --mode overwrite graph.omnipeople.jsonl is newline-delimited JSON, one record per line. For finer-grained
or inline writes, see mutations.
Write a query (.gq) — save as queries.gq:
query find_people($title: String) {
match { $p: Person { title: $title } }
return { $p.name }
}
Run it:
omnigraph query find_people --query queries.gq \
--params '{"title":"Engineer"}' --format table --store graph.omniThe query name is positional; --query points at the .gq source and
--store addresses the graph's storage directly.
The query language covers match/return/order, and
search covers vector and full-text search.
Branches isolate changes until you merge them — Git-style, across the whole graph:
omnigraph branch create review/new-hires graph.omni
omnigraph load --data new-hires.jsonl --mode append --branch review/new-hires graph.omni
# inspect the branch, then integrate it
omnigraph branch merge review/new-hires --into main graph.omniSee branches & commits and merging.
- CLI reference — every command and flag.
- Schema language and query language.
- Operating a cluster and running the server for multi-graph, multi-user deployments.