Skip to main content



A relationship is always between the outer class where it is defined and another class, specified in the property to.

For example, the relationship lives_in goes from person to a country.


Let's say we have the following tables: PERSON(id, name, country_id) and COUNTRY(id, name).

In this case the relationship lives_in is going to be defined inside kb.Person and contains the property to: kb.Country.

import: [

kb {

class Person {
name.en: "Person"
sql: "${}"

relationship lives_in {
display_name: "lives in"
to: kb.Country

sql: "${PERSON.country_id}"