Re: Terminology for composite attributes

From: Neo <neo55592_at_hotmail.com>
Date: 22 Mar 2005 07:16:13 -0800
Message-ID: <1111504573.537411.109600_at_o13g2000cwo.googlegroups.com>


> I'd like to know if "composite attributes" is the best terminology...

The answer might depend on what one considers to be "best".

The XDb3 script below models a person without a phone number, a person with 1 phone number, and a person with 3 phone numbers each having multiple types and attributes some of which are created on the fly. Sample queries at end.

// Create various types, show person in main directory.

[Quoted] (CREATE type inst *person  & dir item it)
(CREATE type inst *phone#)
(CREATE type inst *home#)
(CREATE type inst *office#)
(CREATE type inst *fax#)
(CREATE type inst *ext)

// Create a person without a phone number.
(CREATE person inst *john)

// Create a person with one phone number.
(CREATE person inst *mary

      & it phone# +111-2222)

// Create a person with multiple phone numbers
// some of them with multiple types and attributes.
// Note the type cell# and attribute "area code"
// are created on the fly.

(CREATE person inst *bob

      & it phone# (CREATE phone# inst *333-4444
                        & home# inst it)
      & it phone# (CREATE phone# inst *444-5555
                        & office# inst it
                        & it ext +123)
      & it phone# (CREATE phone# inst *666-7777
                        & fax# inst it
                        & (CREATE type inst *cell#) inst it
                        & it (CREATE type inst *"area code") +312))

// Find a person with a phone# with area code 312.
// Finds bob.

(SELECT * phone# (* "area code" 312))

// Find bob's cell#.
// Finds 666-7777.

(SELECT bob phone# (cell# inst *))

// Find bob's phone#s.
// Finds 333-4444, 444-5555, 666-7777.

(SELECT bob phone# *) Received on Tue Mar 22 2005 - 16:16:13 CET

Original text of this message