我想使用 Jess 在家庭本体中找到 Bob 孩子。以下规则应该这样做:
(defrule FindBobChildren
(object (is-a https://wiki.csc.calpoly.edu/OntologyTutorial/family_example.owl#Person)
(OBJECT ?oi)
(https://wiki.csc.calpoly.edu/OntologyTutorial/family_example.owl#hasParent
?b&:(eq (instance-name ?b) (instance-name https://wiki.csc.calpoly.edu/OntologyTutorial/family_example.owl#Bob)))
)
=>
(printout t "Bob children:" (instance-name ?oi) crlf)
)
但是,不幸的是,它只打印出只有 Bob 作为他/她的父母的孩子。例如,如果一个人有 Bob 和 Mary 作为他/她的父母,那么它不会被规则匹配。