G
G
Gemini Docs
Search…
Entities
The Gemini schema is very simple and self-explanatory. It is a simple YAML where you can put the list of your entities. The Gemini platform automatically reads entities and fields and provide for you all the API for inserting, updating and retrieving data with validation features.

Common Entities

Here for example a very basic schema with two entities: Product and Category and some basic fields. Each entity always has a name and a list of fields.
Common entities are those one that can contains multiple records (like a table in SQL or a collection in NoSQL). For this reason each entity has also a logical key to identify a single record. The logical key (lk) can contain one or more fields, usually strings or sequence numbers.
1
# EXAMPLE - PRODUCT AND CATEGORY SCHEMA DEFINITION
2
​
3
type: ENTITY
4
entity:
5
name: CATEGORY
6
displayName: Category
7
lk: [id]
8
fields:
9
- name: id
10
type: STRING
11
required: true
12
- name: description
13
type: STRING
14
​
15
---
16
​
17
type: ENTITY
18
entity:
19
name: PRODUCT
20
displayName: Product
21
lk: [id]
22
fields:
23
- name: id
24
type: STRING
25
required: true
26
- name: name
27
type: STRING
28
- name: description
29
type: STRING
30
- name: available
31
type: BOOL
32
​
Copied!

Entity Configuration

From the previous schema you can see some important configurations. Each Entity has:
Property
Description
Required
name
The name of the Entity. It is gonna to be used in all the Gemini framework, also with low level APIs in order to retrieve the Entity Data or Configuration
true
lk
List of logical keys for the entity. Must be one or more fields of basic types. Usually numbers and strings. The fields order matters.
true
displayName
If you want a different display name, especially for the GUI parts, when you need to interact with entity configuration
false
fields
The list of fields for the Entity
true