The following dbd example models Adam who has children named
John(male), Jack(male) and Mary(female). Queries find John's siblings,
brothers and sisters.
(new 'male 'gender)
(new 'female 'gender)
(new 'adam 'person)
(new 'john 'person)
(set john gender male)
(new 'jack 'person)
(set jack gender male)
(new 'mary 'person)
(set mary gender female)
(new 'child 'verb)
(set adam child john)
(set adam child jack)
(set adam child mary)
(; Get john's siblings
by getting persons
who is a child of john's father
and that person is not himself)
(; Gets jack and mary)
(!= (and (get person instance *)
(get (get * child john) child *))
john)
(; Get john's brothers
by getting persons
whose gender is male
and is child of john's father
and that person is not himself)
(; Gets jack)
(!= (and (get person instance *)
(get * gender male)
(get (get * child john) child *))
john)
(; Get john's sisters
by getting persons
whose gender is female
and is child of john's father
and that person is not himself)
(; Gets mary)
(!= (and (get person instance *)
(get * gender female)
(get (get * child john) child *))
john)
For more examples, see www.dbfordummies.com