Exercise 20: Deriving properties of relationships

Summary

In addition to deriving property values and the existence of relationships, there are times we want to derive properties of relationships. For example:

"I have two sisters"
"I don't have a brother"
"How many siblings do I have?"

rule:
  $1 is_a person
  $1 has(count:$2) sister
  $1 has(count:$3) brother
  $count = # $2 + $3
  -> $1 has(count:$count) sibling

Web UI

Click here

Solution

Click here