Relation

A relation is one of the roles a value can play in Bondy: a fact you look up, like a row in a database table. You can ask about it in either direction: the same ReportsTo facts answer "who does Alice report to?" and "who reports to Bob?".

bondy
relation ReportsTo = {who: String, boss: String}
fact ReportsTo(who: "alice", boss: "bob")

A fact declaration is the data a relation starts with. The facts themselves live in a relation store, backed by ETS or PostgreSQL, where rows can be inserted and deleted while the program runs. New relations are defined from existing ones with derivation rules (see rule) and read with query.

Not to be confused with a constraint: a relation holds facts you look up, a store of constraints holds facts that rules act on.