The Grammar of Data: From Definition to Execution A second-part technical walkthrough demonstrates the "grammar of data" approach by building a data engineering digest that ingests RSS feeds, a live Bluesky firehose, raw PyPI downloads, and GitHub Archive events with dlt, then transforms them using xorq expressions across DataFusion, DuckDB, and Snowflake engines. The project registers reusable metric definitions such as star_velocity_30d and download_trend_90d as content-addressed, git-versioned catalog entries, with DataFusion as the default engine, and includes a small ML job. The example code is published in the de-ecosystem-digest GitHub repository. In Part 1 https://www.ssp.sh/blog/grammar-data-engineering/ , we discovered the grammar for data: a way to define a data project with its complex requirements and how we define it declaratively as a grammar in one sentence with nouns sources , transformations verbs , templates, and modifiers, essentially being able to define it once and run it anywhere with different execution engines. This Part 2 will demonstrate how this looks in a data engineering digest project where we process data from RSS feeds, a live Bluesky firehose, and GitHub datasets, and find trends with an all-integrated horizontal data architecture running xorq based on the grammar described. We use dlt for ingestion outside the grammar , then Ibis, DataFusion/DuckDB/Snowflake for the engine, a cataloging feature to compress and discover metrics, and a small ML job. This article will guide you through that project and explain why xorq and the grammar of data are helpful to you. Note Want to jump right into the code: GitHub Repo Then follow along, the repository is at de-ecosystem-digest https://github.com/ssp-data/de-ecosystem-digest , the showcase we will go through as an example for the grammar of data below. As a reminder, the grammar dedicated to data consists of these parts and constructs a full sentence as our data project: In our data engineering digest example project https://github.com/ssp-data/de-ecosystem-digest we create a data engineering digest based on my DE RSS Feeds https://www.ssp.sh/brain/rss-feeds-for-data-engineering/ I collected over the years, Bluesky posts, raw PyPI downloads and GitHub Archive events as source data that we ingest with dlt https://github.com/dlt-hub/dlt . Here’s an overview of the project: Model once, represent everywhere - the transformation never changes, only the engine binding does | Read left to right: every part of speech maps to a xorq call We transform the data with xorq expressions mutate, filter, group by, aggregate, order by , use templates to bind the sentence to any repo dbt-core, polars, … and modifiers to bind the engine or a fitted ML model , and manifest it as a unique hash. Each named expression can be registered as a content-addressed, git-versioned catalog entry with the catalog https://docs.xorq.dev/api reference/cli/index.html catalog being the shelf of all of them such as star velocity 30d , download trend 90d , each reproducible on its own because xorq bundles the source read at build time. Then we run those reusable metric definitions on any engine with pre-existing pipelines to make it easier to run with make preview , which executes every named expression, while make catalog registers the curated ones as versioned entries. The default engine is DataFusion, but I added DuckDB and Snowflake, using xorq’s multi-compute engine capabilities . To illustrate the grammar and expression of the grammar in plain Python, here is how github.py https://github.com/ssp-data/de-ecosystem-digest/blob/main/src/de ecosystem/catalog/github.py could look, in six lines: | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | python def star velocity 30d con, repo : TEMPLATE: bind this sentence to any repo cutoff = datetime.now - timedelta days=30 t = con.table "raw github events" NOUN: a lazy pointer, no computation yet return t.filter VERB t.repo name == repo, t.type == "WatchEvent", t.created at cutoff, .mutate week=t.created at.truncate "W" VERB .group by "week" VERB .agg stars=t.id.count VERB .order by "week" VERB | Every one of these functions and the Makefile https://github.com/ssp-data/de-ecosystem-digest/blob/main/Makefile lets us run the grammar as steps of the grammatical grammar, building a sentence like this. I added this for illustration, but as an overview, if we map the commands to a xorq call , we can see the connection from the grammar of data to the xorq function: | make target | xorq / Python call | grammar part | |---|---|---| | make noun | con.table ... | noun source | | make verb | .filter/.mutate/.agg deferred expr | verbs transform | | make template | star velocity 30d con, repo | template bind by arg | | make modifier | settings.backend engine | modifier engine/fit | | make lineage | expr.op / ibis.to sql / expr.ls | lineage what xorq sees | | make manifest | xorq build expr.py -e star velocity | model once → expr.yaml | | make catalog | xorq catalog add … → ./catalog | versioned entry store | | make run-sentence | digest.main → .execute | execute the sentence | | make engines | settings.backend x + expr.execute | represent everywhere | note Ingestion and installation are excluded on purpose here To initialize, we also need make install to install dependencies and make ingest to load data with dlt locally. make run-sentence or make full-pipeline runs the full grammar of data. Additional commands preview catalog catalog-run summary digest ml test clean are added separately. If we run the demo project https://github.com/ssp-data/de-ecosystem-digest with the 90-day windows PyPI max provides this window without storing data ourselves , we get a couple of interesting insights that this demo project produces from digesting the full Data Engineering ecosystem . The digest ranks tools and terms of data engineering by their momentum with PyPI download growth and GitHub data, and enriches each tool with its Bluesky chatter on socials