How to infer isBrotherOf property between two individuals

前端 未结 4 557
轮回少年
轮回少年 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:15

    A brother is a male sibling. Consequently, we should define both 'male' and being a sibling. But since a sibling is itself a non-identical child of the same parents, one should also define being a child. For simplicity, we'll treat half-siblings as siblings, restrict the domain to humans, and leave the explicit definition of related concepts like motherhood and fatherhood aside.

    1 Define Man

    1. Create a Human class
    2. Create a Gender class disjoint with the Human class. Create male and female as individuals instantiating the Gender type (there are other ways to do this, but this is a pretty simple one).
    3. Create a hasGender Object property, with Human as domain and Gender for its range
    4. Create a Man class as a subclass of Human. Make it equivalent to Human and (hasGender value male).

    2 Define child

    1. Create an isChildOf Object property with Human for both its domain and range (Optional: Define a Child class as a subtype of human equivalent to isChildOf some Human. In similar fashion, you can also create object properties, then classes for Mother, Parent, Daughter, etc).

    3 Define sibling with help from SWRL

    1. First, create an irreflexive, symmetric isSiblingOf object property in Protege with Human for its domain and range.
    2. In the menu bar at the top of Protege, ensure Window -> tabs -> SWRLTab is checked and then find and click on the SWRLTab tab.
    3. Click new to create a new rule, and add the rule: isChildOf(?sibling1, ?parent) ^ isChildOf(?sibling2, ?parent) ^ differentFrom(?sibling1, ?sibling2) -> isSiblingOf(?sibling1, ?sibling2) You may also want to add rules for what you want to be able to infer from the siblinghood relation, e.g isSiblingOf(?x, ?y) ^ isChildOf(?x, z?) -> isChildOf(?y, ?z)

    4 Define being a brother of

    1. Create an isBrotherOf Object property in Protege with domain Man and range Human
    2. On the SWRLTab, add the following rules: Man(?x) ^ isSiblingOf(?x, ?y) -> isBrotherOf(?x, ?y)

    isBrotherOf(?x, ?y) -> Man(?x)

    isBrotherOf(?x, ?y) -> isSiblingOf(?x, ?y)

    The first rule states that any male sibling is a brother. The second and third infer maleness and siblinghood from brotherhood.

    1. Optionally create a Brother class equivalent to isBrotherOf some Human to complete the rollification process.

提交回复
热议问题