Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

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

PartWhat it holdsRead it when
GuideWhat the language is for, and a tour of it in examplesYou are new to OGML
LanguageThe rules every query follows: tokens, values, expressions, the shape of a query, parameters, historyYou write queries by hand
Stage referenceOne entry per stage: definition, syntax, behavior, examples, errorsYou need the exact form of a stage
Function referenceOne entry per function: signature, result, edge cases, examplesYou compute values
ModelingViews, materialized views, caches, patterns for building a data modelYou design a data model
Running queriesHow queries execute, memory bounds, system collections, statistics, errors, the requestYou tune or debug
AppendicesCookbook, full grammar, quick reference, limits, and the indexAny 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 text blocks. Results are shown as JSON, one document per line, without _id unless 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 | b in 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] }
usersagecityactivetagsprofile.countryprofile.score
Alice31Paristrueadmin, devFR9.5
Bob17LyonfalsedevFR7
Carol45Berlintrue(empty)DE8.25
Dan28ParistrueopsFR6
ordersuserproductqtypricestatusmonthregion
1AliceP1210.0paid2026-01EU
2AliceP2199.5paid2026-02EU
3BobP1510.0pending2026-01EU
4CarolP31250.0paid2026-02US
5DanP2399.5cancelled2026-01US
6CarolP1410.0paid2026-01US
productslabelcategoryembedding
P1Penoffice[1.0, 0.0, 0.0]
P2Printeroffice[0.9, 0.1, 0.0]
P3Phonemobile[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.stages operation);
  • 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.