Modelling Recruitment Agencies (with xrdb)
- From: "Neo" <neo55592@xxxxxxxxxxx>
- Date: 30 Jun 2005 07:47:20 -0700
Below xrdb script models two recruitment agencies (TechSrc,
BrainDrain), two companies (Intel, Tyco) three persons (John, Mary,
Bob) and one job opening (Db Admin at Intel); with various
relationships (see script comments) among things. Sample queries near
end. Copy and paste the script shown below into app's input box and
press submit button. To view the data (without having to perform joins
or create views), expand appropriate tree nodes. To download app (fits
on floppy) see www.xrdb.com
// Create various types
// and make them item of main directory.
// Note: "inst" is short for instance.
(CREATE type inst *recruiter & dir item it)
(CREATE type inst *company & dir item it)
(CREATE type inst *person & dir item it)
(CREATE type inst *job & dir item it)
(CREATE type inst *salary)
// Create types for person attributes.
(CREATE type inst *title)
(CREATE type inst *ph#)
(CREATE type inst *ext#)
(CREATE type inst *field)
// Create verbs to relate things.
(CREATE verb inst *customer)
(CREATE verb inst *contact)
(CREATE verb inst *candidate)
(CREATE verb inst *employer)
(CREATE verb inst *employe)
(CREATE verb inst *expertise)
// Create 2 companies: Intel & Tyco.
(CREATE company inst *Intel)
(CREATE company inst *Tyco)
// Create a recruiter named TechSrc
// whose customer is Intel.
(CREATE recruiter inst *TechSrc)
(CREATE TechSrc customer Intel)
// Create a recruiter named BrainDrain
// whose customers are Intel & Tyco.
(CREATE recruiter inst *BrainDrain)
(CREATE BrainDrain customer Intel)
(CREATE BrainDrain customer Tyco)
// Create a job opening at Intel for a Db Admin
// whose salary is $60K per year.
(CREATE job inst *"Db Admin")
(CREATE "Db Admin" at Intel)
(CREATE Intel job "Db Admin")
(CREATE "Db Admin" salary +$60K/yr)
// Create a person named John
// and John's employer is Intel
// and John's ph# is 111-1111
// and is TechSrc' contact.
(CREATE person inst *John)
(CREATE John title (CREATE title inst *engineer))
(CREATE John employer Intel)
(CREATE Intel employe John)
(CREATE John ph# (CREATE ph# inst *111-1111))
(CREATE TechSrc contact John)
// Create a person named Mary
// and her expertise is in the field of mgmt
// and her tile is manager
// and her employer is Tyco
// and her ph#s are 222-2222 & 333-3333
// and is TechSrc's candidate for "Db Admin" job.
(CREATE person inst *Mary)
(CREATE Mary expertise (CREATE field inst *mgmt))
(CREATE Mary title (CREATE title inst *manager))
(CREATE Mary employer Tyco)
(CREATE Tyco employe Mary)
(CREATE Mary ph# (CREATE ph# inst *222-2222))
(CREATE Mary ph# (CREATE ph# inst *333-3333))
(CREATE TechSrc job "Db Admin" candidate Mary)
// Create a person named Bob
// and his expertise is in the fields of hardware and software.
// and isn't employed
// and his phn# is 444-4444 with ext# 345
// and is BrainDrain's candidate for "Db Admin" job
// and is TechSrc's contact.
(CREATE person inst *Bob)
(CREATE Bob expertise (CREATE field inst *hardware))
(CREATE Bob expertise (CREATE field inst *software))
(CREATE Bob ph# (CREATE ph# inst *444-4444
& it ext# (CREATE ext# inst *345)))
(CREATE BrainDrain job "Db Admin" candidate Bob)
(CREATE TechSrc contact Bob)
// Find TechSrc's candidate for "Db Admin" job.
// Returns Mary.
(SELECT TechSrc job "Db Admin" candidate *)
// Find all candidates for "Db Admin" job.
// Finds Mary and Bob.
(SELECT (recruiter inst *) job "Db Admin" candidate *)
.
- Prev by Date: Re: Changing object class definition in OODB?
- Next by Date: CfP: OMG's Architecture-Driven Modernzation Workshop, 2005
- Previous by thread: Re: Changing object class definition in OODB?
- Next by thread: CfP: OMG's Architecture-Driven Modernzation Workshop, 2005
- Index(es):