Re: Finding Brothers & Sisters (with dbd)
- From: "Neo" <neo55592@xxxxxxxxxxx>
- Date: 22 Dec 2006 09:09:22 -0800
A slight various on the original example. Here we find John's sibling
of opposite gender. Note that the query does not refer to John's father
(Adam) or John's gender (male) directly.
(new 'male 'gender)
(new 'female 'gender)
(new 'opposite 'verb)
(set male opposite female)
(set female opposite male)
(new 'adam 'person)
(new 'john 'person)
(set john gender male)
(new 'jack 'person)
(set jack gender male)
(new 'mary 'person)
(set mary gender female)
(set adam child john)
(set adam child jack)
(set adam child mary)
(; Get john's sibling of opposite gender
by getting persons
whose gender is opposite
and is child of john's parent
and that person is not himself)
(; Gets mary)
(!= (and (get person instance *)
(get * gender (get (get john gender *) opposite *))
(get (get * child john) child *))
john)
.
- Follow-Ups:
- References:
- Finding Brothers & Sisters (with dbd)
- From: Neo
- Finding Brothers & Sisters (with dbd)
- Prev by Date: Re: Choosing DB Software advice needed
- Next by Date: Re: Finding Brothers & Sisters (with dbd)
- Previous by thread: Finding Brothers & Sisters (with dbd)
- Next by thread: Re: Finding Brothers & Sisters (with dbd)
- Index(es):