This is an old revision of the document!
Database
Folk's database stores all Wishes, Claims, Whens, and Holds. Essentially, it stores everything that happens in Folk. The database works with Statements, either inserting or removing them. All those verbs I mentioned— Wish, When, etc—are functions that insert a Statement into the database. We'll cover removal later.
So, what is a Statement? A Statement consists of three parts: the Clause, the child matches, and metadata. Let's start with the Clause: a Clause is an array of words, with each word known as a Term. An example Clause, “the sky is blue”, would become [“the”, “sky”, “is”, “blue”]. We'll cover child matches and metadata in a bit.
Let's see what happens when we run Claim.
Claim the sky is blue
The Statement's Clause would become “current-file.folk claims the sky is blue”. Notice there's a part that was prepended to the beginning, “current-file.folk claims”. This is what 1. tells us what file this Claim came from, and 2. tells us that it's a Claim, not a Wish.