File cas1.doc [copied from Unix file cas_interp_ver3.txt 6/11/90] INTERPETING ATIS QUERIES RE THE DATABASE Basics: A large class of tables in the database have entries that can be taken as defining things that can be asked for in a query. In the answer, each of these things will be identified by giving a value of the primary key of its table. These tables are: Name of Table English Term(s) Primary Key aircraft aircraft, equipment aircraft_code airline airline airline_code airport airport airport_code city city city_code compound_class service classes, e.g. fare_class "coach", etc. day names of the days of day_code the week. fare fare fare_code flight flight flight_code food_service meals meal_code ground_service ground transportation city_code,airport_code, transport_code month months month_number restriction restrictions restrict_code state names of states state_code time_zone time zones time_zone_code transport transport code transport_code Special meanings: In this arena, certain English expressions have special meanings, particularly in terms of the database distributed by TI in the spring of 1990. Here are the ones we have agreed on: (In the following, "A.B" refers to field B of table A.) 1. Flights. A flight "between X and Y" means a flight "from X to Y". In an expression of the form "flight number N", where N is a number, N will always be interpreted as referring to the flight number (flight.flight_number). "Flight code N" will unambiguously refer to flight.flight_code. "Flight N" will refer to flight.flight_number if N is in the range 0 <= N <= 9999 but to flight.flight_code if N >= 100000. A "one-way" flight is a flight with a fare whose one-way cost is non-empty. Principle: if an attribute "X" of a fare, such as "one-way" or "coach", is used as a modifier of a flight, it will be interpreted as "a flight with an X fare". 2. Fare (classes). A "one-way" fare is one with a non-empty one-way cost. In determining what is the "cheapest fare", one-way fares will be included. A "coach" fare is one whose compound_class.class_type = "COACH". Similarly, the fare modifiers "first class", "business class", and "thrift class" refer to values of the compound_class.class_type field. A reference to ranking of fares, e.g. "fares that are Y class or better", will be interpreted as a reference to the rank of the associated base fare (class_of_service.rank). A "discounted fare" is one whose compound_class.discounted = "YES". An "excursion fare" is one with a restriction code (fare.restrict_code) that contains the string "AP", "EX", or "VU". A "family fare" is the same thing as an "excursion fare". A "special fare" is one with a non-null restriction code (fare.restrict_code). 3. Time. The normal answer to otherwise unmodified "when" queries will be a time of day, not a date or a duration. The answer to queries like "On what days does flight X fly" will be a list of day.day_code fields, not a flight_days string. 4. Units. All units will be the same as those implicit in the database (e.g. feet for aircraft.wing_span, but miles for aircraft.range_miles, durations in minutes). 5. Meals. For purposes of determining flights "with meals/meal service", snacks will count as a meal. "list the types of meal" should produce one tuple per meal, not a single meal_code string. 6. "With" clauses. "with"-modification clauses: "show me all the flights from X to Y with their fares" will require the identification of both flights and their fares (so if there are 2 flights, each with three fares, the answer will have 6 tuples, each with at least the flight_code and fare_code). In general, queries asking for information from two or more separate tables in the database will require the logical union of fields that would identify each table entry separately. 7. The "itinerary" of a flight refers to the set of all non-stop legs of that flight. When an "itinerary" is asked for, each leg of the flight will be identified by the origin and destination cities for that leg, e.g. (("BOS" "ATL") ("ATL" "DFW")). 8. "what kind of X is Y" queries, where Y is clearly a kind of X, will be interpreted as equivalent to "what does Y mean?", where Y is a primary key value for the table referred to by X (see 10 below). 9. "class". References to classes of service will be taken as referring to the contents of the compound_class table (not the class_of_service table). Queries about (unmodified) "class X", e.g. "What is class X?", will be interpreted as referring to the set of compound_class.fare_class entries for which "X" is the fare_class, not the base_class, e.g. '(("X"))', not '(("XA")("XB"))'. 10. Requests for the "meaning" of something will only be interpretable if that thing is a code with a canned definition in the database. Here are the things so defined, with the fields containing their decoding: Table Key Field Decoding Field aircraft aircraft_code aircraft_type airline airline_code airline_name airport airport_code airport_name city city_code city_name code_description code description column_table heading column_description day day_code day_name food_service meal_code meal_description interval period begin_time, end_time month month_number month_name state state_code state_name time_zone time_zone_code time_zone_name transport transport_code transport_description 11. A request for a flight's stops will be interpreted as asking for the final stop in addition to intermediate stops. 12. Literal yes-or-no questions, that is, queries that in normal discourse would be best answered with "yes" or "no" if taken literally, may be answered by either a boolean value ("YES/TRUE/NO/FALSE") or a relation, expressed as a table. Any non-null relation will be considered equivalent to "YES" or "TRUE" and the null relation will be considered equivalent to "NO" or "FALSE". 13. A city and an airport will be considered "near" (or "nearby") each other iff the city is served by the airport, and two cities will be considered "near" (or "nearby") each other iff there is an airport that serves them both. 14. When it is clear that an airline is being referred to, the term "American" by itself will be taken as unambiguously referring to American Airlines. 15. Vague queries of the form "Give me information about X" or "Describe X" or "What is X", where X refers to a table, will be interpreted as equivalent to "Show me X". When X is an attribute or attribute value, such queries will be interpreted as "What does X mean?".