Example of an airline business model

The following example shows the contents of a .bmd file that illustrates the business model of an airline use case. This file describes the entity types, event types, concepts, and enumerations that compose the model.

Business model definitions:

--------------------------------------------
-- This phrase defines an address concept --
--------------------------------------------
-- This phrase defines several attributes of type text because no other type is specified.
an address is a concept with a street, a second street, a town, a zip and a country.

-- These phrases define an employee.
an employee is a business entity identified by an employee id.
an employee has a last name, a first name, an address, an income (numeric) and a yearly income (numeric) .


----------------------------------------
-- This phrase defines an enumeration --
----------------------------------------
an aircraft model can be one of: Boeing B777, Airbus A380, Boeing B747.

---------------------------------------------
-- These phrases define an aircraft entity --
---------------------------------------------
an aircraft is a business entity identified by an aircraft ID.
an aircraft has a model (an aircraft model). 
an aircraft has a first class capacity (numeric).
an aircraft has a business class capacity (numeric).
an aircraft has an economy class capacity (numeric).
an aircraft has an economy plus class capacity (numeric).

-------------------------------------------- 
-- These phrases define an airport entity --
-------------------------------------------- 
an airport is a business entity identified by a code. 

-- This phrase defines several attributes.
an airport has a name, a temperature (numeric) , a location (a point) and a baggage handling system (text).

-- This phrase defines two numeric attributes.
an airport has a wind speed (numeric) and a precipitation level (numeric).
-- This phrase defines two numeric attributes (again).
an airport has a latitude (numeric) and a longitude (numeric). 

an airport has an address .

--This phrase defines a boolean attribute.
an airport can be open. 

--This phrase creates a multiple relationship between an airport and several flight instances.
an airport is related to some flights.

---------------------------------------
-- These phrases define a bag entity --
---------------------------------------
a bag is a business entity identified by a bag ID.
a bag has a weight (numeric).

-- This  phrase illustrates another way to define a named relationship between two entities.
a bag is related to a customer, named the owner.

------------------------------------------------
-- These phrases define a loyalty enumeration --
------------------------------------------------
a loyalty level can be one of: Ivory, Bronze, Silver, Gold.
a loyalty is a concept with a card number, a level (a loyalty level) and a number of miles (numeric). 

------------------------------------------------
-- This phrase defines a mobile phone concept --
------------------------------------------------
--This phrase defines several attributes of type text because no other type is specified.
a mobile phone is a concept with a country code and a number.

-------------------------------------------
-- These phrases define a person entity --
-------------------------------------------
a person is a business entity identified by an ID with a first name, a last name, an email and a place of birth.
a person has a mobile (a mobile phone).
a person has some addresses.

--------------------------------------------
-- These phrases define a customer entity --
--------------------------------------------
-- This phrase defines an entity that inherits from a concept.
a customer is a person.
a customer has a loyalty status (a loyalty).

-- This  phrase illustrates another way to define a named relationship.
a customer is related to an emergency contact that is a person.
a customer has some customer satisfaction events.
a customer is related to some trips.
a customer is related to some flights.

------------------------------------------
-- These phrases define a flight entity --
------------------------------------------
a flight is a business entity identified by a flight number.

-- This phrase infers the type of the aiport from the existing airport entity.
-- This phrase defines several relationships.
a flight is related to a departure airport and an arrival airport.
a flight has a departure gate and an arrival gate.
a flight has a scheduled departure time (date & time) and a scheduled arrival time (date & time).  
a flight is related to an aircraft.
a flight has a planned duration (duration).
a flight has a current location used as the default point.
a flight has a route used as the default line string. 

-- This phrase defines a default value. Default values can be defined for numeric and text only.
a flight has a number of miles (numeric, 1000 by default).
a flight is related to some boarded passengers (customers).

--------------------------------------------------------
-- This phrase defines a seating category enumeration --
--------------------------------------------------------
a seating category can be one of: Economy, Economy Plus, Business, First.

----------------------------------------------
-- This phrase defines a status enumeration --
----------------------------------------------
a status can be one of: Booked, Checked In, Boarding.

------------------------------------------
-- These phrases define a ticket entity --
------------------------------------------
a ticket is a business entity identified by a ticket number. 
a ticket has a price (numeric).
a ticket is related to a trip.
a ticket is related to a customer.
a ticket has a seating category.
a ticket has a status.

----------------------------------------
-- These phrases define a trip entity --
----------------------------------------
a trip is a business entity identified by an ID.
a trip is related to a customer, named the owner.
a trip is related to some tickets.
a trip is related to some checked bags (bags).
a trip can be completed.
a trip has a start (date & time).
a trip has an end (date & time).

-------------------------------------------------------------- 
-- These phrases define events related to an airport entity --
-------------------------------------------------------------- 
an airport event is a business event time-stamped by a datetime.
an airport event is related to an airport.

--This phrase defines an inheritance relationship between two event types.
an airport open event is an airport event.
an airport closed event is an airport event with an estimated reopen date (date & time).

---------------------------------------------------------
-- These phrases define events related to a bag entity --
---------------------------------------------------------
a bag scan event is a business event time-stamped by a scan datetime with a scan ID and a scan location (a point).
a bag scan event is related to an airport tag (an airport) and a bag.
a bag unloaded event is a bag scan event. 
a bag unloaded event is related to a flight.  
a bag loaded event is a bag scan event. 
a bag loaded event is related to a flight.  

-------------------------------------------------------------- 
-- These phrases define events related to a customer entity --
-------------------------------------------------------------- 
a customer satisfaction event is a business event time-stamped by a time with a description.
a customer satisfaction event is related to a flight.
a flight late arrival event is a customer satisfaction event.
a flight late departure event is a customer satisfaction event.
a bag lost event is a customer satisfaction event.
a customer subscribe event is a business event time-stamped by a subscription time.
a customer subscribe event is related to an emergency contact that is a person.
a customer subscribe event is related to a customer.

--------------------------------------------------------------------
-- These phrases define events related to a flight and a customer -- 
--------------------------------------------------------------------
a flight event is a business event time-stamped by a flight time.
a flight event is related to a flight.
a flight event is related to a customer.
a flight departure event is a flight event.
a flight arrival event is a flight event.
a flight rescheduled event is a flight event.
a flight rescheduled event has a scheduled departure time (date & time) and a new departure gate.
a flight delayed event is a flight event.
a flight delayed event has a remaining flight time (duration).
a flight redirect event is a flight event.
a flight redirect event is related to an old destination airport. 
a flight gate changed event is a business event time-stamped by a gate change time with a previous gate and a new gate.
a flight emergency event is a business event time-stamped by an emergency time with a description.
a flight emergency event is related to some customers.
a flight movement event is a flight event with a new location (a point).
a flight airport movement event is a flight movement event related to an airport. 
a flight taxi event is a flight airport movement event.
a flight takeoff event is a flight airport movement event.
a flight landing event is a flight airport movement event.
a flight arrived to gate is a flight airport movement event with a gate.

------------------------------------------------------------------------------
-- These phrases define a purchase event related to a flight and a customer -- 
------------------------------------------------------------------------------ 
-- This phrase defines an event. A time stamp will be created with a default name. 
a purchase event is a business event.
a purchase event is related to a flight.
a purchase event is related to a customer.
a purchase event has an amount (numeric).

---------------------------------------
-- This phrase defines data provider -- 
--------------------------------------- 
a weather provider is a data provider,
    accepts a longitude (numeric) and a latitude (numeric),
    returns a temperature (numeric), a wind speed (numeric) and a precipitation level (numeric).

Business model statements:

--------------------------------------------------------------------------------------------------------------
-- This statement defines the enrichment of the wind speed and precipitation level attributes of an airport -- 
-------------------------------------------------------------------------------------------------------------- 
an airport is enriched by the weather provider, 
	 given 
	    the latitude from the latitude of this airport 
	 and 
	    the longitude from the longitude of this airport,
	 setting 
	 	  the temperature to the temperature of this weather provider,
	 	  the wind speed to the wind speed of  this weather provider 
	 	  and the precipitation level to the precipitation level of this weather provider.

------------------------------------------------------------------------------
-- This statement defines the initialization of a bag from a bag scan event -- 
------------------------------------------------------------------------------ 
a bag is initialized from a bag scan event , where this bag comes from the bag of this bag scan event: 
- set the weight of this bag to the weight of the bag of this bag scan event 
- set the owner of this bag to the owner of the bag of this bag scan event. 

--------------------------------------------------------------------------
-- This statement defines the derivation of the yearly income attribute -- 
-------------------------------------------------------------------------- 
the yearly income of an employee is the income of this employee  * 12 .

An error displays because this example defines a weather data provider that is not implemented. To resolve this error, the data provider needs to be implemented and referenced by the solution.