As discussed later, role names displayed in square brackets are used to provide function names for
derivation rules that make use of attribute-style notation. The second role of predicates with the reading
“has” are assumed to have name of the second object type, with the first letter in lower-case, unless an
explicit role name overrides this. For example, the second role of Person has PersonName is named
“personName”. For binary predicates with a reading comprised of “has” followed by a hyphenated phrase,
the second role has a default name obtained by prepending the hyphenated phrase to the right-hand object
type term. For example, the second role of the fact type Year has normal- loan Period is “normalLoanPeriod”.
The superscript “1
” on the fact type Membership was issued to Person indicates the existence of a textual
constraint on this fact type. The asterisk “*” on the fact type Person has Age indicates that this fact type is
derived. In a complete ORM model, all constraints that cannot be expressed in graphical notation as well as
all derivation rules (to indicate how derived fact types are derived from other fact types) should be
specified in a formal, textual language. For example, the derivation rule for Person has Age may be specified
in attribute-style as shown below. Here, dayOfYearNr denotes the sequential position of the day in its year
(e.g. 2003 September 14 has dayOfYearNr 257).
Person.age = today.year – Person.birthdate.year if today.dayOfYearNr >= Person.birthdate.dayOfYearNr
else = today.year – Person.birthdate.year + 1
This formulation makes use of various operations (e.g. date subtraction) and functions (e.g. year) that
are predefined for Date. Figure 8 summarizes some of the main underlying semantics from an ORM
perspective. Each circled “u” depicts an external uniqueness constraint, indicating that each Year,
DayOfYearNr combination and each Year, MonthNr, DayNr combination refers to only one Date. While
the mdy (month-day-year) format for dates is used for communication purposes, internally dates may be
implemented otherwise (e.g. as Julian dates). Fundamentally, ORM uses relational-style, over which an
attribute-style may be defined. The nullary function “today” is defined as the result of the query !Date is
today (using “!” to prepend each desired projection). The role names “dayOfYearNr”, “year”, “monthNr”,
“dayNr” on the right-hand roles of the derived predicates may be used as function names in attribute-style
rules.
As discussed later, role names displayed in square brackets are used to provide function names for
derivation rules that make use of attribute-style notation. The second role of predicates with the reading
“has” are assumed to have name of the second object type, with the first letter in lower-case, unless an
explicit role name overrides this. For example, the second role of Person has PersonName is named
“personName”. For binary predicates with a reading comprised of “has” followed by a hyphenated phrase,
the second role has a default name obtained by prepending the hyphenated phrase to the right-hand object
type term. For example, the second role of the fact type Year has normal- loan Period is “normalLoanPeriod”.
The superscript “1
” on the fact type Membership was issued to Person indicates the existence of a textual
constraint on this fact type. The asterisk “*” on the fact type Person has Age indicates that this fact type is
derived. In a complete ORM model, all constraints that cannot be expressed in graphical notation as well as
all derivation rules (to indicate how derived fact types are derived from other fact types) should be
specified in a formal, textual language. For example, the derivation rule for Person has Age may be specified
in attribute-style as shown below. Here, dayOfYearNr denotes the sequential position of the day in its year
(e.g. 2003 September 14 has dayOfYearNr 257).
Person.age = today.year – Person.birthdate.year if today.dayOfYearNr >= Person.birthdate.dayOfYearNr
else = today.year – Person.birthdate.year + 1
This formulation makes use of various operations (e.g. date subtraction) and functions (e.g. year) that
are predefined for Date. Figure 8 summarizes some of the main underlying semantics from an ORM
perspective. Each circled “u” depicts an external uniqueness constraint, indicating that each Year,
DayOfYearNr combination and each Year, MonthNr, DayNr combination refers to only one Date. While
the mdy (month-day-year) format for dates is used for communication purposes, internally dates may be
implemented otherwise (e.g. as Julian dates). Fundamentally, ORM uses relational-style, over which an
attribute-style may be defined. The nullary function “today” is defined as the result of the query !Date is
today (using “!” to prepend each desired projection). The role names “dayOfYearNr”, “year”, “monthNr”,
“dayNr” on the right-hand roles of the derived predicates may be used as function names in attribute-style
rules.
การแปล กรุณารอสักครู่..
