Skip to main content

default_date

Definition

A default_date defines which date attribute you want Veezoo to use by default when a user asks a question involving time.

Example: A class kb.Order may have an Order_Date and a Returned_Date. When the user asks "how many orders per month", Veezoo should take by default Order_Date.

The user can still ask "how many orders per month of Returned Date" or "how many orders were returned per month" and get the result using another Date attribute.

Usage

In our example above, we will need to add the property default_date to kb.Order.

import: [
db.postgres.movie_db.public.ORDERS
]

kb {
class Order {
name.en: "Order"

default_date: Order_Date

...


date Order_Date {
name.en: "Order Date"

sql: "${ORDERS.order_date}"
}
}
}

A default_date doesn't need to be set to a date attribute that is inside the same class though.

Let's say there is another class called kb.Fulfillment which has a Date defined.

import: [
db.postgres.movie_db.public.ORDERS
]

kb {
class Order {
name.en: "Order"

default_date: kb.Fulfillment.Date

...
}
}

Notice here that we need to refer to it using its fully-qualified name kb.Fulfillment.Date, since it is not in the same context as Order, i.e. Date is not inside the class Order definition.

In this case, when the user asks "how many orders per month", Veezoo will try to join kb.Order and kb.Fulfillment and count the orders by the month of the Fulfillment date attribute.