| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Modelling Pizza Orders with XDb1
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.
order 2 isa order.
* isa pizza. (* now refers to a new unnamed instance of pizza class) * isPartOf order 2.
* isa drink. (* now refers to a new unnamed instance of drink class) * isPartOf order 2.
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)
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 - 13:58:54 CDT
![]() |
![]() |