Matt's Roof Garden

Powered by 🌱Roam Garden

Intro to datalog for Roam Research

Status:: seedlings

🚧 This page is an experiment in learning in semi-public. Misc bits I learn about datalog and datomic will be recorded here. 🚧

Why am I doing this? I am very interested in the different

datalog Query
that can be done from within Roam Research. These queries allow a massive amount of flexibility to the questions we can ask our own database.

I have started to collect some examples of useful queries that I have created and use

An alternate option would be to encode the query within custom JS (similar to what the RoamAlphaAPI calls do). I am against using that JS for one-off queries because of how ugly and complicated the block structure needs to be to accommodate it

Look here for an example of how complex the JS and block structure can get

{{embed: ((

If anyone has any idea how to make the output of a datalog query look nicer I’d be very interested

What I have learned

What is the difference between re-find and re-matches ?

Matching substrings

re-matches matches the whole string. But often, we want to find a match within a string. re-find returns the first match within the string. The return values are similar to re-matches.