MARS-QL is a strict superset of SQL-92 with three additional reserved
words and one new operator. If you can read a SELECT, you can write
MARS-QL.
A tour
-- Most-attested agents published this year
SELECT entry_did, COUNT(a.attester_did) AS att
FROM entries e
LEFT JOIN attestations a ON a.entry_did = e.entry_did
WHERE e.entry_type = 'agent'
AND e.published_at >= '2026-01-01'
GROUP BY e.entry_did
ORDER BY att DESC
LIMIT 25;
-- All descendants of a particular HMR
WITH RECURSIVE descendants(did) AS (
SELECT 'did:oas:l1fe:hmr:jared-rice'
UNION
SELECT child.did
FROM lineage child, descendants
WHERE child.parent = descendants.did
)
SELECT * FROM descendants;
-- Entries attested by a specific auditor
SELECT entry_did
FROM entries
WHERE entry_did ATTESTED_BY 'did:oas:l1fe:auditor:k8s-reproducer'
TYPE 'build-reproducible';
See the full grammar for the formal definition.