dbTalk Databases Forums  

Modelling Diary Events (with XDb3)

comp.databases.object comp.databases.object


Discuss Modelling Diary Events (with XDb3) in the comp.databases.object forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Neo
 
Posts: n/a

Default Modelling Diary Events (with XDb3) - 02-28-2005 , 03:05 PM






The script below models the following requirements using an
experimental db (XDb3). The equivalent can be performed with an RMDB
using nested relations and generic modelling.

- A person has 0 to may diaries.
- A diary contains 0 to many days.
- A day has 0 to many events.
- An event has a start time.
- An event has 0 to many participants.

// Create directoy items to organize things.
(CREATE dir item *person)
(CREATE dir item *diary)
(CREATE dir item *day)
(CREATE dir item *event)
(CREATE dir item *time)
(CREATE dir item *participant)

// Create persons john, mary and bob.
(CREATE person inst *john)
(CREATE person inst *mary)
(CREATE person inst *bob)

// Log lunch with mary at 12PM on 2/25/05 in john's work diary.
(CREATE john diary *work day +2/25/05 event +lunch time +1200 )
(CREATE john diary work day +2/25/05 event +lunch participant mary)

// Log meeting with bob at 1PM on 2/25/05 in john's work diary.
(CREATE john diary work day +2/25/05 event +meeting time +1300)
(CREATE john diary work day +2/25/05 event +meeting participant bob)

// Log golf w/ mary and bob at 9AM on 2/26/05 in john's personal diary.
(CREATE john diary *personal day +2/26/05 event +golf time +900)
(CREATE john diary personal day +2/26/05 event +golf participant mary)
(CREATE john diary personal day +2/26/05 event +golf participant bob)

// Find all events in john's work diary for 2/25/05.
// Finds lunch and meeting.
(SELECT john diary work day 2/25/05 event *)

// Find what are mary and bob participants of.
// Finds golf on 2/26/05 logged in john's personal diary.
(SELECT * participant mary & * participant bob)


Reply With Quote
  #2  
Old   
Lee Fesperman
 
Posts: n/a

Default Re: Modelling Diary Events (with XDb3) - 02-28-2005 , 03:37 PM






Neo wrote:
Quote:
The script below models the following requirements using an
experimental db (XDb3). The equivalent can be performed with an RMDB
using nested relations and generic modelling.
Don't multi-post!

--
Lee Fesperman, FFE Software, Inc. (http://www.firstsql.com)
================================================== ============
* The Ultimate DBMS is here!
* FirstSQL/J Object/Relational DBMS (http://www.firstsql.com)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.