openglacier
The OpenGlacier Modeling Language
Reference and guide to the language of openglacier: og-core, its daemon
ogd, the glacierdb distribution, and the Places and views built on them.Edition of 25 October 2026
About this book
The OpenGlacier Modeling Language (OGML in this book) is one language for three jobs:
- querying: reading documents, filtering, computing, joining, aggregating;
- writing: inserting, updating, deleting and bulk-loading documents in one transaction;
- modeling: naming queries as views, stacking views into a data model, and keeping the costly ones materialized.
A query is a pipeline. It names a source, then sends its rows through stages separated by |:
on orders
| where status == "paid"
| derive revenue = price * qty
| group | by region | sum revenue | end
| sort revenue desc
How this book is organized
| Part | What it holds | Read it when |
|---|---|---|
| Guide | What the language is for, and a tour of it in examples | You are new to OGML |
| Language | The rules every query follows: tokens, values, expressions, the shape of a query, parameters, history | You write queries by hand |
| Stage reference | One entry per stage: definition, syntax, behavior, examples, errors | You need the exact form of a stage |
| Function reference | One entry per function: signature, result, edge cases, examples | You compute values |
| Modeling | Views, materialized views, caches, patterns for building a data model | You design a data model |
| Running queries | How queries execute, memory bounds, system collections, statistics, errors, the request | You tune or debug |
| Appendices | Cookbook, full grammar, quick reference, limits, and the index | Any time |
Each reference entry follows the same layout:
- Definition: one sentence.
- Syntax: the accepted forms, with
<placeholders>and[optional parts]. - Behavior: what it does, row by row, including the edge cases.
- Examples: queries with their results.
- Errors and limits: what it refuses, and why.
- See also: related stages and functions.
Conventions
- Queries are shown in
textblocks. Results are shown as JSON, one document per line, without_idunless it matters. -- …after a query line is a comment of this book, not of the language (OGML has no comments).<name>is a placeholder;[ … ]is optional;a | bin a syntax line means one of, except where the pipe is the stage separator (it then stands at the start of a line).- The examples read the three small collections below.
users { name, age, city, active, tags: [...], profile: { country, score } }
orders { order_id, user, product, qty, price, status, month, region }
products { code, label, category, embedding: [x, y, z] }
| users | age | city | active | tags | profile.country | profile.score |
|---|---|---|---|---|---|---|
| Alice | 31 | Paris | true | admin, dev | FR | 9.5 |
| Bob | 17 | Lyon | false | dev | FR | 7 |
| Carol | 45 | Berlin | true | (empty) | DE | 8.25 |
| Dan | 28 | Paris | true | ops | FR | 6 |
| orders | user | product | qty | price | status | month | region |
|---|---|---|---|---|---|---|---|
| 1 | Alice | P1 | 2 | 10.0 | paid | 2026-01 | EU |
| 2 | Alice | P2 | 1 | 99.5 | paid | 2026-02 | EU |
| 3 | Bob | P1 | 5 | 10.0 | pending | 2026-01 | EU |
| 4 | Carol | P3 | 1 | 250.0 | paid | 2026-02 | US |
| 5 | Dan | P2 | 3 | 99.5 | cancelled | 2026-01 | US |
| 6 | Carol | P1 | 4 | 10.0 | paid | 2026-01 | US |
| products | label | category | embedding |
|---|---|---|---|
| P1 | Pen | office | [1.0, 0.0, 0.0] |
| P2 | Printer | office | [0.9, 0.1, 0.0] |
| P3 | Phone | mobile | [0.0, 1.0, 0.0] |
Sources of truth
This book follows the engine. Where they disagree, the engine wins and the book has a bug:
- the stage catalogue,
og-core/src/query/stage.rs(also listed live by the.query.stagesoperation); - the function table,
og-core/src/query/eval.rs(Function); - the views,
og-core/src/view.rs; - the developer reference,
og-core/src/query/README.md.
To read the book as a website: mdbook serve og-books/manifest/the_ogml_language. The Markdown files also read as they are.