Administrator
|
Hello,
This is a common "trap" in formal reasoning. Here, you asserted that the individual Relation is related to Actor1 and Actor2.
However, the reasoning works under the "open-world assumption" : every fact non asserted is not considered as false but as possible.
Here, there might be an (unasserted) Actor3 that is related to Relation, thus Relation is not classified in TestRelation1.
In addition, the reasoner also considers that Actor1 and Actor2 might be the same individual. Consequently, you cannot be sure that there is at least 2 * different * actors (this explain why you did not obtain the expected results with min(2,..)).
To solve this problem, you need :
First, to assert that the two Actors are different:
AllDisjoint([onto.Actor1, onto.Actor2])
Second, to assert that Relation is not related to any other actors:
relation.is_a.append(relates.only(OneOf([onto.Actor1, onto.Actor2])))
This second step can also be automated using Owlready close_world function:
close_world(relation)
Best regards,
Jiba
|