Modelling Pizza Orders with XDb1
From: Neo <neo55592_at_hotmail.com>
Date: 15 Apr 2004 11:58:54 -0700
Message-ID: <4b45d3ad.0404151058.2246ec96_at_posting.google.com>
This example models two pizza orders using XDb1. The first order consists of a small, thin pizza with mozzarella and veggies. The second order consists of a large, thick pizza with mozzarella, parmesan, sausage, pepperoni, black olives and four cokes.
size isa thing.
crust isa thing.
cheese isa thing.
topping isa thing.
drink isa thing.
drinkType isa thing.
qty isa thing.
*'s size is small.
*'s crust is thin.
*'s cheese is mozzarella.
*'s topping is veggies.
*'s size is large.
*'s crust is thick.
*'s cheese is mozzarella.
*'s cheese is parmesan.
*'s topping is sausage.
*'s topping is pepperoni.
*'s topping is black olives.
*'s drinkType is coke.
*'s qty is 4.
XDb1 can find things via relational expressions.
Date: 15 Apr 2004 11:58:54 -0700
Message-ID: <4b45d3ad.0404151058.2246ec96_at_posting.google.com>
This example models two pizza orders using XDb1. The first order consists of a small, thin pizza with mozzarella and veggies. The second order consists of a large, thick pizza with mozzarella, parmesan, sausage, pepperoni, black olives and four cokes.
To enter the above data via Natural Language Interface (as opposed to via GUI or API), submit the following sentences:
order isa thing.
pizza isa thing.
size isa thing.
crust isa thing.
cheese isa thing.
topping isa thing.
drink isa thing.
drinkType isa thing.
qty isa thing.
order 1 isa order.
* isa pizza. (* now refers to a new unnamed instance of pizza class) * isPartOf order 1.
*'s size is small.
*'s crust is thin.
*'s cheese is mozzarella.
*'s topping is veggies.
order 2 isa order.
* isa pizza. (* now refers to a new unnamed instance of pizza class) * isPartOf order 2.
*'s size is large.
*'s crust is thick.
*'s cheese is mozzarella.
*'s cheese is parmesan.
*'s topping is sausage.
*'s topping is pepperoni.
*'s topping is black olives.
* isa drink. (* now refers to a new unnamed instance of drink class) * isPartOf order 2.
*'s drinkType is coke.
*'s qty is 4.
The result of the above statements can be seen at
www.xdb1.com/Example/Ex108.asp
An equivalent NULL-less RDM schema might consist of the following
tables:
T_Order T_Pizza T_Size T_Crust T_Cheese T_Topping T_Drink T_DrinkType T_Qty T_OrderPizzaMap (to allow orders with variable number of pizzas) T_PizzaCheeseMap (to allow pizzas with variable number of cheeses)T_PizzaToppingMap (to allow pizzas with variable number of toppings) T_OrderDrinkMap (to allow orders with variable number of drinks)
XDb1 can find things via relational expressions.
The following expressions find order 1:
order (pizza thin veggies)
order (small thin pizza mozzarella veggies)
The following expressions find order 2:
order (pizza thick pepperoni "black olives")
order (pizza parmesan) (drink coke)
The following expressions find both orders:
order (pizza mozzarella)
order (pizza)
Received on Thu Apr 15 2004 - 20:58:54 CEST