Re: Relationship(s) for human family structure

From: Neo <>
Date: Tue, 21 Aug 2007 20:20:43 -0000
Message-ID: <>

> For example, suppose you have 5 tuples in 1 (person) or 2 (parent,
> child) relations corresponding to father "A" and childs (children!)
> B,C,D and E. Suppose A is father to all 4 childs B,C,D and E by two
> marriages: B and C offspring of the first marriage, D and E offspring
> of the second.
> How can you represent the parent-child relationships so that the step-
> sibling relationship is preservered? (I.e., so that B and E have the
> same father, but are not siblings.)

Below dbd script models above and queries for B's biological siblings.

(new 'male 'gender)
(new 'female 'gender)

(new 'arnold 'person)
(set arnold gender male)

(; arnold's first marriage)
(new 'sally 'person)
(set sally gender female)
(new 'spouse 'relationship)
(set arnold spouse sally)
(set sally spouse arnold)

(; arnold's children from 1st marriage)
(new 'billy 'person)
(new 'charlie 'person)
(set billy parent arnold)
(set charlie parent arnold)
(set billy parent sally)
(set charlie parent sally)

(; arnold's second marriage)
(new 'tina 'person)
(set tina gender female)
(set arnold spouse tina)
(set tina spouse arnold)

(; arnold's children from 2nd marriage)
(new 'dean 'person)
(new 'elizabeth 'person)
(set dean parent arnold)
(set elizabeth parent arnold)
(set dean parent tina)
(set elizabeth parent tina)

(; Get billy's silbings)
(; Gets charlie, dean, elizabeth and charlie again)
(!= (get * parent (get billy parent *)) billy)

(; Get billy's biological silbings)
(; Gets charlie)
(!= (and (get * parent (and (get billy parent *)

                                      (get * gender male)))
            (get * parent (and (get billy parent *)
                                      (get * gender female))))

For related thread, see "Network Example: Sibling of Opposite Gender" Received on Tue Aug 21 2007 - 22:20:43 CEST

Original text of this message