SLayer 2.0: the Ossie release MotleyAI released SLayer 2.0, a query language whose syntax is now a strict superset of Apache Ossie Layer 3, meaning any valid Ossie Layer 3 query is also a valid SLayer 2.0 query with the same semantics and results on the same models. The company enforces the alignment with a nightly CI check across all nine of SLayer's fully tested databases against test cases in the Ossie repo, and a query-command flag lets users enforce strict Ossie L3 by rejecting non-Ossie-legal queries and formatting output column names the Ossie way. MotleyAI said full Ossie Layer 1 coverage, making Ossie the native format for all models, and Layer 2 SQL-extension alignment will land within the next couple of weeks. One curious thing that I learned when studying math: when trying to understand a domain, try to understand how it thinks about itself. Once you get that, things suddenly become easy - so in math, theorems are not created as much as discovered. Once you get the internal logic of the domain, the semantics write themselves, happens to me time and again. The latest case is how after building the expressive, agent-friendly SLayer https://github.com/MotleyAI/slayer query language https://docs.motley.ai/slayer/concepts/expressions/ , I looked at Apache Ossie Layer 3 semantics https://github.com/apache/ossie/blob/main/core-spec/wide table semantics.md and realized that where the two overlapped, they were nearly identical. What is Ossie Layer 3? The Ossie spec has four layers https://github.com/apache/ossie/blob/main/core-spec/spec layers.md . Layer 1 is the model definition: the semantic model format plus the expression language used inside it. Layer 2, the Relational Query Interface, is an SQL extension to support semantic layer, well, semantics. Layer 3, the Wide Table Query Interface, is a query format similar to most semantic layers, where the caller says which dimensions, measures, filters etc. it wants, and the interface figures out the how. Layer 4, Ontology, is a separate workstream. This led me to SLayer 2.0 https://github.com/MotleyAI/slayer/releases/tag/v2.0.0 out today , which aligns the syntax to be a strict superset of Ossie Layer 3. That is, any valid Ossie Layer 3 query is also a valid SLayer 2.0 query, and has the same semantics and the same result when applied to the same models. This is enforced by a nightly CI check https://github.com/MotleyAI/slayer/blob/main/.github/workflows/ossie-compliance.yml , on all nine of SLayer’s fully tested databases, against the test cases in the Ossie repo https://github.com/apache/ossie/tree/main/compliance/wide table . A flag in the query command https://docs.motley.ai/slayer/interfaces/ossie-layer-3/ lets you enforce strict Ossie L3, that is rejecting all queries that are not Ossie-legal, and formatting the output column names the Ossie way throwing away the dataset name prefixes . Layer 1 is partly there already: SLayer 2.0 stores imported Ossie model documents as they are and exports them back, and every Ossie expression it accepts means what Ossie says it means see Ossie compliance https://docs.motley.ai/slayer/interfaces/ossie-compliance/ . Making Ossie the native format for all models, full Layer 1 coverage, and Layer 2 SQL extension alignment will land within the next couple of weeks. Why support Ossie beyond export/import? When most semantic layers declare “ Ossie support https://motley.ai/blog-posts/post-apache-ossie-what-distinguishes-semantic-layers ”, they mean “export and import Ossie L1 documents”. While that is a start, that still forces users to maintain and keep in sync two versions of the semantic layer config migrations are rarely instantaneous, and often different systems coexist . Having Ossie L1 be the actual storage format SLayer 2.0 already stores imported Ossie documents as they are; all models follow within the next couple of weeks lets you maintain a single source of truth, used by all systems. Likewise, as the extreme overlap between Ossie and SLayer even before the alignment shows, there really is such a thing as natural query semantics, and given the names behind Ossie https://ossie.apache.org/ecosystem/ , it’s likely that the Ossie representation of it will increasingly grow in importance. This is especially important in the agentic era, as agents will have the common query formats inherent in their training data, and so will be better able to write queries in these than in more exotic ones. What does SLayer offer on top of Ossie? The simple answer, for now, is that SLayer is Ossie Layer 3 plus: - flexible query-time expressions more on those below - a large collection of supported database targets https://docs.motley.ai/slayer/configuration/datasources/ supported-database-types - built-in MCP https://docs.motley.ai/slayer/reference/mcp/ , REST https://docs.motley.ai/slayer/reference/rest-api/ , CLI https://docs.motley.ai/slayer/reference/cli/ and Python https://docs.motley.ai/slayer/reference/python-client/ interfaces - a search tool https://docs.motley.ai/slayer/concepts/search/ and a memory store https://docs.motley.ai/slayer/concepts/memories/ for the agentic search → inspect → query flow - importers for dbt https://docs.motley.ai/slayer/dbt/dbt import/ , Cube https://docs.motley.ai/slayer/cube/cube import/ and Ossie https://docs.motley.ai/slayer/osi/osi import/ models, plus automatic ingestion https://docs.motley.ai/slayer/concepts/ingestion/ of your database schema - row-level security https://docs.motley.ai/slayer/concepts/row-level-security/ , the same answer on every database, and OpenTelemetry https://docs.motley.ai/slayer/reference/opentelemetry/ The premise of every semantic layer is to separate the “what” of a query from the “how” https://motley.ai/blog-posts/agent-says-what-engine-says-how - just say what metrics, dimensions, and filters you want in that query, and the engine will figure out the correct joins and subqueries to make them happen. In most semantic layers to date, that came at a cost of a drastic reduction in expressiveness https://motley.ai/blog-posts/a-semantic-layer-is-only-as-good-as-its-query-engine : even to query for a ratio of two already defined metrics usually required adding a new metric for the ratio; anything more adventurous, like re-aggregation e.g. average per region of a total per city or grouping by a calculated dimension e.g. LTV of customers grouped by recent usage was either impossible or convoluted. So that’s where SLayer came in. We just wanted to allow “the usual calculations” at query time, while letting the engine take care of the joins and subqueries involved. Here are some of the “usual calculations”: - On the fly aggregations on existing fields, including at custom grains sets of dimensions . The result of the aggregation is itself a dataset which can take part in further expressions. - Arithmetic: add, multiply, divide subexpressions. These subexpressions can contain aggregates and fields from different datasets, and have different grain the missing dimensions get broadcast over - The usual row-level functions, like CASE WHEN , string operations, exp , etc. - Time-aware transforms such as cumsum or time shift - Beyond metrics: use these expressions freely to define dimensions, filters and order by - A time spine https://docs.motley.ai/slayer/concepts/time/ : a virtual dataset you can use to align metrics with different time dimensions So far, so natural. The fun starts when you allow these to be combined and nested arbitrarily, while making sure no aggregation gets its row cardinality messed up by an accidental filter join, aligning grains of expression components, and the like. Doing this right is hard enough that it deserves a separate post - coming up next