onto.CalendarTable
Definition
onto.CalendarTable
is put on date attributes that are used as calendar tables, which enumerate dates for usage in other places.
There may only be one defined in the knowledge graph.
Usage
An date attribute is marked as a calendar table by setting extends: onto.CalendarTable
, which will make Veezoo use it when needed.
Note that we configure a date attribute and not a table or class, because we need to know which column contains the dates.
Calendar tables are used to fill in dates in different contexts. In Veezoo, they are in particular used to support grouping of date_interval, filling in intermediate dates.
import: [
db.storage.database.CALENDAR_TABLE
]
kb {
class CalendarTable {
...
from_table: CALENDAR_TABLE
# Calendar tables will usually be hidden from the user, they are an implementation detail
hidden: true
date Date {
...
sql: "${CALENDAR_TABLE.DATE}"
// Marks this date as a calendar table
extends: onto.CalendarTable
# Calendar tables will usually be hidden from the user, they are an implementation detail
hidden: true
}
}
}
Currently, date attributes extending onto.CalendarTable
must be defined using sql
(not definition
).
Furthermore, the outer class must be defined using from_table
.