[REBOL] Sentences expressed as ORM
From: AJMartin::orcon::net::nz at: 24-Jan-2004 11:49
Some time ago we had a look at the Sentences database product and how it
could be expressed in Rebol as a general database. At the time, I couldn't
figure out to put it together. Just today, I came across ORM or Object Role
Modelling at http://www.orm.net/ which is where I think that Sentences came
I also figured out a Rebol implementation of ORM that's easy to understand
and use (and seems easy to explain). Here's Table 1 from Business Rules and
Object Role Modeling:
Athlete Country Birthplace
Ann Arbor USA USA
Bill Abbot UK ?
Chris Lee USA NZ
And here's the facts (or "objects"):
and their roles (or relations):
Athlete "represents" Country "represented by" [
Athlete "was born in" Country "birthplace of" [
; Note that the birthplace of "Bill Abbot" is unknown.
I've even added an extra unary relation/role:
Athlete "smokes" [
The dialect for roles/relationships is:
Fact opt "relationship string" block of integer indexes
Fact "relationship string" Fact "reverse relationship" block of pairs of
Ternary (I think!)
Fact "relationship string" "reverse relationship" Fact "relationship"
reverse relationship Fact block of pairs of integer indexes.
For a small-ish database, one file holding the above information would be
OK. For a much larger database, I'd use a file for each block of
facts/objects, and a file for each block of relationships.
Andrew J Martin