dbTalk Databases Forums  

Modelling Contruction Projects (with xrdb)

comp.databases.object comp.databases.object


Discuss Modelling Contruction Projects (with xrdb) in the comp.databases.object forum.



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

Default Modelling Contruction Projects (with xrdb) - 06-01-2005 , 09:11 AM






The xrdb script below models Donald Trumph's project which has one
designer and three contractors. Owner gives Funding Doc to designer on
1/1/05. Designer gives Funding Doc and to contractors on various dates.
The contractors give various forms to designer on various dates. See
script for details and sample query at end. The resulting normalized
data can be viewed in xrdb's tree/grid views
(www.xrdb.com/example/ex139.asp) without user performing joins.

// Create various types.
(CREATE type inst *project
& dir item it)
(CREATE type inst *owner)
(CREATE type inst *designer)
(CREATE type inst *contractor)

(CREATE type inst *document)
(CREATE type inst *doc#)
(CREATE type inst *rev#)

(CREATE type inst *form)
(CREATE type inst *form#)

(CREATE type inst *date)

// Create fields for documents and forms.
(CREATE type inst *field1)
(CREATE type inst *field2)
(CREATE type inst *field3)
(CREATE type inst *field4)

// Create verbs
(CREATE verb inst *has)
(CREATE verb inst *gave)

// Create a Funding Document
// with doc# and rev#
// with fields 1, 3 and 4.
(CREATE document inst *"funding doc"
& it doc# +2222
& it rev# +A
& it field1 +abc
& it field3 +xyz
& it field4 +fgh)

// Create a Zoning Form that reference above doc with rev#
// with fields 1 and 3
(CREATE form inst *"zoning form"
& it form# +777
& it field1 +abc
& it field3 +xyz
& it document (* doc# 2222 & * rev# A))

// Create a License Form that reference above doc without rev#
// with fields 2 and 3.
(CREATE form inst *"license form"
& it form# +888
& it field2 +mno
& it field3 +def
& it document (* doc# 2222))

(CREATE project inst *"Trumph Tower II"
& it owner +"donald trump inc"
gave "funding doc"
to (CREATE designer inst *"brown & root")
on (CREATE date inst *1/1/05)
& it designer +"brown & root"
gave "funding doc"
to (CREATE contractor inst *"joe's cement")
on (CREATE date inst *2/1/05)
& it designer +"brown & root"
gave "funding doc"
to (CREATE contractor inst *"billy's plumbing")
on (CREATE date inst *3/1/05)
& it contractor +"joe's cement"
gave (* name "zoning form" & * form# 777)
to "brown & root"
on (CREATE date inst *4/1/05)
& it contractor +"billy's plumbing"
gave (* name "license form" & * form# 888)
to "brown & root"
on (CREATE date inst *5/1/05))

// On Trumph Tower II project, contractors gave what?
// Finds forms 777 and 888.
(SELECT "Trumph Tower II" contractor (contractor inst *) gave *)


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.