Re: Finding Brothers & Sisters (with dbd)



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)

.