Skip to main content

entity

Definition

An entity is an instantiation or an individual of a class.

A class could be something like:

  • Customer
  • Country
  • Order
  • Movie

Now, each of these classes may have instantiations of it. In programming, we call these "objects". In VKL, we call them entities. So following our example, we may have entities like:

  • entity Till_Haug of class Customer
  • entity Brazil of class Country
  • entity Batman of class Movie

But what about Order? For classes like Order, Transaction and Event, it makes sense usually to model it as a class without entities. Prefer to use classes with entities when there is a way to refer to an individual of this class in a question.

Usage

Entities are generated based on the sql of a class. Check its reference page to learn more about it.

kb.Customer {
entity 00042_Arthur_Dent_1234 {
name.en: "[00042] Arthur Dent"

synonym.en: "Arthur Dent"

id: "00042"
}
...
}

It is important to notice that entities, like any other Knowledge Graph concept, lives only in your Knowledge Graph. This means that whatever changes you make to its properties, like name or synonym, will not be written to your database.

In fact, Veezoo does not require any write access to your database and we recommend using read-only database credentials.