How to infer isBrotherOf property between two individuals

前端 未结 4 549
轮回少年
轮回少年 2020-11-30 10:47

I need to infer that one individual is the brother of other one if they have the same father.

So, if I have this:

Bart hasFather Homer.

4条回答
  •  不知归路
    2020-11-30 11:30

    One way to this is by using SWRL rules.

    On protege:

    1. go to Window
    2. Click on Tabs
    3. Click on Swrl Tab
    4. Press the "new" button and write the following rule

    Write rule:

    isChildOf(?x,?y)^FatherOf(?y,?z)^differentFrom(?z,?x)->isBrotherOf(?x,?z)
    

    This means that if "x is a child of y", and "y is also a parent of z" and "z and x are different" then "z and x are Brothers".

提交回复
热议问题