Re: Network Example: Sibling of Opposite Gender

From: Neo <neo55592_at_hotmail.com>
Date: 7 Jan 2007 22:43:50 -0800
Message-ID: <1168238630.936459.24270_at_q40g2000cwq.googlegroups.com>


Correction: Prior post had wrong dbd expression for query #4 (accidently copied that for #3).



QUERY 4) Find persons with builds with whom Bob's build has same relationship as John's build's relationship with Mary's build (without explicitly referring to that relationship in the query).

(get * build (get (get bob build *)

                       (get (get john build *) * (get mary build *))
                       *))

SELECT answer.name AS "Bob's bld same as john & mary"
  FROM Sibling.person         john

, Sibling.person_build john_bld
, Sibling.person mary
, Sibling.person_build mary_bld
, Sibling.person bob
, Sibling.person_build bob_bld
, Sibling.person answer
, Sibling.person_build answer_bld
WHERE john.name = 'john' AND mary.name = 'mary' AND bob.name = 'bob' AND john_bld.id = john.id

   AND mary_bld.id = mary.id
   AND bob_bld.id = bob.id
   AND relationship(find_verb(john_bld.build, mary_bld.build),
                            bob_bld.build, answer_bld.build) = 'Y'
   AND answer.id = answer_bld.id; Received on Mon Jan 08 2007 - 07:43:50 CET

Original text of this message