YARRRML: human-readable SQL-to-RDF mappings

The customer has a ton of SQL data and is on its way to knowledge augmented AI (KAAI), how to generate RDF towards exposure and provenance? It’s common and yet challenging. Let’s be honest, RML is horrible. So, how to proceed?
R2RML solved the SQL-to-RDF mapping problem, but only for relational databases, and only in verbose Turtle syntax. RML generalized this to arbitrary heterogeneous sources inheriting R2RML’s power but also its ugliness. Writing raw RML by hand means wrestling with TriplesMaps, PredicateObjectMaps, and Turtle boilerplate for even trivial mappings.
YARRRML answers this by being a human-readable, YAML-based representation that can express R2RML and RML rules without the syntactic overhead. A mapping that takes 30+ lines of Turtle often collapses to 5 lines of YAML. It reads closer to configuration than formal logic, which is precisely the point.
Another pro is that domain experts can understand YAML without having to decipher RDF. You can have readable git-like diffs and use standard editors.
The disadvantage: it’s an additional transpilation layer, not a replacement. You still need an RML-aware engine downstream, and debugging sometimes means reading the generated Turtle anyway.
There are alternatives but I found YARRRML to be the most enjoyable option:
- SPARQL-Anything / SPARQL-Generate if you think in SPARQL, generating RDF via SPARQL CONSTRUCT queries avoids introducing a second paradigm entirely.
- ShExML is closer in spirit to YARRRML but leans on ShEx-style shape expressions, worth a look if you’re already shape-first.
- Morph-KGC is for teams who want RML compatibility with a Python-native, high-performance execution engine rather than the Java-based RMLMapper.
- Custom ETL + RDFLib/rdflib-jsonld gives you full control, zero declarative overhead, but you lose the auditability and reusability of declarative rules entirely.
Probably other options, do let me know if you found the unicorn🦄
- SPARQL-Anything: https://sparql-anything.cc
- YARRRML: https://rml.io/yarrrml/
- ShExML: https://shexml.herminiogarcia.com
- Morph-KGC: https://morph-kgc.readthedocs.io